{combine_script id='common' load='footer' path='admin/themes/default/js/common.js'} {combine_script id='jquery.confirm' load='footer' require='jquery' path='themes/default/js/plugins/jquery-confirm.min.js'} {combine_css path="themes/default/js/plugins/jquery-confirm.min.css"} {combine_css path="admin/themes/default/fontello/css/animation.css" order=10} {* order 10 is required, see issue 1080 *} {footer_script} const confirm_msg = '{"Yes, I am sure"|@translate}'; const cancel_msg = "{"No, I have changed my mind"|@translate}"; const no_time_elapsed = "{"right now"|@translate}"; const unit_MB = "{"%s MB"|@translate}" let selected = []; $(".lock-gallery-button").each(function() { const gallery_tip = '{"A locked gallery is only visible to administrators"|@translate|@escape:'javascript'}'; {if (isset($U_MAINT_LOCK_GALLERY))} let title = '{"Are you sure you want to lock the gallery?"|@translate}'; {else} let title = '{"Are you sure you want to unlock the gallery?"|@translate}'; {/if} let confirm_msg_gallery = '{"Yes, I want to lock the gallery"|@translate}'; let cancel_msg_gallery = '{"Keep it unlocked"|@translate}'; $(this).pwg_jconfirm_follow_href({ alert_title: title, alert_confirm: confirm_msg, alert_cancel: cancel_msg, alert_content: gallery_tip }); }); $(".purge-history-detail-button").each(function() { const title = '{"Purge history detail"|@translate|@escape:'javascript'}'; $(this).pwg_jconfirm_follow_href({ alert_title: title, alert_confirm: confirm_msg, alert_cancel: cancel_msg }); }); $(".purge-history-summary-button").each(function() { const title = '{"Purge history summary"|@translate|@escape:'javascript'}'; $(this).pwg_jconfirm_follow_href({ alert_title: title, alert_confirm: confirm_msg, alert_cancel: cancel_msg }); }); $(".purge-search-history-button").each(function() { const title = '{"Purge search history"|@translate|@escape:'javascript'}'; $(this).pwg_jconfirm_follow_href({ alert_title: title, alert_confirm: confirm_msg, alert_cancel: cancel_msg }); }); $(".delete-all-sizes-button").each(function() { const title = '{"Are you sure you want to delete all sizes?"|@translate|@escape:'javascript'}'; $(this).pwg_jconfirm_follow_href({ alert_title: title, alert_confirm: confirm_msg, alert_cancel: cancel_msg }); }); $(".delete-size-check").click(function () { if ($(this).attr('data-selected') == '1') { $(this).attr('data-selected', '0'); $(this).find("i").hide(); } else { $(this).attr('data-selected', '1'); $(this).find("i").show(); } $(this).trigger("change"); }); $(".delete-size-check:first").change(function() { if ($(this).attr('data-selected') == '1') { $(".delete-size-check").hide(); $(".delete-size-check").attr("data-selected", "1"); $(this).show(); } else { $(".delete-size-check").show(); $(".delete-size-check").attr("data-selected", "0"); } }) const delete_deriv_URL = "admin.php?page=maintenance&action=derivatives&"; $(".delete-size-check").change(function() { let delete_deriv_with_token = delete_deriv_URL + "pwg_token=" + "{$pwg_token}&"; let types_str = ''; let selected = [] $(".delete-size-check").each(function () { if ($(this).attr("data-selected") == '1') { selected.push($(this).attr("name")); } }) if (selected.length == 0) { $(".delete-sizes").attr("href", ""); } else { if (selected[0] == "all") { types_str = "all"; } else { types_str = selected.join("_"); } console.log(selected); $(".delete-sizes").attr("href", delete_deriv_with_token + "type=" + types_str); } }) $(".delete-sizes").hide(); $(".delete-size-check").click( function () { let displayDeleteSizes = false; $(".delete-size-check").each(function() { if ($(this).attr("data-selected") == 1) { displayDeleteSizes = true; } }); (displayDeleteSizes ? $(".delete-sizes").show() : $(".delete-sizes").hide()) }) {/footer_script} {combine_script id='ajax' load='footer' path='admin/themes/default/js/maintenance.js'} {if $isWebmaster == 1}
{'Global Gallery Actions'|translate}
{if (isset($U_MAINT_LOCK_GALLERY))} {$maint_actions['lock_gallery']['label']} {else} {$maint_actions['unlock_gallery']['label']} {/if} {$maint_actions['categories']['label']} {$maint_actions['images']['label']} {$maint_actions['database']['label']} {$maint_actions['c13y']['label']}
{'Purge Actions'|@translate}
{$maint_actions['user_cache']['label']} {$maint_actions['delete_orphan_tags']['label']} {$maint_actions['history_detail']['label']} {$maint_actions['history_summary']['label']} {$maint_actions['sessions']['label']} {$maint_actions['feeds']['label']} {$maint_actions['search']['label']}
{if isset($advanced_features) and !(count($advanced_features) < 1)}
{'Advanced features'|@translate}
{foreach from=$advanced_features item=feature key=key name=name} {$feature.CAPTION} {/foreach}
{/if}
{'Purge Cache'|@translate}
{'Cache size'|@translate} {if isset($cache_sizes)} {"%s MB"|@translate:{round($cache_sizes[0]['value']/1024/1024, 2)}} {else} {'N/A'|translate} {/if} {if $time_elapsed_since_last_calc}  {'calculated'|@translate}{/if} {if $time_elapsed_since_last_calc} {$time_elapsed_since_last_calc} {else}   {"never calculated"|@translate} {/if} {'Refresh'|@translate}
{$maint_actions['compiled-templates']['label']} {if isset($cache_sizes)} {"%s MB"|@translate:{round($cache_sizes[2]['value']/1024/1024, 2)}} {else} {'N/A'|translate} {/if}
{$maint_actions['derivatives']['label']} {if isset($cache_sizes)} {"%s MB"|@translate:{round($cache_sizes[1]['value']['all']/1024/1024, 2)}} {else} {'N/A'|translate} {/if}
{foreach from=$purge_derivatives key=name item=url name=loop}
{$name}
{/foreach}
{'Delete these sizes'|@translate}
{/if}