Skip to content

Commit

Permalink
MDL-25290 cache: Fixed up redirect loop with admin settings for cache…
Browse files Browse the repository at this point in the history
… stores
  • Loading branch information
Sam Hemelryk committed Oct 7, 2012
1 parent 52642d0 commit f23fbfd
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 24 deletions.
16 changes: 16 additions & 0 deletions admin/settings/plugins.php
Expand Up @@ -492,6 +492,22 @@
}
}

// Now add the Cache plugins
if ($hassiteconfig) {
$ADMIN->add('modules', new admin_category('cache', new lang_string('caching', 'cache')));
$ADMIN->add('cache', new admin_externalpage('cacheconfig', new lang_string('cacheconfig', 'cache'), $CFG->wwwroot .'/cache/admin.php'));
$ADMIN->add('cache', new admin_externalpage('cachetestperformance', new lang_string('testperformance', 'cache'), $CFG->wwwroot . '/cache/testperformance.php'));
$ADMIN->add('cache', new admin_category('cachestores', new lang_string('cachestores', 'cache')));
foreach (get_plugin_list('cache') as $plugin => $path) {
$settingspath = $path.'/settings.php';
if (file_exists($settingspath)) {
$settings = new admin_settingpage('cache_'.$plugin.'_settings', new lang_string('pluginname', 'cache_'.$plugin), 'moodle/site:config');
include($settingspath);
$ADMIN->add('cachestores', $settings);
}
}
}

/// Add all local plugins - must be always last!
if ($hassiteconfig) {
$ADMIN->add('modules', new admin_category('localplugins', new lang_string('localplugins')));
Expand Down
9 changes: 0 additions & 9 deletions admin/settings/server.php
Expand Up @@ -217,15 +217,6 @@
'1' => new lang_string('yes'))));
*/

$ADMIN->add('server', new admin_category('cache', new lang_string('caching', 'cache')));
$ADMIN->add('cache', new admin_externalpage('cacheconfig', get_string('cacheconfig', 'cache'), new moodle_url('/cache/admin.php')));
$ADMIN->add('cache', new admin_externalpage('cachetestperformance', get_string('testperformance', 'cache'), new moodle_url('/cache/testperformance.php')));
foreach (get_plugin_list_with_file('cache', 'settings.php') as $plugin => $path) {
$settings = new admin_settingpage('cache_'.$plugin.'_settings', new lang_string('pluginname', 'cache_'.$plugin));
require_once($path);
$ADMIN->add('cache', $settings);
}

$ADMIN->add('server', $temp);


Expand Down
6 changes: 1 addition & 5 deletions cache/stores/memcache/settings.php
Expand Up @@ -26,8 +26,4 @@

defined('MOODLE_INTERNAL') || die;

if ($ADMIN->fulltree) {
require_once($CFG->dirroot.'/cache/stores/memcache/lib.php');

$settings->add(new admin_setting_configtextarea('cache_memcache/testservers', get_string('testservers', 'cache_memcache'), get_string('testservers_desc', 'cache_memcache'), ''));
}
$settings->add(new admin_setting_configtextarea('cache_memcache/testservers', new lang_string('testservers', 'cache_memcache'), new lang_string('testservers_desc', 'cache_memcache'), '', PARAM_RAW, 60, 3));
6 changes: 1 addition & 5 deletions cache/stores/memcached/settings.php
Expand Up @@ -26,8 +26,4 @@

defined('MOODLE_INTERNAL') || die;

if ($ADMIN->fulltree) {
require_once($CFG->dirroot.'/cache/stores/memcached/lib.php');

$settings->add(new admin_setting_configtextarea('cache_memcached/testservers', get_string('testservers', 'cache_memcached'), get_string('testservers_desc', 'cache_memcached'), ''));
}
$settings->add(new admin_setting_configtextarea('cache_memcached/testservers', new lang_string('testservers', 'cache_memcached'), new lang_string('testservers_desc', 'cache_memcached'), '', PARAM_RAW, 60, 3));
6 changes: 1 addition & 5 deletions cache/stores/mongodb/settings.php
Expand Up @@ -26,8 +26,4 @@

defined('MOODLE_INTERNAL') || die;

if ($ADMIN->fulltree) {
require_once($CFG->dirroot.'/cache/stores/mongodb/lib.php');

$settings->add(new admin_setting_configtextarea('cache_mongodb/testserver', get_string('testserver', 'cache_mongodb'), get_string('testserver_desc', 'cache_mongodb'), ''));
}
$settings->add(new admin_setting_configtextarea('cache_mongodb/testserver', new lang_string('testserver', 'cache_mongodb'), new lang_string('testserver_desc', 'cache_mongodb'), '', PARAM_RAW, 60, 3));
1 change: 1 addition & 0 deletions lang/en/cache.php
Expand Up @@ -13,6 +13,7 @@
$string['cachedef_eventinvalidation'] = 'Event invalidation';
$string['cachedef_locking'] = 'Locking';
$string['cachedef_string'] = 'Language string cache';
$string['cachestores'] = 'Cache stores';
$string['component'] = 'Component';
$string['confirmstoredeletion'] = 'Confirm store deletion';
$string['defaultmappings'] = 'Default mappings';
Expand Down

0 comments on commit f23fbfd

Please sign in to comment.