mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
MDL-41437 rework plugin_manager caching and version info in blocks and modules
This patch includes: * version column removed from modules table, now using standard config, this allows decimal version for modules * version column removed from block table, now using standard config, this allows decimal version for blocks * module version.php can safely use $plugins instead of module * new plugin_manager bulk caching, this should help with MUC performance when logged in as admin * all missing plugins are now in plugin overview (previously only blocks and modules) * simplified code and improved coding style * reworked plugin_manager unit tests - now using real plugins instead of mocks * unit tests now fail if any plugin does not contain proper version.php file * allow uninstall of deleted filters
This commit is contained in:
parent
81881cb9d6
commit
bde002b81a
50 changed files with 1601 additions and 1940 deletions
|
@ -74,25 +74,20 @@ class atto_texteditor extends texteditor {
|
|||
* @param null $fpoptions
|
||||
*/
|
||||
public function use_editor($elementid, array $options=null, $fpoptions=null) {
|
||||
global $PAGE, $CFG;
|
||||
global $PAGE;
|
||||
$PAGE->requires->yui_module('moodle-editor_atto-editor',
|
||||
'M.editor_atto.init',
|
||||
array($this->get_init_params($elementid, $options, $fpoptions)), true);
|
||||
require_once($CFG->libdir . '/pluginlib.php');
|
||||
|
||||
$pluginman = plugin_manager::instance();
|
||||
$plugins = $pluginman->get_subplugins_of_plugin('editor_atto');
|
||||
$plugins = core_component::get_plugin_list('atto');
|
||||
|
||||
$sortedplugins = array();
|
||||
|
||||
foreach ($plugins as $id => $plugin) {
|
||||
$sortorder = component_callback($plugin->type . '_' . $plugin->name, 'sort_order', array($elementid));
|
||||
$sortedplugins[$sortorder] = $plugin;
|
||||
foreach ($plugins as $name => $fulldir) {
|
||||
$plugins[$name] = component_callback('atto_' . $name, 'sort_order', array($elementid));
|
||||
}
|
||||
|
||||
ksort($sortedplugins);
|
||||
foreach ($sortedplugins as $plugin) {
|
||||
component_callback($plugin->type . '_' . $plugin->name, 'init_editor', array($elementid));
|
||||
asort($plugins);
|
||||
foreach ($plugins as $name => $sort) {
|
||||
component_callback('atto_' . $name, 'init_editor', array($elementid));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue