{combine_script id='jquery.ajaxmanager' load='footer' require='jquery' path='themes/default/js/plugins/jquery.ajaxmanager.js' } {footer_script require='jquery.ajaxmanager'} /* incompatible message */ var incompatible_msg = '{'WARNING! This plugin does not seem to be compatible with this version of Piwigo.'|@translate|@escape:'javascript'}'; var activate_msg = '\n{'Do you want to activate anyway?'|@translate|@escape:'javascript'}'; /* group action */ var pwg_token = '{$PWG_TOKEN}'; var confirmMsg = '{'Are you sure?'|@translate|@escape:'javascript'}'; {literal} var queuedManager = jQuery.manageAjax.create('queued', { queue: true, maxRequests: 1 }); var nb_plugins = jQuery('div.active').size(); var done = 0; jQuery(document).ready(function() { /* group action */ jQuery('div.deactivate_all a').click(function() { if (confirm(confirmMsg)) { jQuery('div.active').each(function() { performPluginDeactivate(jQuery(this).attr('id')); }); } }); function performPluginDeactivate(id) { queuedManager.add({ type: 'GET', dataType: 'json', url: 'ws.php', data: { method: 'pwg.plugins.performAction', action: 'deactivate', plugin: id, pwg_token: pwg_token, format: 'json' }, success: function(data) { if (data['stat'] == 'ok') jQuery("#"+id).removeClass('active').addClass('inactive'); done++; if (done == nb_plugins) location.reload(); } }); }; /* incompatible plugins */ jQuery(document).ready(function() { jQuery.ajax({ method: 'GET', url: 'admin.php', data: { page: 'plugins_installed', incompatible_plugins: true }, dataType: 'json', success: function(data) { for (i=0;i') {else} jQuery('#'+data[i]+' .pluginMiniBoxNameCell').prepend('') {/if} {literal} jQuery('#'+data[i]).addClass('incompatible'); jQuery('#'+data[i]+' .activate').attr('onClick', 'return confirm(incompatible_msg + activate_msg);'); } jQuery('.warning').tipTip({ 'delay' : 0, 'fadeIn' : 200, 'fadeOut' : 200, 'maxWidth':'250px' }); } }); }); /* TipTips */ jQuery('.plugin-restore').tipTip({ 'delay' : 0, 'fadeIn' : 200, 'fadeOut' : 200 }); jQuery('.showInfo').tipTip({ 'delay' : 0, 'fadeIn' : 200, 'fadeOut' : 200, 'maxWidth':'300px', 'keepAlive':true, 'activation':'click' }); }); {/literal} {/footer_script}

{'Plugins'|@translate}

{if $show_details} {'hide details'|@translate} {else} {'show details'|@translate} {/if}
{if isset($plugins)} {assign var='field_name' value='null'} {* *} {counter start=0 assign=i} {* *} {foreach from=$plugins item=plugin name=plugins_loop} {if $field_name != $plugin.STATE} {if $field_name != 'null'} {/if}
{if $plugin.STATE == 'active'} {'Active Plugins'|@translate} {elseif $plugin.STATE == 'inactive'} {'Inactive Plugins'|@translate} {elseif $plugin.STATE == 'missing'} {'Missing Plugins'|@translate} {elseif $plugin.STATE == 'merged'} {'Obsolete Plugins'|@translate} {/if} {assign var='field_name' value=$plugin.STATE} {/if} {if not empty($plugin.AUTHOR)} {if not empty($plugin.AUTHOR_URL)} {assign var='author' value="%s"|@sprintf:$plugin.AUTHOR_URL:$plugin.AUTHOR} {else} {assign var='author' value=''|cat:$plugin.AUTHOR|cat:''} {/if} {/if} {if $show_details}
{$plugin.NAME} {$plugin.DESC}
{if $plugin.STATE == 'active'} {'Deactivate'|@translate} | {'Restore'|@translate} {elseif $plugin.STATE == 'inactive'} {'Activate'|@translate} | {'Delete'|@translate} {elseif $plugin.STATE == 'missing'} {'Uninstall'|@translate} {elseif $plugin.STATE == 'merged'} {'Delete'|@translate} {/if} {'Version'|@translate} {$plugin.VERSION} {if not empty($author)} | {'By %s'|@translate|@sprintf:$author} {/if} {if not empty($plugin.VISIT_URL)} | {'Visit plugin site'|@translate} {/if}
{**} {else} {if not empty($plugin.VISIT_URL)} {assign var='version' value=""|cat:$plugin.VERSION|cat:""} {else} {assign var='version' value=$plugin.VERSION} {/if}
{$plugin.NAME} i
{if $plugin.STATE == 'active'} {'Deactivate'|@translate} | {'Restore'|@translate} {elseif $plugin.STATE == 'inactive'} {'Activate'|@translate} | {'Delete'|@translate} {elseif $plugin.STATE == 'missing'} {'Uninstall'|@translate} {elseif $plugin.STATE == 'merged'} {'Delete'|@translate} {/if}
{**} {/if} {if $plugin.STATE == 'active'} {counter} {if $active_plugins == $i} {counter} {/if} {/if} {/foreach}
{/if}