public function define_plugin_structure($connectionpoint) { global $CFG; require_once $CFG->libdir . '/plagiarismlib.php'; //check if enabled at site level and plugin is enabled. $enabledplugins = plagiarism_load_available_plugins(); if (!array_key_exists($this->pluginname, $enabledplugins)) { return; } parent::define_plugin_structure($connectionpoint); }
public function define_plugin_structure($connectionpoint) { global $CFG; if (!$connectionpoint instanceof restore_path_element) { throw new restore_step_exception('restore_path_element_required', $connectionpoint); } //check if enabled at site level and plugin is enabled. require_once $CFG->libdir . '/plagiarismlib.php'; $enabledplugins = plagiarism_load_available_plugins(); if (!array_key_exists($this->pluginname, $enabledplugins)) { return array(); } return parent::define_plugin_structure($connectionpoint); }
/** * used by admin/cron.php to get similarity scores from submitted files. * */ function plagiarism_cron() { global $CFG; if (empty($CFG->enableplagiarism)) { return ''; } $plagiarismplugins = plagiarism_load_available_plugins(); foreach ($plagiarismplugins as $plugin => $dir) { mtrace('Processing cron function for plagiarism_plugin_' . $plugin . '...', ''); cron_trace_time_and_memory(); require_once $dir . '/lib.php'; $plagiarismclass = "plagiarism_plugin_{$plugin}"; $plagiarismplugin = new $plagiarismclass(); $plagiarismplugin->cron(); } }
/** * used by admin/cron.php to get similarity scores from submitted files. * */ function plagiarism_cron() { global $CFG; if (empty($CFG->enableplagiarism)) { return ''; } $plagiarismplugins = plagiarism_load_available_plugins(); foreach ($plagiarismplugins as $plugin => $dir) { require_once $dir . '/lib.php'; $plagiarismclass = "plagiarism_plugin_{$plugin}"; $plagiarismplugin = new $plagiarismclass(); $plagiarismplugin->cron(); } }