source: trunk/admin/themes/default/template/plugins_list.tpl @ 10378

Revision 10378, 8.8 KB checked in by mistic100, 9 years ago (diff)

plugin manager : description tooltip on the title, tooltip for restoration link

  • Property svn:eol-style set to LF
Line 
1{combine_script id='jquery.ajaxmanager' load='footer' require='jquery' path='themes/default/js/plugins/jquery.ajaxmanager.js' }
2
3{footer_script require='jquery.ajaxmanager'}
4/* incompatible message */
5var incompatible_msg = '{'WARNING! This plugin does not seem to be compatible with this version of Piwigo.'|@translate|@escape:'javascript'}';
6incompatible_msg += '\n';
7incompatible_msg += '{'Do you want to activate anyway?'|@translate|@escape:'javascript'}';
8
9/* group action */
10var pwg_token = '{$PWG_TOKEN}';
11var confirmMsg  = '{'Are you sure?'|@translate|@escape:'javascript'}';
12{literal}
13var queuedManager = jQuery.manageAjax.create('queued', {
14  queue: true, 
15  maxRequests: 1,
16  complete: function() { location.reload(); }
17});
18
19jQuery(document).ready(function() {
20  /* group action */
21  jQuery('a.deactivate_all').click(function() {
22    if (confirm(confirmMsg)) {
23      jQuery('div.active').each(function() {
24        performPluginAction(jQuery(this).attr('id'), 'deactivate');
25      });
26    }
27  });
28  jQuery('a.activate_all').click(function() {
29    if (confirm(confirmMsg)) {
30      jQuery('div.inactive').each(function() {
31        performPluginAction(jQuery(this).attr('id'), 'activate');
32      });
33    }
34  });
35  function performPluginAction(id, action) {
36   queuedManager.add({
37      type: 'GET',
38      dataType: 'json',
39      url: 'ws.php',
40      data: { method: 'pwg.plugins.performAction', action: action, plugin: id, pwg_token: pwg_token, format: 'json' },
41      success: function(data) {
42        if (data['stat'] == 'ok') {
43          if (action == 'deactivate')
44            jQuery("#"+id).removeClass('active').addClass('inactive');
45          else
46            jQuery("#"+id).removeClass('inactive').addClass('active');
47        }
48      }
49    });
50  };
51
52  /* incompatible message */
53  jQuery('.incompatible a.incompatible').click(function() {
54    return confirm(incompatible_msg);
55  });
56 
57  /* TipTips */
58  jQuery('.warning').tipTip({
59    'delay' : 0,
60    'fadeIn' : 200,
61    'fadeOut' : 200,
62    'maxWidth':'250px'
63  });
64  jQuery('.plugin-restore').tipTip({
65    'delay' : 0,
66    'fadeIn' : 200,
67    'fadeOut' : 200
68  });
69  jQuery('.pluginMiniBoxDesc').tipTip({
70    'delay' : 0,
71    'fadeIn' : 200,
72    'fadeOut' : 200,
73    'maxWidth':'300px', /* not effective, TipTip bug */
74    'defaultPosition':'left',
75    'keepAlive':true
76  });
77});
78{/literal}
79{/footer_script}
80
81<div class="titrePage">
82  <span class="sort">
83    <form action="" method="get" name="change_order">
84      <input type="hidden" name="page" value="plugins_list"/>
85      {'Sort order'|@translate} :
86      <select name="plugin_order" onchange="this.form.submit();">
87        <option value="status" {if $plugin_order=='state'}selected="selected"{/if}>{'Status'|@translate}</option>
88        <option value="name" {if $plugin_order=='name'}selected="selected"{/if}>{'Name'|@translate}</option>
89      </select>
90      &nbsp;&nbsp;|&nbsp;&nbsp;
91      {'Display'|@translate} :
92      <select name="plugin_display" onchange="this.form.submit();">
93        <option value="compact" {if $plugin_diplay=='compact'}selected="selected"{/if}>{'Compact'|@translate}</option>
94        <option value="complete" {if $plugin_display=='complete'}selected="selected"{/if}>{'Complete'|@translate}</option>
95      </select>
96      &nbsp;&nbsp;|&nbsp;&nbsp;
97      <a class="deactivate_all">{'Deactivate'|@translate} {'all'|@translate}</a>
98      {* &nbsp;&nbsp;|&nbsp;&nbsp;
99      <a class="activate_all">{'Activate'|@translate} {'all'|@translate}</a> *}
100    </form>
101  </span>
102  <h2>{'Plugins'|@translate}</h2>
103</div>
104
105{if isset($plugins)}
106
107{assign var='field_name' value='null'}
108{foreach from=$plugins item=plugin name=plugins_loop}
109   
110{if $plugin_order == 'state' AND $field_name != $plugin.STATE}
111  {if $field_name != 'null'}</fieldset>{/if}
112  <fieldset class="pluginBoxes pluginsByState">
113    <legend>
114    {if $plugin.STATE == 'active'}
115      {'Active Plugins'|@translate}
116    {elseif $plugin.STATE == 'inactive'}
117      {'Inactive Plugins'|@translate}
118    {elseif $plugin.STATE == 'missing'}
119      {'Missing Plugins'|@translate}
120    {elseif $plugin.STATE == 'merged'}
121      {'Obsolete Plugins'|@translate}
122    {/if}
123    </legend>
124  {assign var='field_name' value=$plugin.STATE}
125
126{elseif $field_name == 'null'}
127  <fieldset class="pluginBoxes pluginsByName">
128  {assign var='field_name' value='not_null'}
129
130{/if}
131
132  {if not empty($plugin.AUTHOR)}
133    {if not empty($plugin.AUTHOR_URL)}
134      {assign var='author' value="<a href='%s'>%s</a>"|@sprintf:$plugin.AUTHOR_URL:$plugin.AUTHOR}
135    {else}
136      {assign var='author' value='<u>'|cat:$plugin.AUTHOR|cat:'</u>'}
137    {/if}
138  {/if}
139   
140  {if $plugin_display == 'complete'}
141    <div id="{$plugin.ID}" class="pluginBox {$plugin.STATE}{if $plugin.INCOMPATIBLE} incompatible{/if}">
142      <table>
143        <tr>
144          <td class="pluginBoxNameCell">
145            {if $plugin.INCOMPATIBLE}<a class="warning" title="{'WARNING! This plugin does not seem to be compatible with this version of Piwigo.'|@translate|@escape:'html'}"></a>{/if}
146            {$plugin.NAME}
147          </td>
148          <td>{$plugin.DESC}</td>
149        </tr>
150        <tr>
151          <td>
152          {if $plugin.STATE == 'active'}
153            <a href="{$plugin.U_ACTION}&amp;action=deactivate">{'Deactivate'|@translate}</a>
154            | <a href="{$plugin.U_ACTION}&amp;action=restore" class="plugin-restore" title="{'Restore default configuration. You will lost your plugin settings!'|@translate}" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Restore'|@translate}</a>
155
156          {elseif $plugin.STATE == 'inactive'}
157            <a href="{$plugin.U_ACTION}&amp;action=activate" {if $plugin.INCOMPATIBLE}class="incompatible"{/if}>{'Activate'|@translate}</a>
158            | <a href="{$plugin.U_ACTION}&amp;action=delete" class="plugin-delete" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Delete'|@translate}</a>
159
160          {elseif $plugin.STATE == 'missing'}
161            <a href="{$plugin.U_ACTION}&amp;action=uninstall" class="plugin-delete" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Uninstall'|@translate}</a>
162
163          {elseif $plugin.STATE == 'merged'}
164            <a href="{$plugin.U_ACTION}&amp;action=delete" class="plugin-delete">{'Delete'|@translate}</a>
165          {/if}
166          </td>
167          <td>
168            {'Version'|@translate} {$plugin.VERSION}
169           
170          {if not empty($author)}
171            | {'By %s'|@translate|@sprintf:$author}
172          {/if}
173
174          {if not empty($plugin.VISIT_URL)}
175            | <a class="externalLink" href="{$plugin.VISIT_URL}">{'Visit plugin site'|@translate}</a>
176          {/if}
177          </td>
178        </tr>
179      </table>
180    </div> {*<!-- pluginBox -->*}
181   
182  {elseif $plugin_display == 'compact'}
183    {if not empty($plugin.VISIT_URL)}
184      {assign var='version' value="<a class='externalLink' href='"|cat:$plugin.VISIT_URL|cat:"'>"|cat:$plugin.VERSION|cat:"</a>"}
185    {else
186      {assign var='version' value=$plugin.VERSION}
187    {/if}
188         
189    <div id="{$plugin.ID}" class="pluginMiniBox {$plugin.STATE}{if $plugin.INCOMPATIBLE} incompatible{/if}">
190      <div class="pluginMiniBoxNameCell">
191        {if $plugin.INCOMPATIBLE}<span class="warning" title="{'WARNING! This plugin does not seem to be compatible with this version of Piwigo.'|@translate|@escape:'html'}"></span>{/if}
192        <span class="pluginMiniBoxDesc" title="{if !empty($author)}{'By %s'|@translate|@sprintf:$author} | {/if}{'Version'|@translate} {$version}<br/>{$plugin.DESC|@escape:'html'}">{$plugin.NAME}</span>
193      </div>
194      <div class="pluginActions">
195        <div>
196        {if $plugin.STATE == 'active'}
197          <a href="{$plugin.U_ACTION}&amp;action=deactivate">{'Deactivate'|@translate}</a>
198          | <a href="{$plugin.U_ACTION}&amp;action=restore" class="plugin-restore" title="{'Restore default configuration. You will lost all your settings !'|@translate}" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Restore'|@translate}</a>
199
200        {elseif $plugin.STATE == 'inactive'}
201          <a href="{$plugin.U_ACTION}&amp;action=activate" {if $plugin.INCOMPATIBLE}class="incompatible"{/if}>{'Activate'|@translate}</a>
202          | <a href="{$plugin.U_ACTION}&amp;action=delete"  class="plugin-delete"onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Delete'|@translate}</a>
203
204        {elseif $plugin.STATE == 'missing'}
205          <a href="{$plugin.U_ACTION}&amp;action=uninstall" class="plugin-delete" onclick="return confirm('{'Are you sure?'|@translate|@escape:'javascript'}');">{'Uninstall'|@translate}</a>
206
207        {elseif $plugin.STATE == 'merged'}
208          <a href="{$plugin.U_ACTION}&amp;action=delete" class="plugin-delete">{'Delete'|@translate}</a>
209        {/if}
210        </div>
211      </div>
212    </div> {*<!-- pluginMiniBox -->*}
213   
214  {/if}
215 
216{/foreach}
217  </fieldset>
218
219{/if}
Note: See TracBrowser for help on using the repository browser.