source: trunk/htdocs/cacher/cacher.entrylist.tpl.php @ 1072

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

htdocs/cacher: split template to sub files

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