Ignore:
Timestamp:
2012-07-27T18:37:37+02:00 (21 months ago)
Author:
moo
Message:

adds xcache_enable_cache api. re-implements disable on crash

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/htdocs/cacher/cacher.tpl.php

    r1063 r1064  
    5555    $numkeys = explode(',', 'slots,size,avail,hits,updates,skips,ooms,errors,cached,deleted'); 
    5656    $l_clear = _('Clear'); 
     57    $l_disabled = _('Disabled'); 
     58    $l_disable = _('Disable'); 
     59    $l_enable = _('Enable'); 
     60    $l_compiling = _('Compiling'); 
     61    $l_normal = _('Normal'); 
    5762    $l_clear_confirm = _('Sure to clear?'); 
    5863    foreach ($cacheinfos as $i => $ci) { 
     
    9297        } 
    9398        else { 
    94             if ($ci['type'] == $type_php) { 
    95             $ci['status'] = $ci['compiling'] ? sprintf(_('Compiling(%s)'), age($ci['compiling'])) : _('Normal'); 
     99            if ($ci['disabled']) { 
     100                $ci['status'] = $l_disabled 
     101                    . sprintf("(%s)", age($ci['disabled'])); 
     102            } 
     103            else if ($ci['type'] == $type_php) { 
     104                $ci['status'] = $ci['compiling'] 
     105                    ? $l_compiling . sprintf("(%s)", age($ci['compiling'])) 
     106                    : $l_normal; 
    96107            } 
    97108            else { 
     
    100111            $ci['can_readonly'] = $ci['can_readonly'] ? 'yes' : 'no'; 
    101112        } 
     113        $enabledisable = $ci['disabled'] ? 'enable' : 'disable'; 
     114        $l_enabledisable = $ci['disabled'] ? $l_enable : $l_disable; 
    102115        echo <<<EOS 
    103116        <th>{$ci['cache_name']}</th> 
     
    117130                    /><input type="hidden" name="cacheid" value="{$ci['cacheid']}" 
    118131                    /><input type="submit" name="clearcache" value="{$l_clear}" class="submit" onclick="return confirm('{$l_clear_confirm}');" 
     132                    /><input type="submit" name="{$enabledisable}" value="{$l_enabledisable}" class="submit" 
    119133                /></div 
    120134            ></form 
Note: See TracChangeset for help on using the changeset viewer.