Merge branch 'wip-MDL-37474-m25' of git://github.com/samhemelryk/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2013-01-29 01:32:09 +01:00
commit ee4cac2b44
3 changed files with 15 additions and 2 deletions

10
cache/admin.php vendored
View File

@ -129,7 +129,7 @@ if (!empty($action) && confirm_sesskey()) {
}
break;
case 'editdefinitionmapping' : // Edit definition mappings.
$definition = required_param('definition', PARAM_TEXT);
$definition = required_param('definition', PARAM_ALPHANUMEXT);
$title = get_string('editdefinitionmappings', 'cache', $definition);
$mform = new cache_definition_mappings_form($PAGE->url, array('definition' => $definition));
if ($mform->is_cancelled()) {
@ -167,6 +167,14 @@ if (!empty($action) && confirm_sesskey()) {
}
break;
case 'purgedefinition': // Purge a specific definition.
$definition = required_param('definition', PARAM_ALPHANUMEXT);
list($component, $area) = explode('/', $definition, 2);
cache_helper::purge_by_definition($component, $area);
redirect($PAGE->url, get_string('purgedefinitionsuccess', 'cache'), 5);
break;
case 'purgestore':
case 'purge': // Purge a store cache.
$store = required_param('store', PARAM_TEXT);
cache_helper::purge_store($store);

6
cache/locallib.php vendored
View File

@ -698,6 +698,10 @@ abstract class cache_administration_helper extends cache_helper {
array(
'text' => get_string('editmappings', 'cache'),
'url' => new moodle_url('/cache/admin.php', array('action' => 'editdefinitionmapping', 'sesskey' => sesskey()))
),
array(
'text' => get_string('purge', 'cache'),
'url' => new moodle_url('/cache/admin.php', array('action' => 'purgedefinition', 'sesskey' => sesskey()))
)
);
}
@ -727,7 +731,7 @@ abstract class cache_administration_helper extends cache_helper {
}
$actions[] = array(
'text' => get_string('purge', 'cache'),
'url' => new moodle_url($baseurl, array('action' => 'purge'))
'url' => new moodle_url($baseurl, array('action' => 'purgestore'))
);
}
return $actions;

View File

@ -92,6 +92,7 @@ $string['none'] = 'None';
$string['plugin'] = 'Plugin';
$string['pluginsummaries'] = 'Installed cache stores';
$string['purge'] = 'Purge';
$string['purgedefinitionsuccess'] = 'Successfully purged the requested definition.';
$string['purgestoresuccess'] = 'Successfully purged the requested store.';
$string['requestcount'] = 'Test with {$a} requests';
$string['rescandefinitions'] = 'Rescan definitions';