diff --git a/include/admin/maintenance.inc.php b/include/admin/maintenance.inc.php index 5e1cbd51..4a392063 100644 --- a/include/admin/maintenance.inc.php +++ b/include/admin/maintenance.inc.php @@ -1,14 +1,12 @@ [smarty clearCompiledTemplate()]'); -@define('MAINTAIN_CCT_FAIL', 'Error: %s not allowed / not available!'); -@define('MAINTAIN_CCT_TITLE', 'Clear compiled Template'); -@define('MAINTAIN_CCT_INFO', 'This will purge compiled files of this template only, but will leave the used runtime files by this current template file.'); -$data = array(); -if (!is_object($serendipity['smarty'])) { - serendipity_smarty_init(); -} +@define('MAINTAIN_TITLE', 'Maintenance'); +@define('MAINTAIN_CLEANCOMPILE_PASS', '[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.'); + +$data = array(); // do not move to end of switch, since this will change smarty assignment scope ob_start(); @@ -27,18 +25,20 @@ switch($serendipity['GET']['adminAction']) { $data['badsums'] = serendipity_verifyFTPChecksums(); break; - case 'cct': - // We clear all compiles smarty template files in templates_c, which leaves 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..!) - // We have to reduce this call() = all tpl files, to clear the blogs template only, 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... + case 'runcleanup': + // The smarty method clearCompiledTemplate() clears all compiled smarty template files in templates_c + // Since there may be other compiled template files in templates_c too, we have to restrict this call() to clear the blogs template only, + // 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['cct_finish'] = $finish; + $data['cleanup_template'] = $serendipity['template']; + $data['cleanup_finish'] = $finish; break; } diff --git a/lang/addlang.txt b/lang/addlang.txt index 5f193495..3ca5cde6 100644 --- a/lang/addlang.txt +++ b/lang/addlang.txt @@ -1,5 +1,5 @@ @define('MAINTAIN_TITLE', 'Maintenance'); -@define('MAINTAIN_CCT_PASS', '[smarty clearCompiledTemplate()]'); -@define('MAINTAIN_CCT_FAIL', 'Error: %s not allowed / not available!'); -@define('MAINTAIN_CCT_TITLE', 'Clear compiled Template'); -@define('MAINTAIN_CCT_INFO', 'This will purge compiled files of this template only, but will leave the used runtime files by this current template file.'); +@define('MAINTAIN_CLEANCOMPILE_PASS', '[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.'); diff --git a/templates/2k11/admin/maintenance.inc.tpl b/templates/2k11/admin/maintenance.inc.tpl index 18f1bcdf..a12b002f 100644 --- a/templates/2k11/admin/maintenance.inc.tpl +++ b/templates/2k11/admin/maintenance.inc.tpl @@ -20,11 +20,11 @@ {/if} -{if $cct_finish === true} - {$CONST.DONE}! {$CONST.MAINTAIN_CCT_PASS} +{if $cleanup_finish === true} + {$CONST.DONE}! {$CONST.MAINTAIN_CLEANCOMPILE_PASS} {/if} -{if $cct_finish === false} - {$CONST.MAINTAIN_CCT_FAIL|sprintf:$CONST.MAINTAIN_CCT_PASS} +{if $cleanup_finish === false} + {$CONST.MAINTAIN_CLEANCOMPILE_FAIL|sprintf:$CONST.MAINTAIN_CLEANCOMPILE_PASS} {/if} {if 'siteConfiguration'|checkPermission || 'blogConfiguration'|checkPermission} @@ -37,11 +37,11 @@ {if 'adminTemplates'|checkPermission}
-

{$CONST.MAINTAIN_CCT_TITLE}

+

{$CONST.MAINTAIN_CLEANCOMPILE_TITLE}

- {$CONST.MAINTAIN_CCT_TITLE} - - {$CONST.MAINTAIN_CCT_INFO} + {$CONST.MAINTAIN_CLEANCOMPILE_TITLE} + + {$CONST.MAINTAIN_CLEANCOMPILE_INFO}
{/if}