source: extensions/lmt/admin/plugin_admin_manage.tpl @ 5548

Last change on this file since 5548 was 5548, checked in by grum, 14 years ago

Update the plugin for compatibility with Piwigo 2.1

File size: 4.6 KB
Line 
1
2{if $nbphotos==0}
3  <p>{'lmt_caddie_is_empty_please_fill_it'|@translate}</p>
4{else}
5
6{literal}
7<script type="text/javascript">
8$(document).data("nbsel", {/literal}{$nbphotos}{literal});
9
10  function loadpage(pagenum)
11  {
12    tmp=$.ajax({
13      type: "POST",
14      url: "{/literal}{$datas.LMT_AJAX_URL_LIST}{literal}"+pagenum,
15      async: false,
16     }).responseText;
17
18    $("#nbphotos").attr("innerHTML", tmp.substr(0,tmp.indexOf("#")));
19    $("#list").attr("innerHTML", tmp.substr(tmp.indexOf("#")+1));
20  }
21
22  function swap_state(id)
23  {
24    if($("#"+id).val()=="1")
25    {
26      $("#"+id).val("0");
27      $("#img"+id).attr("className", "is_off");
28      $(document).data("nbsel", $(document).data("nbsel")-1);
29    }
30    else
31    {
32      $("#"+id).val("1");
33      $("#img"+id).attr("className", "is_on");
34      $(document).data("nbsel", $(document).data("nbsel")+1);
35    }
36    $("#btsubmit").get(0).disabled=($(document).data("nbsel")==0);
37  }
38
39  function change_select()
40  {
41    act=$("#selectlist").val();
42    switch(act)
43    {
44      case '-':
45        break;
46      case 'all':
47        $(document).data("nbsel", {/literal}{$nbphotos}{literal});
48        $("input").filter(".none").each(
49          function(i)
50          {
51            this.value="1";
52            $("#img"+this.id).attr("className", "is_on");
53          }
54        );
55        break;
56      case 'none':
57        $(document).data("nbsel", 0);
58        $("input").filter(".none").each(
59          function(i)
60          {
61            this.value="0";
62            $("#img"+this.id).attr("className", "is_off");
63          }
64        );
65        break;
66      case 'invert':
67        $("input").filter(".none").each(
68          function(i)
69          {
70            if(this.value=="1")
71            {
72              this.value="0";
73              $("#img"+this.id).attr("className", "is_off");
74              $(document).data("nbsel", $(document).data("nbsel")-1);
75            }
76            else
77            {
78              this.value="1";
79              $("#img"+this.id).attr("className", "is_on");
80              $(document).data("nbsel", $(document).data("nbsel")+1);
81            }
82          }
83        );
84        break;
85      default:
86        $(document).data("nbsel", 0);
87        $("input").filter(".none").each(
88          function(i)
89          {
90            if(this.alt==act)
91            {
92              this.value="1";
93              $("#img"+this.id).attr("className", "is_on");
94              $(document).data("nbsel", $(document).data("nbsel")+1);
95            }
96          }
97        );
98        break;
99    }
100    $("#selectlist").get(0).options[0].selected=true;
101    $("#btsubmit").get(0).disabled=($(document).data("nbsel")==0);
102  }
103
104</script>
105{/literal}
106
107
108<form method="POST">
109
110  <fieldset>
111    <legend>{'lmt_caddie_items'|@translate}</legend>
112
113    <div id="list">
114    </div>
115
116    <p class="lmt_page" style="border-top:1px dotted;padding-top:10px;">
117      <span id="nbphotos" style="float:right;"></span>
118      <span>
119          <select id="selectlist" onchange="change_select();">
120            {html_options values=$selectlist_list_values output=$selectlist_list_labels selected=$selectlist_list_selected}
121          </select>
122      </span>
123    </p>
124  </fieldset>
125
126  <fieldset>
127    <legend>{'lmt_licence_to_apply'|@translate}</legend>
128
129    <p class="lmt_page">
130      <table class="formtable">
131        <tr>
132          <td>{'lmt_licence'|@translate}</td>
133          <td>
134            <select name="licence">
135              {html_options values=$licences_list_values output=$licences_list_labels selected=$licences_list_selected}
136            </select>
137          </td>
138        </tr>
139        <tr>
140          <td>{'lmt_author'|@translate}</td>
141          <td>
142            <select name="author">
143              {html_options values=$author_list_values output=$author_list_labels}
144            </select>
145          </td>
146        </tr>
147      </table>
148    </p>
149  </fieldset>
150
151  <fieldset>
152    <legend>{'Caddie management'|@translate}</legend>
153    <label><input type="radio" name="manage_caddie" value="app_nothing" checked>&nbsp;{'lmt_apply_do_nothing'|@translate}</label><br/>
154    <label><input type="radio" name="manage_caddie" value="app_clear">&nbsp;{'lmt_apply_do_clear'|@translate}</label><br/>
155    <label><input type="radio" name="manage_caddie" value="app_clear_selected">&nbsp;{'lmt_apply_do_clear_selected'|@translate}</label><br/>
156    <label><input type="radio" name="manage_caddie" value="napp_clear_selected">&nbsp;{'lmt_dontapply_do_clear_selected'|@translate}</label><br/>
157</fieldset>
158
159  <p><input type="submit" id="btsubmit" name="submit_apply_licence" value="{'lmt_apply'|@translate}"></p>
160
161</form>
162
163<script type="text/javascript">
164  loadpage(1);
165</script>
166
167{/if}
Note: See TracBrowser for help on using the repository browser.