author | Dan |
Fri, 21 Aug 2009 15:39:23 -0400 | |
changeset 1096 | 86feb1c7ca3f |
parent 1081 | 745200a9cc2a |
child 1227 | bdac73ed481e |
permissions | -rw-r--r-- |
605
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
1 |
<?php |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
2 |
|
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
3 |
/* |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
4 |
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between |
1081
745200a9cc2a
Fixed some upgrade bugs; added support for choosing one's own date/time formats; rebrand as 1.1.7
Dan
parents:
953
diff
changeset
|
5 |
* Copyright (C) 2006-2009 Dan Fuhry |
605
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
6 |
* |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
7 |
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
8 |
* as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
9 |
* |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
10 |
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
11 |
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
12 |
*/ |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
13 |
|
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
14 |
// Cache manager - regenerate and clear various cached values |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
15 |
|
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
16 |
function page_Admin_CacheManager() |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
17 |
{ |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
18 |
global $db, $session, $paths, $template, $plugins; // Common objects |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
19 |
global $lang; |
613 | 20 |
global $cache; |
605
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
21 |
if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
22 |
{ |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
23 |
$login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
24 |
echo '<h3>' . $lang->get('adm_err_not_auth_title') . '</h3>'; |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
25 |
echo '<p>' . $lang->get('adm_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>'; |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
26 |
return; |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
27 |
} |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
28 |
|
613 | 29 |
// validation/actions |
30 |
if ( isset($_POST['refresh']) || isset($_POST['clear']) ) |
|
31 |
{ |
|
32 |
$success = false; |
|
33 |
||
34 |
$target = ( isset($_POST['refresh']) ) ? $_POST['refresh'] : $_POST['clear']; |
|
35 |
$do_refresh = isset($_POST['refresh']); |
|
36 |
switch ( $target ) |
|
37 |
{ |
|
38 |
case 'page': |
|
39 |
$success = $cache->purge('page_meta'); |
|
40 |
if ( $do_refresh && $success ) |
|
41 |
$success = $paths->update_metadata_cache(); |
|
42 |
break; |
|
43 |
case 'ranks': |
|
44 |
$success = $cache->purge('ranks'); |
|
45 |
if ( $do_refresh && $success ) |
|
46 |
$success = generate_cache_userranks(); |
|
47 |
break; |
|
48 |
case 'sidebar': |
|
49 |
$success = $cache->purge('anon_sidebar'); |
|
50 |
break; |
|
51 |
case 'plugins': |
|
52 |
$success = $cache->purge('plugins'); |
|
53 |
if ( $do_refresh && $success ) |
|
54 |
$success = $plugins->generate_plugins_cache(); |
|
55 |
break; |
|
56 |
case 'template': |
|
57 |
if ( $dh = opendir(ENANO_ROOT . '/cache') ) |
|
58 |
{ |
|
59 |
while ( $file = @readdir($dh) ) |
|
60 |
{ |
|
61 |
$fullpath = ENANO_ROOT . "/cache/$file"; |
|
62 |
// we don't want to mess with directories |
|
63 |
if ( !is_file($fullpath) ) |
|
64 |
continue; |
|
65 |
||
66 |
if ( preg_match('/\.(?:tpl|css)\.php$/', $file) ) |
|
67 |
{ |
|
68 |
unlink($fullpath); |
|
69 |
} |
|
70 |
} |
|
71 |
$success = true; |
|
72 |
} |
|
73 |
break; |
|
74 |
case 'aes': |
|
75 |
$success = @unlink(ENANO_ROOT . '/cache/aes_decrypt.php'); |
|
76 |
break; |
|
77 |
case 'lang': |
|
78 |
if ( $dh = opendir(ENANO_ROOT . '/cache') ) |
|
79 |
{ |
|
80 |
while ( $file = @readdir($dh) ) |
|
81 |
{ |
|
82 |
$fullpath = ENANO_ROOT . "/cache/$file"; |
|
83 |
// we don't want to mess with directories |
|
84 |
if ( !is_file($fullpath) ) |
|
85 |
continue; |
|
86 |
||
87 |
if ( preg_match('/^lang_json_(?:[a-f0-9]+?)\.php$/', $file) || preg_match('/^(?:cache_)?lang_(?:[0-9]+?)\.php$/', $file) ) |
|
88 |
unlink($fullpath); |
|
89 |
} |
|
90 |
$success = true; |
|
91 |
} |
|
92 |
if ( $do_refresh && $success ) |
|
93 |
{ |
|
94 |
// for each language in the database, call regen_caches() |
|
95 |
$q = $db->sql_query('SELECT lang_id FROM ' . table_prefix . 'language;'); |
|
96 |
if ( !$q ) |
|
97 |
$db->_die(); |
|
98 |
while ( $row = $db->fetchrow($q) ) |
|
99 |
{ |
|
100 |
$lang_local = ( $row['lang_id'] == $lang->lang_id ) ? $lang : new Language($row['lang_id']); |
|
101 |
$success = $lang_local->regen_caches(); |
|
102 |
if ( !$success ) |
|
103 |
break 2; |
|
104 |
} |
|
105 |
} |
|
106 |
break; |
|
107 |
case 'js': |
|
108 |
if ( $dh = opendir(ENANO_ROOT . '/cache') ) |
|
109 |
{ |
|
110 |
while ( $file = @readdir($dh) ) |
|
111 |
{ |
|
112 |
$fullpath = ENANO_ROOT . "/cache/$file"; |
|
113 |
// we don't want to mess with directories |
|
114 |
if ( !is_file($fullpath) ) |
|
115 |
continue; |
|
116 |
||
117 |
// compressed javascript |
|
118 |
if ( preg_match('/^jsres_(?:[A-z0-9_-]+)\.js\.json$/', $file) ) |
|
119 |
unlink($fullpath); |
|
120 |
// tinymce stuff |
|
121 |
else if ( preg_match('/^tiny_mce_(?:[a-f0-9]+)\.gz$/', $file) ) |
|
122 |
unlink($fullpath); |
|
123 |
} |
|
124 |
$success = true; |
|
125 |
} |
|
126 |
break; |
|
127 |
case 'thumbs': |
|
128 |
if ( $dh = opendir(ENANO_ROOT . '/cache') ) |
|
129 |
{ |
|
130 |
while ( $file = @readdir($dh) ) |
|
131 |
{ |
|
132 |
$fullpath = ENANO_ROOT . "/cache/$file"; |
|
133 |
// we don't want to mess with directories |
|
134 |
if ( !is_file($fullpath) ) |
|
135 |
continue; |
|
136 |
||
137 |
if ( preg_match('/^(?:[a-z0-9\._,-]+)-(?:[0-9]{10})-[0-9]+x[0-9]+\.([a-z0-9_-]+)$/i', $file) ) |
|
138 |
unlink($fullpath); |
|
139 |
} |
|
140 |
$success = true; |
|
141 |
} |
|
142 |
break; |
|
953
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
801
diff
changeset
|
143 |
case 'wikieditnotice': |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
801
diff
changeset
|
144 |
$cache->purge('wiki_edit_notice'); |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
801
diff
changeset
|
145 |
if ( $do_refresh ) |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
801
diff
changeset
|
146 |
$template->get_wiki_edit_notice(); |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
801
diff
changeset
|
147 |
|
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
801
diff
changeset
|
148 |
$success = true; |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
801
diff
changeset
|
149 |
break; |
613 | 150 |
case 'all': |
151 |
$success = purge_all_caches(); |
|
152 |
if ( $do_refresh ) |
|
153 |
{ |
|
154 |
// |
|
155 |
// refresh all static (non-incremental) caches |
|
156 |
// |
|
157 |
||
158 |
// pages |
|
159 |
$success = $paths->update_metadata_cache(); |
|
160 |
if ( !$success ) |
|
161 |
break; |
|
162 |
||
163 |
// user ranks |
|
164 |
$success = generate_cache_userranks(); |
|
165 |
if ( !$success ) |
|
166 |
break; |
|
167 |
||
168 |
// plugins |
|
169 |
$success = $plugins->generate_plugins_cache(); |
|
170 |
if ( !$success ) |
|
171 |
break; |
|
172 |
||
953
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
801
diff
changeset
|
173 |
// wiki edit notice |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
801
diff
changeset
|
174 |
$template->get_wiki_edit_notice(); |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
801
diff
changeset
|
175 |
|
613 | 176 |
// languages |
177 |
$q = $db->sql_query('SELECT lang_id FROM ' . table_prefix . 'language;'); |
|
178 |
if ( !$q ) |
|
179 |
$db->_die(); |
|
180 |
while ( $row = $db->fetchrow($q) ) |
|
181 |
{ |
|
182 |
$lang_local = ( $row['lang_id'] == $lang->lang_id ) ? $lang : new Language($row['lang_id']); |
|
183 |
$success = $lang_local->regen_caches(); |
|
184 |
if ( !$success ) |
|
185 |
break 2; |
|
186 |
} |
|
187 |
} |
|
188 |
break; |
|
189 |
default: |
|
190 |
$code = $plugins->setHook('acp_cache_manager_action'); |
|
191 |
foreach ( $code as $cmd ) |
|
192 |
{ |
|
193 |
eval($cmd); |
|
194 |
} |
|
195 |
break; |
|
196 |
} |
|
197 |
if ( $success ) |
|
198 |
{ |
|
199 |
echo '<div class="info-box">' . $lang->get('acpcm_msg_action_success') . '</div>'; |
|
200 |
} |
|
201 |
else |
|
202 |
{ |
|
203 |
echo '<div class="error-box">' . $lang->get('acpcm_err_action_failed') . '</div>'; |
|
204 |
} |
|
205 |
} |
|
206 |
else if ( isset($_POST['save']) ) |
|
207 |
{ |
|
208 |
$config_value = ( isset($_POST['cache_thumbs']) ) ? '1' : '0'; |
|
209 |
setConfig('cache_thumbs', $config_value); |
|
210 |
echo '<div class="info-box">' . $lang->get('acpcm_msg_action_success') . '</div>'; |
|
211 |
} |
|
212 |
||
605
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
213 |
echo '<h3><img alt=" " src="' . scriptPath . '/images/icons/applets/cachemanager.png" /> ' . $lang->get('acpcm_heading_main') . '</h3>'; |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
214 |
echo '<p>' . $lang->get('acpcm_intro') . '</p>'; |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
215 |
|
613 | 216 |
echo '<div class="warning-box">' . $lang->get('acpcm_msg_refresh_warning') . '</div>'; |
217 |
||
605
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
218 |
acp_start_form(); |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
219 |
?> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
220 |
<div class="tblholder"> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
221 |
<table border="0" cellspacing="1" cellpadding="4"> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
222 |
<!-- HEADER --> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
223 |
<tr> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
224 |
<th colspan="2"> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
225 |
<?php echo $lang->get('acpcm_table_header'); ?> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
226 |
</th> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
227 |
</tr> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
228 |
|
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
229 |
<!-- ENABLE CACHE --> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
230 |
<tr> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
231 |
<td class="row1" colspan="2"> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
232 |
<label> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
233 |
<input type="checkbox" name="cache_thumbs"<?php if ( getConfig('cache_thumbs') == '1' ) echo ' checked="checked"'; ?> /> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
234 |
<?php echo $lang->get('acpcm_lbl_enable_cache'); ?> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
235 |
</label> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
236 |
<br /> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
237 |
<small> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
238 |
<?php echo $lang->get('acpcm_hint_enable_cache'); ?> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
239 |
</small> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
240 |
</td> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
241 |
</tr> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
242 |
|
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
243 |
<!-- CLEAR ALL --> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
244 |
<tr> |
613 | 245 |
<td class="row2" style="width: 120px; text-align: center;"> |
246 |
<button name="clear" value="all"><?php echo $lang->get('acpcm_btn_clear_all'); ?></button> |
|
605
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
247 |
</td> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
248 |
<td class="row2"> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
249 |
<?php echo $lang->get('acpcm_hint_clear_all'); ?> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
250 |
</td> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
251 |
</tr> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
252 |
|
613 | 253 |
<?php |
254 |
// if caching is disabled, might as well break off here |
|
255 |
if ( getConfig('cache_thumbs') == '1' ): |
|
256 |
?> |
|
257 |
||
605
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
258 |
<!-- REFRESH ALL --> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
259 |
<tr> |
613 | 260 |
<td class="row1" style="text-align: center;"> |
261 |
<button name="refresh" value="all"><?php echo $lang->get('acpcm_btn_refresh_all'); ?></button> |
|
605
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
262 |
</td> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
263 |
<td class="row1"> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
264 |
<?php echo $lang->get('acpcm_hint_refresh_all'); ?> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
265 |
</td> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
266 |
</tr> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
267 |
|
613 | 268 |
<!-- INDIVIDUAL CACHES --> |
269 |
<tr> |
|
270 |
<th class="subhead" colspan="2"> |
|
271 |
<?php echo $lang->get('acpcm_th_individual_caches'); ?> |
|
272 |
</th> |
|
273 |
</tr> |
|
274 |
||
275 |
<?php |
|
276 |
$class = 'row2'; |
|
953
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
801
diff
changeset
|
277 |
$cache_list = array('page', 'ranks', 'sidebar', 'plugins', 'template', 'aes', 'lang', 'js', 'thumbs', 'wikieditnotice'); |
613 | 278 |
$code = $plugins->setHook('acp_cache_manager_list_caches'); |
279 |
foreach ( $code as $cmd ) |
|
280 |
{ |
|
281 |
eval($cmd); |
|
282 |
} |
|
283 |
foreach ( $cache_list as $target ) |
|
284 |
{ |
|
285 |
$class = ( $class == 'row1' ) ? 'row2' : 'row1'; |
|
286 |
?><tr> |
|
287 |
<td class="<?php echo $class; ?>" style="text-align: center;"> |
|
288 |
<button name="refresh" value="<?php echo $target; ?>"<?php if ( in_array($target, array('template', 'sidebar', 'aes', 'js', 'thumbs')) ) echo ' disabled="disabled"'; ?>> |
|
289 |
<?php echo $lang->get('acpcm_btn_refresh'); ?> |
|
290 |
</button> |
|
291 |
<button name="clear" value="<?php echo $target; ?>"> |
|
292 |
<?php echo $lang->get('acpcm_btn_clear'); ?> |
|
293 |
</button> |
|
294 |
</td> |
|
295 |
<td class="<?php echo $class; ?>"> |
|
296 |
<b><?php echo $lang->get("acpcm_cache_{$target}_desc_title"); ?></b> – |
|
297 |
<?php echo $lang->get("acpcm_cache_{$target}_desc_body"); ?> |
|
298 |
</td> |
|
299 |
</tr> |
|
300 |
<?php |
|
301 |
} |
|
302 |
||
303 |
// getConfig('cache_thumbs') == '1' |
|
304 |
endif; |
|
305 |
?> |
|
306 |
||
605
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
307 |
<!-- SAVE CHANGES --> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
308 |
<tr> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
309 |
<th colspan="2" class="subhead"> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
310 |
<input type="submit" name="save" value="<?php echo $lang->get('etc_save_changes'); ?>" style="font-weight: bold;" /> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
311 |
<input type="submit" name="cancel" value="<?php echo $lang->get('etc_cancel'); ?>" /> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
312 |
</th> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
313 |
</tr> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
314 |
</table> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
315 |
</div> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
316 |
<?php |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
317 |
echo '</form>'; |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
318 |
} |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
319 |
|
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
320 |
?> |