/** * Installs any new plugins */ public function install_new_plugins() { global $CFG; // include the ilp db require_once $CFG->dirroot . '/blocks/ilp/db/ilp_db.php'; // instantiate the ilp db class needed as this function will be called //when not in object context $dbc = new ilp_db(); //call the install new plugins function from the parent class //pass the list of plugins currently installed to it parent::install_new_plugins($dbc->get_mis_plugins(), $CFG->dirroot . "/blocks/ilp/classes/dashboard/mis"); }
//this section gets language strings for all tab plugins foreach ($tab_plugins as $plugin_file) { if (file_exists($tabs . '/' . $plugin_file . ".php")) { require_once $tabs . '/' . $plugin_file . ".php"; // instantiate the object $class = basename($plugin_file, ".php"); $tabobj = new $class(); $method = array($tabobj, 'language_strings'); //check whether the language string element has been defined if (is_callable($method, true)) { $tabobj->language_strings($string); } } } $plugins = $CFG->dirroot . '/blocks/ilp/classes/dashboard/mis'; if ($dbc->get_mis_plugins() !== false) { $mis_plugins = ilp_records_to_menu($dbc->get_mis_plugins(), 'id', 'name'); foreach ($mis_plugins as $plugin_file) { if (file_exists($plugins . '/' . $plugin_file . ".php")) { require_once $plugins . '/' . $plugin_file . ".php"; // instantiate the object $class = basename($plugin_file, ".php"); $pluginobj = new $class(); $method = array($pluginobj, 'language_strings'); //check whether the config_settings method has been defined if (is_callable($method, true)) { $pluginobj->language_strings($string); } } } }