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

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

closes #287: namespace support

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