add clearComiledTemplate to maintenance
define constants temporary in maintenance.inc.php, until someone executes addlang.sh YL, I captured 'comment_status' class for #cct_info.
This commit is contained in:
parent
e6456b022f
commit
153b5b71ba
@ -1,7 +1,21 @@
|
||||
<?php
|
||||
|
||||
@define('MAINTAIN_TITLE', 'Maintenance');
|
||||
@define('MAINTAIN_CCT_PASS', '<span class="perm_name">[smarty clearCompiledTemplate()]</span>');
|
||||
@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();
|
||||
}
|
||||
|
||||
// do not move to end of switch, since this will change smarty assignment scope
|
||||
ob_start();
|
||||
include S9Y_INCLUDE_PATH . 'include/admin/import.inc.php';
|
||||
$data['importMenu'] = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
switch($serendipity['GET']['adminAction']) {
|
||||
case 'integrity':
|
||||
$data['action'] = "integrity";
|
||||
@ -12,15 +26,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...
|
||||
$finish = null;
|
||||
if(method_exists($serendipity['smarty'], 'clearCompiledTemplate')) {
|
||||
if( $serendipity['smarty']->clearCompiledTemplate(null, $serendipity['template']) ) {
|
||||
$finish = true;
|
||||
} else { $finish = false; }
|
||||
}
|
||||
|
||||
ob_start();
|
||||
include S9Y_INCLUDE_PATH . 'include/admin/import.inc.php';
|
||||
$data['importMenu'] = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
if (!is_object($serendipity['smarty'])) {
|
||||
serendipity_smarty_init();
|
||||
$data['cct_finish'] = $finish;
|
||||
break;
|
||||
}
|
||||
|
||||
echo serendipity_smarty_show('admin/maintenance.inc.tpl', $data);
|
||||
|
@ -1,5 +1,5 @@
|
||||
<div id="maintenance" class="clearfix">
|
||||
<h2>Maintenance</h2> {* i18n *}
|
||||
<h2>{$CONST.MAINTAIN_TITLE}</h2>
|
||||
|
||||
{if $action == "integrity"}
|
||||
<div class="clearfix">
|
||||
@ -20,14 +20,33 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if $cct_finish === true}
|
||||
<span class="msg_success"><span class="icon-ok-circled"></span>{$CONST.DONE}! {$CONST.MAINTAIN_CCT_PASS}</span>
|
||||
{/if}
|
||||
{if $cct_finish === false}
|
||||
<span class="msg_error"><span class="icon-attention-circled"></span>{$CONST.MAINTAIN_CCT_FAIL|sprintf:$CONST.MAINTAIN_CCT_PASS}</span>
|
||||
{/if}
|
||||
|
||||
{if 'siteConfiguration'|checkPermission || 'blogConfiguration'|checkPermission}
|
||||
<section id="maintenance_integrity" class="equal_heights quick_list">
|
||||
<h3>{$CONST.INTEGRITY}</h3>
|
||||
|
||||
<a class="button_link" href="?serendipity[action]=admin&serendipity[adminModule]=maintenance&serendipity[adminAction]=integrity" title="{$CONST.INTEGRITY}"><span>{$CONST.INTEGRITY}</span></a> {* i18n *}
|
||||
<a class="button_link" href="?serendipity[action]=admin&serendipity[adminModule]=maintenance&serendipity[adminAction]=integrity" title="{$CONST.INTEGRITY}"><span>{$CONST.INTEGRITY}</span></a>
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
{if 'adminTemplates'|checkPermission}
|
||||
<section id="maintenance_cleanup" class="equal_heights quick_list">
|
||||
<h3>{$CONST.MAINTAIN_CCT_TITLE}</h3>
|
||||
|
||||
<a class="button_link" href="?serendipity[action]=admin&serendipity[adminModule]=maintenance&serendipity[adminAction]=cct" title="{$CONST.MAINTAIN_CCT_TITLE}"><span>{$CONST.MAINTAIN_CCT_TITLE}</span></a>
|
||||
<button class="toggle_info button_link" type="button" data-href="#cct_info"><span class="icon-info-circled"></span><span class="visuallyhidden"> More</span></button>
|
||||
<span id="cct_info" class="comment_status additional_info">{$CONST.MAINTAIN_CCT_INFO}</span>
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
{serendipity_hookPlugin hook="backend_maintenance" hookAll="true"}
|
||||
|
||||
{if 'adminImport'|checkPermission}
|
||||
<section id="maintenance_export" class="equal_heights quick_list">
|
||||
<h3>{$CONST.EXPORT_ENTRIES}</h3>
|
||||
@ -76,5 +95,6 @@
|
||||
</form>
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
<script src="{serendipity_getFile file='admin/js/jquery.syncheight.js'}"></script>
|
Loading…
x
Reference in New Issue
Block a user