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