diff --git a/include/admin/maintenance.inc.php b/include/admin/maintenance.inc.php index 4a392063..b81d5e78 100644 --- a/include/admin/maintenance.inc.php +++ b/include/admin/maintenance.inc.php @@ -1,10 +1,10 @@ [smarty clearCompiledTemplate(%s)]'); -@define('MAINTAIN_CLEANCOMPILE_FAIL', 'Error: %s not allowed / not available!'); -@define('MAINTAIN_CLEANCOMPILE_TITLE', 'Clear compiled Template'); -@define('MAINTAIN_CLEANCOMPILE_INFO', 'This will purge compiled files of this template only, but will leave the used runtime files by this current template file.'); +@define('MENU_MAINTENANCE', 'Maintenance'); +@define('MENU_MAINTENANCE_CLEANCOMPILE_PASS', '[smarty clearCompiledTemplate(%s)]'); +@define('MENU_MAINTENANCE_CLEANCOMPILE_FAIL', 'No clearance or compiled template files available!'); +@define('MENU_MAINTENANCE_CLEANCOMPILE_TITLE', 'Clear compiled Template'); +@define('MENU_MAINTENANCE_CLEANCOMPILE_INFO', 'This will purge compiled files of this template only, but will leave the used runtime files by this current template file.'); $data = array(); @@ -31,14 +31,10 @@ switch($serendipity['GET']['adminAction']) { // to not have the following automated recompile, force the servers memory to get exhausted, // when using plugins like serendipity_event_gravatar plugin, which can eat up some MB... // Restriction to template means: leave the page we are on: ../admin/index.tpl and all others, which are set, included and compiled by runtime. (plugins, etc. this can be quite some..!) - $finish = null; if(method_exists($serendipity['smarty'], 'clearCompiledTemplate')) { - if( $serendipity['smarty']->clearCompiledTemplate(null, $serendipity['template']) ) { - $finish = true; - } else { $finish = false; } + $data['cleanup_finish'] = (int)$serendipity['smarty']->clearCompiledTemplate(null, $serendipity['template']); + $data['cleanup_template'] = $serendipity['template']; } - $data['cleanup_template'] = $serendipity['template']; - $data['cleanup_finish'] = $finish; break; } diff --git a/templates/2k11/admin/maintenance.inc.tpl b/templates/2k11/admin/maintenance.inc.tpl index dbbf6760..6fa18af1 100644 --- a/templates/2k11/admin/maintenance.inc.tpl +++ b/templates/2k11/admin/maintenance.inc.tpl @@ -20,11 +20,11 @@ {/if} -{if $cleanup_finish === true} - {$CONST.DONE}! {$CONST.MAINTAIN_CLEANCOMPILE_PASS|sprintf:$cleanup_template} +{if $cleanup_finish > 0} + {$CONST.DONE}! {$CONST.MENU_MAINTENANCE_CLEANCOMPILE_PASS|sprintf:$cleanup_template} {/if} -{if $cleanup_finish === false} - {$CONST.MAINTAIN_CLEANCOMPILE_FAIL|sprintf:($CONST.MAINTAIN_CLEANCOMPILE_PASS|sprintf:$cleanup_template)} +{if $cleanup_finish === 0} + {$CONST.MENU_MAINTENANCE_CLEANCOMPILE_FAIL} {/if} {if 'siteConfiguration'|checkPermission || 'blogConfiguration'|checkPermission} @@ -37,11 +37,11 @@ {if 'adminTemplates'|checkPermission}
-

{$CONST.MAINTAIN_CLEANCOMPILE_TITLE}

+

{$CONST.MENU_MAINTENANCE_CLEANCOMPILE_TITLE}

- {$CONST.MAINTAIN_CLEANCOMPILE_TITLE} + {$CONST.MENU_MAINTENANCE_CLEANCOMPILE_TITLE} - {$CONST.MAINTAIN_CLEANCOMPILE_INFO} + {$CONST.MENU_MAINTENANCE_CLEANCOMPILE_INFO}
{/if}