MDL-26784 Improved plugins check screen and the new plugins management screen
This patch introduces new lib/pluginlib.php library that provides unified access meta-information about all present plugin types. The library defines plugin_manager singleton that in turn gathers information about all present plugins and their status. The list of plugins can be rendered either as plugins check table or plugins control panel. This makes print_plugins_table() function obsolete and because it is not expected to be called by any contrib plugin, the function is removed. CSS for the legacy table generated by print_plugins_table() is cleaned up.
This commit is contained in:
@@ -9659,41 +9659,6 @@ function object_array_unique($array, $keep_key_assoc = true) {
|
||||
return $keep_key_assoc ? $array : array_values($array);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the language string for the given plugin.
|
||||
*
|
||||
* @param string $plugin the plugin code name
|
||||
* @param string $type the type of plugin (mod, block, filter)
|
||||
* @return string The plugin language string
|
||||
*/
|
||||
function get_plugin_name($plugin, $type='mod') {
|
||||
$plugin_name = '';
|
||||
|
||||
switch ($type) {
|
||||
case 'mod':
|
||||
$plugin_name = get_string('modulename', $plugin);
|
||||
break;
|
||||
case 'blocks':
|
||||
$plugin_name = get_string('pluginname', "block_$plugin");
|
||||
if (empty($plugin_name) || $plugin_name == '[[pluginname]]') {
|
||||
if (($block = block_instance($plugin)) !== false) {
|
||||
$plugin_name = $block->get_title();
|
||||
} else {
|
||||
$plugin_name = "[[$plugin]]";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'filter':
|
||||
$plugin_name = filter_get_name('filter/' . $plugin);
|
||||
break;
|
||||
default:
|
||||
$plugin_name = $plugin;
|
||||
break;
|
||||
}
|
||||
|
||||
return $plugin_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is a userid the primary administrator?
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user