Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-25290 cache: Fixed up redirect loop with admin settings for cache…

… stores
  • Loading branch information...
commit f23fbfd84918a22ad5a36d0a2804925f756611fc 1 parent 52642d0
@samhemelryk samhemelryk authored
View
16 admin/settings/plugins.php
@@ -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')));
View
9 admin/settings/server.php
@@ -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);
View
6 cache/stores/memcache/settings.php
@@ -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));
View
6 cache/stores/memcached/settings.php
@@ -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));
View
6 cache/stores/mongodb/settings.php
@@ -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));
View
1  lang/en/cache.php
@@ -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';
Please sign in to comment.
Something went wrong with that request. Please try again.