Changeset 526 in svn for trunk/admin/xcache.tpl.php


Ignore:
Timestamp:
2008-02-18T14:28:31+01:00 (7 years ago)
Author:
Xuefer
Message:

allow user decide to show used or free blocks/percent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/xcache.tpl.php

    r522 r526  
    3131        <th><?php echo _T('Size'); ?></th>
    3232        <th><?php echo _T('Avail'); ?></th>
    33         <th><?php echo _T('%'); ?></th>
     33        <th><?php echo _T(isset($free_graph_width) ? '% Free' : '% Used'); ?></th>
    3434        <th><?php echo _T('Clear'); ?></th>
    3535        <th><?php echo _T('Compiling'); ?></th>
     
    5454        echo "
    5555        <tr ", $a->next(), ">";
    56         $pavail = (int) ($ci['avail'] / $ci['size'] * 100);
    57         $pused = 100 - $pavail;
    58 
    59         $w = $free_graph_width;
     56        $pvalue = (int) ($ci['avail'] / $ci['size'] * 100);
     57        $pempty = 100 - $pvalue;
     58        if (!isset($free_graph_width)) {
     59            // swap
     60            $tmp = $pvalue;
     61            $pvalue = $pempty;
     62            $pempty = $tmp;
     63        }
     64
     65        $w = $graph_width;
    6066        $tdwidth = $w + 2;
    6167        if (empty($ci['istotal'])) {
    6268            $graph = freeblock_to_graph($ci['free_blocks'], $ci['size']);
    63             $freeblockgraph = "<div class=\"freeblockgraph\" style=\"width: {$w}px\">{$graph}</div>";
     69            $blocksgraph = "<div class=\"blocksgraph\" style=\"width: {$w}px\">{$graph}</div>";
    6470        }
    6571        else {
    66             $freeblockgraph = '';
     72            $blocksgraph = '';
    6773        }
    6874
     
    9096        <td title="{$ci['size']}">{$ci_size}</td>
    9197        <td title="{$ci['avail']}">{$ci_avail}</td>
    92         <td title="{$pavail} %" width="{$tdwidth}"
     98        <td title="{$pvalue} %" width="{$tdwidth}"
    9399            ><div class="percent" style="width: {$w}px"
    94                 ><div style="width: {$pavail}%" class="pavail"></div
    95                 ><div style="width: {$pused}%" class="pused"></div
     100                ><div style="width: {$pvalue}%" class="pvalue"></div
     101                ><div style="width: {$pempty}%" class="pempty"></div
    96102            ></div
    97         >{$freeblockgraph}</td>
     103        >{$blocksgraph}</td>
    98104        <td
    99105            ><form method="post"
Note: See TracChangeset for help on using the changeset viewer.