source: trunk/htdocs/cacher/sub/entrylist.tpl.php @ 1076

Last change on this file since 1076 was 1076, checked in by moo, 2 years ago

fix cycle color

  • Property svn:eol-style set to native
File size: 3.3 KB
Line 
1<?php $cycleClass = new Cycle('class="col1"', 'class="col2"'); ?>
2<form action="" method="post">
3    <table cellspacing="0" cellpadding="4" class="cycles entries">
4        <caption><?php echo _("{$cachelist['type_name']} $listName"); ?></caption>
5<?php
6
7echo <<<TR
8        <tr>
9
10TR;
11
12if ($isphp) {
13    echo
14        th("entry.id")
15        ;
16}
17else {
18    echo
19        th("entry.remove")
20        ;
21}
22
23echo
24    th(N_("entry.name"))
25    , th(N_("entry.hits"))
26    , th(N_("entry.size"))
27    ;
28
29if ($isphp) {
30    echo
31        th(N_("entry.refcount"))
32        , th(N_("entry.phprefcount"))
33        , th(N_("entry.class_cnt"))
34        , th(N_("entry.function_cnt"))
35        , th(N_("entry.file_size"))
36        , th(N_("entry.file_mtime"))
37        ;
38    if ($haveinode) {
39        echo
40            th(N_("entry.file_device"))
41            , th(N_("entry.file_inode"))
42            ;
43    }
44}
45echo
46    th(N_("entry.hash"))
47    , th(N_("entry.atime"))
48    , th(N_("entry.ctime"))
49    ;
50
51if ($listName == 'Deleted') {
52    echo
53        th(N_("entry.delete"))
54        ;
55}
56?>
57        </tr>
58<?php
59foreach ($entries as $i => $entry) {
60    $class = $cycleClass->next();
61    echo <<<TR
62        <tr $class>
63
64TR;
65    $name     = htmlspecialchars($entry['name']);
66    $hits     = number_format($entry['hits']);
67    $size     = size($entry['size']);
68    if ($isphp) {
69        $class_cnt    = number_format($entry['class_cnt']);
70        $function_cnt = number_format($entry['function_cnt']);
71        $phprefcount  = number_format($entry['phprefcount']);
72        $file_size    = size($entry['file_size']);
73    }
74
75    if ($isphp) {
76        $file_mtime = age($entry['file_mtime']);
77    }
78    $ctime = age($entry['ctime']);
79    $atime = age($entry['atime']);
80    if ($listName == 'Deleted') {
81        $dtime = age($entry['dtime']);
82    }
83
84    if ($isphp) {
85        $namelink = $name;
86        echo <<<ENTRY
87            <td>{$entry['cache_name']} {$i}</td>
88
89ENTRY;
90    }
91    else {
92        echo <<<ENTRY
93            <td><label><input type="checkbox" name="remove[]" value="{$name}"/>{$entry['cache_name']} {$i}</label></td>
94
95ENTRY;
96        $uname = urlencode($entry['name']);
97        $namelink = "<a href=\"edit.php?name=$uname\">$name</a>";
98    }
99
100    echo <<<ENTRY
101            <td>{$namelink}</td>
102            <td align="right" int="{$entry['hits']}">{$entry['hits']}</td>
103            <td align="right" int="{$entry['size']}">{$size}</td>
104
105ENTRY;
106    if ($isphp) {
107        $refcount = number_format($entry['refcount']);
108        echo <<<ENTRY
109            <td align="right" int="{$entry['refcount']}">{$entry['refcount']}</td>
110            <td align="right" int="{$entry['phprefcount']}">{$phprefcount}</td>
111            <td align="right" int="{$entry['class_cnt']}">{$class_cnt}</td>
112            <td align="right" int="{$entry['function_cnt']}">{$function_cnt}</td>
113            <td align="right" int="{$entry['file_size']}">{$file_size}</td>
114            <td align="right" int="{$entry['file_mtime']}">{$file_mtime}</td>
115
116ENTRY;
117        if (isset($entry['file_inode'])) {
118            echo <<<ENTRY
119            <td align="right" int="{$entry['file_device']}">{$entry['file_device']}</td>
120            <td align="right" int="{$entry['file_inode']}">{$entry['file_inode']}</td>
121
122ENTRY;
123        }
124    }
125    echo <<<ENTRY
126            <td align="right" int="{$entry['hvalue']}">{$entry['hvalue']}</td>
127            <td align="right" int="{$entry['atime']}">{$atime}</td>
128            <td align="right" int="{$entry['ctime']}">{$ctime}</td>
129
130ENTRY;
131    if ($listName == 'Deleted') {
132        echo <<<ENTRY
133            <td align="right" int="{$entry['dtime']}">{$dtime}</td>
134
135ENTRY;
136    }
137
138    echo <<<TR
139        </tr>
140
141TR;
142}
143?>
144    </table>
145<?php if (!$isphp && $listName == 'Deleted') { ?>
146    <input type="submit" value="<?php echo _("Remove Selected"); ?>">
147<?php } ?>
148</form>
149<?php
150unset($cycleClass);
151?>
Note: See TracBrowser for help on using the repository browser.