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

Last change on this file since 16014 was 16014, checked in by grum, 12 years ago

feature:2641- compatibility with Piwigo 2.4

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