private function init() { if (!$this->isInit) { $this->isInit = true; // Discover location of editor plugin. $editor_plugin = WIRISpluginWrapper::get_wiris_plugin(); $this->installed = !empty($editor_plugin); // Return if editor plugin is not installed. if (!$this->installed) { global $COURSE, $PAGE; $coursecontext = context_course::instance($COURSE->id); if (has_capability('moodle/site:config', $coursecontext)) { // Display missing WIRIS editor plugin dependency error $PAGE->requires->js('/filter/wiris/js/message.js', false); } return null; } // Init haxe environment. if (!class_exists('com_wiris_system_CallWrapper')) { require_once $editor_plugin->path . '/integration/lib/com/wiris/system/CallWrapper.class.php'; } com_wiris_system_CallWrapper::getInstance()->init($editor_plugin->path . '/integration'); // Start haxe environment. $this->begin(); // Create PluginBuilder with Moodle specific configuration. require_once 'MoodleConfigurationUpdater.php'; $this->moodleConfig = new com_wiris_plugin_configuration_MoodleConfigurationUpdater($editor_plugin); $this->instance = com_wiris_plugin_api_PluginBuilder::getInstance(); $this->instance->addConfigurationUpdater($this->moodleConfig); $this->instance->addConfigurationUpdater(new com_wiris_plugin_web_PhpConfigurationUpdater()); // Stop haxe environment. $this->end(); } }
public function com_wiris_plugin_configuration_MoodleConfigurationUpdater() { $scriptName = explode('/', $_SERVER["SCRIPT_FILENAME"]); $scriptName = array_pop($scriptName); if ($scriptName == 'showimage.php') { return; } global $CFG; require_once 'wirispluginwrapper.php'; $this->editor_plugin = WIRISpluginWrapper::get_wiris_plugin(); }
$report_text = 'WIRIS plugin for ' . $wiris_plugin_base_string . ' must be installed.'; $solution_link = 'http://www.wiris.com/plugins/moodle/download'; $wiris_plugin = $wiris_plugin_base . '/integration'; $condition = file_exists($wiris_plugin); if (!$condition) { $wiris_plugin = '../../lib/editor/tinymce/plugins/tiny_mce_wiris/integration'; $condition = file_exists($wiris_plugin); } echo wrs_createTableRow($test_name, $report_text, $solution_link, $condition); ?> </tr> <tr> <?php @(include 'wirispluginwrapper.php'); $wirisplugin = WIRISpluginWrapper::get_wiris_plugin(); $test_name = 'Matching WIRIS plugin filter and WIRIS plugin for ' . $wiris_plugin_base_string . ' versions'; if (isset($plugin->release)) { $filter_version = $plugin->release; } else { $report_text = ''; } // Using version.php to check release number if (strtolower($wiris_plugin_base_string) == 'tinymce') { include $wiris_plugin_base . '/../version.php'; } else { include $wiris_plugin_base . '/version.php'; } if (isset($plugin->release)) { $plugin_version = $plugin->release; } else {