author | Dan |
Mon, 13 Jul 2009 08:00:36 -0400 | |
changeset 1056 | f21d6e75b469 |
parent 953 | 323c4cd1aa37 |
child 1081 | 745200a9cc2a |
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 |
801
eb8b23f11744
Two big commits in one day I know, but redid password storage to use HMAC-SHA1. Consolidated much AES processing to three core methods in session that should handle everything automagically. Installation works; upgrades should. Rebranded as 1.1.6.
Dan
parents:
685
diff
changeset
|
5 |
* Version 1.1.6 (Caoineag beta 1) |
605
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
6 |
* Copyright (C) 2006-2008 Dan Fuhry |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
7 |
* |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
8 |
* 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
|
9 |
* 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
|
10 |
* |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
11 |
* 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
|
12 |
* 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
|
13 |
*/ |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
14 |
|
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
15 |
// 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
|
16 |
|
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
17 |
function page_Admin_CacheManager() |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
18 |
{ |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
19 |
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
|
20 |
global $lang; |
613 | 21 |
global $cache; |
605
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
22 |
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
|
23 |
{ |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
24 |
$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
|
25 |
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
|
26 |
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
|
27 |
return; |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
28 |
} |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
29 |
|
613 | 30 |
// validation/actions |
31 |
if ( isset($_POST['refresh']) || isset($_POST['clear']) ) |
|
32 |
{ |
|
33 |
$success = false; |
|
34 |
||
35 |
$target = ( isset($_POST['refresh']) ) ? $_POST['refresh'] : $_POST['clear']; |
|
36 |
$do_refresh = isset($_POST['refresh']); |
|
37 |
switch ( $target ) |
|
38 |
{ |
|
39 |
case 'page': |
|
40 |
$success = $cache->purge('page_meta'); |
|
41 |
if ( $do_refresh && $success ) |
|
42 |
$success = $paths->update_metadata_cache(); |
|
43 |
break; |
|
44 |
case 'ranks': |
|
45 |
$success = $cache->purge('ranks'); |
|
46 |
if ( $do_refresh && $success ) |
|
47 |
$success = generate_cache_userranks(); |
|
48 |
break; |
|
49 |
case 'sidebar': |
|
50 |
$success = $cache->purge('anon_sidebar'); |
|
51 |
break; |
|
52 |
case 'plugins': |
|
53 |
$success = $cache->purge('plugins'); |
|
54 |
if ( $do_refresh && $success ) |
|
55 |
$success = $plugins->generate_plugins_cache(); |
|
56 |
break; |
|
57 |
case 'template': |
|
58 |
if ( $dh = opendir(ENANO_ROOT . '/cache') ) |
|
59 |
{ |
|
60 |
while ( $file = @readdir($dh) ) |
|
61 |
{ |
|
62 |
$fullpath = ENANO_ROOT . "/cache/$file"; |
|
63 |
// we don't want to mess with directories |
|
64 |
if ( !is_file($fullpath) ) |
|
65 |
continue; |
|
66 |
||
67 |
if ( preg_match('/\.(?:tpl|css)\.php$/', $file) ) |
|
68 |
{ |
|
69 |
unlink($fullpath); |
|
70 |
} |
|
71 |
} |
|
72 |
$success = true; |
|
73 |
} |
|
74 |
break; |
|
75 |
case 'aes': |
|
76 |
$success = @unlink(ENANO_ROOT . '/cache/aes_decrypt.php'); |
|
77 |
break; |
|
78 |
case 'lang': |
|
79 |
if ( $dh = opendir(ENANO_ROOT . '/cache') ) |
|
80 |
{ |
|
81 |
while ( $file = @readdir($dh) ) |
|
82 |
{ |
|
83 |
$fullpath = ENANO_ROOT . "/cache/$file"; |
|
84 |
// we don't want to mess with directories |
|
85 |
if ( !is_file($fullpath) ) |
|
86 |
continue; |
|
87 |
||
88 |
if ( preg_match('/^lang_json_(?:[a-f0-9]+?)\.php$/', $file) || preg_match('/^(?:cache_)?lang_(?:[0-9]+?)\.php$/', $file) ) |
|
89 |
unlink($fullpath); |
|
90 |
} |
|
91 |
$success = true; |
|
92 |
} |
|
93 |
if ( $do_refresh && $success ) |
|
94 |
{ |
|
95 |
// for each language in the database, call regen_caches() |
|
96 |
$q = $db->sql_query('SELECT lang_id FROM ' . table_prefix . 'language;'); |
|
97 |
if ( !$q ) |
|
98 |
$db->_die(); |
|
99 |
while ( $row = $db->fetchrow($q) ) |
|
100 |
{ |
|
101 |
$lang_local = ( $row['lang_id'] == $lang->lang_id ) ? $lang : new Language($row['lang_id']); |
|
102 |
$success = $lang_local->regen_caches(); |
|
103 |
if ( !$success ) |
|
104 |
break 2; |
|
105 |
} |
|
106 |
} |
|
107 |
break; |
|
108 |
case 'js': |
|
109 |
if ( $dh = opendir(ENANO_ROOT . '/cache') ) |
|
110 |
{ |
|
111 |
while ( $file = @readdir($dh) ) |
|
112 |
{ |
|
113 |
$fullpath = ENANO_ROOT . "/cache/$file"; |
|
114 |
// we don't want to mess with directories |
|
115 |
if ( !is_file($fullpath) ) |
|
116 |
continue; |
|
117 |
||
118 |
// compressed javascript |
|
119 |
if ( preg_match('/^jsres_(?:[A-z0-9_-]+)\.js\.json$/', $file) ) |
|
120 |
unlink($fullpath); |
|
121 |
// tinymce stuff |
|
122 |
else if ( preg_match('/^tiny_mce_(?:[a-f0-9]+)\.gz$/', $file) ) |
|
123 |
unlink($fullpath); |
|
124 |
} |
|
125 |
$success = true; |
|
126 |
} |
|
127 |
break; |
|
128 |
case 'thumbs': |
|
129 |
if ( $dh = opendir(ENANO_ROOT . '/cache') ) |
|
130 |
{ |
|
131 |
while ( $file = @readdir($dh) ) |
|
132 |
{ |
|
133 |
$fullpath = ENANO_ROOT . "/cache/$file"; |
|
134 |
// we don't want to mess with directories |
|
135 |
if ( !is_file($fullpath) ) |
|
136 |
continue; |
|
137 |
||
138 |
if ( preg_match('/^(?:[a-z0-9\._,-]+)-(?:[0-9]{10})-[0-9]+x[0-9]+\.([a-z0-9_-]+)$/i', $file) ) |
|
139 |
unlink($fullpath); |
|
140 |
} |
|
141 |
$success = true; |
|
142 |
} |
|
143 |
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
|
144 |
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
|
145 |
$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
|
146 |
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
|
147 |
$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
|
148 |
|
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 |
$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
|
150 |
break; |
613 | 151 |
case 'all': |
152 |
$success = purge_all_caches(); |
|
153 |
if ( $do_refresh ) |
|
154 |
{ |
|
155 |
// |
|
156 |
// refresh all static (non-incremental) caches |
|
157 |
// |
|
158 |
||
159 |
// pages |
|
160 |
$success = $paths->update_metadata_cache(); |
|
161 |
if ( !$success ) |
|
162 |
break; |
|
163 |
||
164 |
// user ranks |
|
165 |
$success = generate_cache_userranks(); |
|
166 |
if ( !$success ) |
|
167 |
break; |
|
168 |
||
169 |
// plugins |
|
170 |
$success = $plugins->generate_plugins_cache(); |
|
171 |
if ( !$success ) |
|
172 |
break; |
|
173 |
||
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
|
174 |
// 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 |
$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
|
176 |
|
613 | 177 |
// languages |
178 |
$q = $db->sql_query('SELECT lang_id FROM ' . table_prefix . 'language;'); |
|
179 |
if ( !$q ) |
|
180 |
$db->_die(); |
|
181 |
while ( $row = $db->fetchrow($q) ) |
|
182 |
{ |
|
183 |
$lang_local = ( $row['lang_id'] == $lang->lang_id ) ? $lang : new Language($row['lang_id']); |
|
184 |
$success = $lang_local->regen_caches(); |
|
185 |
if ( !$success ) |
|
186 |
break 2; |
|
187 |
} |
|
188 |
} |
|
189 |
break; |
|
190 |
default: |
|
191 |
$code = $plugins->setHook('acp_cache_manager_action'); |
|
192 |
foreach ( $code as $cmd ) |
|
193 |
{ |
|
194 |
eval($cmd); |
|
195 |
} |
|
196 |
break; |
|
197 |
} |
|
198 |
if ( $success ) |
|
199 |
{ |
|
200 |
echo '<div class="info-box">' . $lang->get('acpcm_msg_action_success') . '</div>'; |
|
201 |
} |
|
202 |
else |
|
203 |
{ |
|
204 |
echo '<div class="error-box">' . $lang->get('acpcm_err_action_failed') . '</div>'; |
|
205 |
} |
|
206 |
} |
|
207 |
else if ( isset($_POST['save']) ) |
|
208 |
{ |
|
209 |
$config_value = ( isset($_POST['cache_thumbs']) ) ? '1' : '0'; |
|
210 |
setConfig('cache_thumbs', $config_value); |
|
211 |
echo '<div class="info-box">' . $lang->get('acpcm_msg_action_success') . '</div>'; |
|
212 |
} |
|
213 |
||
605
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
214 |
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
|
215 |
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
|
216 |
|
613 | 217 |
echo '<div class="warning-box">' . $lang->get('acpcm_msg_refresh_warning') . '</div>'; |
218 |
||
605
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
219 |
acp_start_form(); |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
220 |
?> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
221 |
<div class="tblholder"> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
222 |
<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
|
223 |
<!-- HEADER --> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
224 |
<tr> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
225 |
<th colspan="2"> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
226 |
<?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
|
227 |
</th> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
228 |
</tr> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
229 |
|
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
230 |
<!-- ENABLE CACHE --> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
231 |
<tr> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
232 |
<td class="row1" colspan="2"> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
233 |
<label> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
234 |
<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
|
235 |
<?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
|
236 |
</label> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
237 |
<br /> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
238 |
<small> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
239 |
<?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
|
240 |
</small> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
241 |
</td> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
242 |
</tr> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
243 |
|
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
244 |
<!-- CLEAR ALL --> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
245 |
<tr> |
613 | 246 |
<td class="row2" style="width: 120px; text-align: center;"> |
247 |
<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
|
248 |
</td> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
249 |
<td class="row2"> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
250 |
<?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
|
251 |
</td> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
252 |
</tr> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
253 |
|
613 | 254 |
<?php |
255 |
// if caching is disabled, might as well break off here |
|
256 |
if ( getConfig('cache_thumbs') == '1' ): |
|
257 |
?> |
|
258 |
||
605
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
259 |
<!-- REFRESH ALL --> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
260 |
<tr> |
613 | 261 |
<td class="row1" style="text-align: center;"> |
262 |
<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
|
263 |
</td> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
264 |
<td class="row1"> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
265 |
<?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
|
266 |
</td> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
267 |
</tr> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
268 |
|
613 | 269 |
<!-- INDIVIDUAL CACHES --> |
270 |
<tr> |
|
271 |
<th class="subhead" colspan="2"> |
|
272 |
<?php echo $lang->get('acpcm_th_individual_caches'); ?> |
|
273 |
</th> |
|
274 |
</tr> |
|
275 |
||
276 |
<?php |
|
277 |
$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
|
278 |
$cache_list = array('page', 'ranks', 'sidebar', 'plugins', 'template', 'aes', 'lang', 'js', 'thumbs', 'wikieditnotice'); |
613 | 279 |
$code = $plugins->setHook('acp_cache_manager_list_caches'); |
280 |
foreach ( $code as $cmd ) |
|
281 |
{ |
|
282 |
eval($cmd); |
|
283 |
} |
|
284 |
foreach ( $cache_list as $target ) |
|
285 |
{ |
|
286 |
$class = ( $class == 'row1' ) ? 'row2' : 'row1'; |
|
287 |
?><tr> |
|
288 |
<td class="<?php echo $class; ?>" style="text-align: center;"> |
|
289 |
<button name="refresh" value="<?php echo $target; ?>"<?php if ( in_array($target, array('template', 'sidebar', 'aes', 'js', 'thumbs')) ) echo ' disabled="disabled"'; ?>> |
|
290 |
<?php echo $lang->get('acpcm_btn_refresh'); ?> |
|
291 |
</button> |
|
292 |
<button name="clear" value="<?php echo $target; ?>"> |
|
293 |
<?php echo $lang->get('acpcm_btn_clear'); ?> |
|
294 |
</button> |
|
295 |
</td> |
|
296 |
<td class="<?php echo $class; ?>"> |
|
297 |
<b><?php echo $lang->get("acpcm_cache_{$target}_desc_title"); ?></b> – |
|
298 |
<?php echo $lang->get("acpcm_cache_{$target}_desc_body"); ?> |
|
299 |
</td> |
|
300 |
</tr> |
|
301 |
<?php |
|
302 |
} |
|
303 |
||
304 |
// getConfig('cache_thumbs') == '1' |
|
305 |
endif; |
|
306 |
?> |
|
307 |
||
605
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
308 |
<!-- SAVE CHANGES --> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
309 |
<tr> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
310 |
<th colspan="2" class="subhead"> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
311 |
<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
|
312 |
<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
|
313 |
</th> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
314 |
</tr> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
315 |
</table> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
316 |
</div> |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
317 |
<?php |
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
318 |
echo '</form>'; |
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 |
|
d2d4e40ecd29
First draft of new CacheManager admin page. Backend is yet to be implemented.
Dan
parents:
diff
changeset
|
321 |
?> |