2 /************************************************************************
3 * MXChange v0.2.1 Start: 01/29/2006 *
4 * ================ Last change: 01/29/2006 *
6 * -------------------------------------------------------------------- *
7 * File : what-config_cache.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Configuration for the caching system *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Konfiguration des Caching-Systems *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * Needs to be in all Files and every File needs "svn propset *
18 * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
19 * -------------------------------------------------------------------- *
20 * Copyright (c) 2003 - 2008 by Roland Haeder *
21 * For more information visit: http://www.mxchange.org *
23 * This program is free software; you can redistribute it and/or modify *
24 * it under the terms of the GNU General Public License as published by *
25 * the Free Software Foundation; either version 2 of the License, or *
26 * (at your option) any later version. *
28 * This program is distributed in the hope that it will be useful, *
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
31 * GNU General Public License for more details. *
33 * You should have received a copy of the GNU General Public License *
34 * along with this program; if not, write to the Free Software *
35 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
37 ************************************************************************/
39 // Some security stuff...
40 if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
41 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
45 // Add description as navigation point
46 ADD_DESCR('admin', __FILE__);
49 // Cache path has been not changed by default so don't test it again
50 REQUEST_SET_POST('cache_tested', 'N');
52 // Check if path has been changed
53 if (REQUEST_POST('cache_path') != getConfig('cache_path')) {
54 // Okay, cache path has been altered so we have to test it again!
55 REQUEST_SET_POST('cache_tested', 'Y');
58 if ((REQUEST_POST('cache_admins') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile('admins'))) {
59 $GLOBALS['cache_instance']->destroyCacheFile();
62 if ((REQUEST_POST('cache_acls') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile('acls'))) {
63 $GLOBALS['cache_instance']->destroyCacheFile();
66 if ((REQUEST_POST('cache_exts') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile('extensions', true))) {
67 $GLOBALS['cache_instance']->destroyCacheFile();
70 if ((REQUEST_POST('cache_config') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile('config'))) {
71 $GLOBALS['cache_instance']->destroyCacheFile();
74 if ((REQUEST_POST('cache_modreg') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile('modreg'))) {
75 $GLOBALS['cache_instance']->destroyCacheFile();
78 if ((REQUEST_POST('cache_refdepth') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile('refdepth'))) {
79 $GLOBALS['cache_instance']->destroyCacheFile();
82 if ((REQUEST_POST('cache_refsys') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile('refsys'))) {
83 $GLOBALS['cache_instance']->destroyCacheFile();
87 ADMIN_SAVE_SETTINGS_POST();
90 // @TODO Rewrite all constants
91 switch (getConfig('cache_admins')) {
93 define('__ADMINS_Y', ' checked="checked"');
94 define('__ADMINS_N', '');
98 define('__ADMINS_Y', '');
99 define('__ADMINS_N', ' checked="checked"');
103 switch (getConfig('cache_acls')) {
105 define('__ACLS_Y', ' checked="checked"');
106 define('__ACLS_N', '');
110 define('__ACLS_Y', '');
111 define('__ACLS_N', ' checked="checked"');
115 switch (getConfig('cache_exts')) {
117 define('__EXTS_Y', ' checked="checked"');
118 define('__EXTS_N', '');
122 define('__EXTS_Y', '');
123 define('__EXTS_N', ' checked="checked"');
127 switch (getConfig('cache_config')) {
129 define('__CONFIG_Y', ' checked="checked"');
130 define('__CONFIG_N', '');
134 define('__CONFIG_Y', '');
135 define('__CONFIG_N', ' checked="checked"');
139 switch (getConfig('cache_modreg')) {
141 define('__MODREG_Y', ' checked="checked"');
142 define('__MODREG_N', '');
146 define('__MODREG_Y', '');
147 define('__MODREG_N', ' checked="checked"');
151 switch (getConfig('cache_refdepth')) {
153 define('__REFDEPTH_Y', ' checked="checked"');
154 define('__REFDEPTH_N', '');
158 define('__REFDEPTH_Y', '');
159 define('__REFDEPTH_N', ' checked="checked"');
163 switch (getConfig('cache_refsys')) {
165 define('__REFSYS_Y', ' checked="checked"');
166 define('__REFSYS_N', '');
170 define('__REFSYS_Y', '');
171 define('__REFSYS_N', ' checked="checked"');
175 switch (getConfig('cache_themes')) {
177 define('__THEMES_Y', ' checked="checked"');
178 define('__THEMES_N', '');
182 define('__THEMES_Y', '');
183 define('__THEMES_N', ' checked="checked"');
187 switch (getConfig('cache_admin_menu')) {
189 define('__ADMIN_MENU_Y', ' checked="checked"');
190 define('__ADMIN_MENU_N', '');
194 define('__ADMIN_MENU_Y', '');
195 define('__ADMIN_MENU_N', ' checked="checked"');
199 define('__PATH', getConfig('cache_path'));
202 LOAD_TEMPLATE('admin_config_cache');