From: skodak Date: Tue, 23 Sep 2008 14:47:10 +0000 (+0000) Subject: MDL-16629 removed legacy unfinished multiple editors code X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=9d7b40b95b7367abdebd2cc411c0544aaeae5112;p=moodle.git MDL-16629 removed legacy unfinished multiple editors code --- diff --git a/lib/editorlib.php b/lib/editorlib.php deleted file mode 100644 index 6ca03e0a0b..0000000000 --- a/lib/editorlib.php +++ /dev/null @@ -1,116 +0,0 @@ -cfg = &$CFG; - $this->user = &$USER; - $this->courseid = NULL; - } - - /** - * Method to load necessary editor codes to - * $CFG->editorsrc array. - * - * @todo example code. - * @param mixed $args Course id or associative array holding course id and editor name. - */ - function loadeditor($args) { - - global $CFG, $USER; - - if ( is_array($args) ) { - // If args is an array search keys courseid and name. - // Name represents editor name to load. - if ( !array_key_exists('courseid', $args) ) { - print_error('invalidcourseid'); - } - - if ( !array_key_exists('name', $args) ) { - print_error('missingvarname'); - } - - $courseid = clean_param($args['courseid'], PARAM_INT); - $editorname = strtolower(clean_param($args['name'], PARAM_ALPHA)); - } else { - // If only single argument is passed - // this must be course id. - $courseid = clean_param($args, PARAM_INT); - } - - $htmleditor = !empty($editorname) ? $editorname : intval($USER->htmleditor); - - if ( can_use_html_editor() ) { - $CFG->editorsrc = array(); - $editorbaseurl = $CFG->httpswwwroot .'/lib/editor'; - $editorbasedir = $CFG->dirroot .'/lib/editor'; - - switch ($htmleditor) { - case 1: - case 'htmlarea': - array_push($CFG->editorsrc, "$editorbaseurl/htmlarea/htmlarea.php?id={$courseid}"); - array_push($CFG->editorsrc, "$editorbaseurl/htmlarea/lang/en.php"); - $classfile = "$editorbasedir/htmlarea/htmlarea.class.php"; - include_once($classfile); - return (new htmlarea($courseid)); - break; - case 2: - case 'tinymce': - array_push($CFG->editorsrc, "$editorbaseurl/tinymce/jscripts/tiny_mce/tiny_mce_gzip.php"); - array_push($CFG->editorsrc, "$editorbaseurl/tinymce/moodledialog.js"); - $classfile = "$editorbasedir/tinymce/tinymce.class.php"; - include_once($classfile); - return (new tinymce($courseid)); - break; - } - } - } - - /** - * Print out error message and stop outputting. - * - * @param string $message - */ - function error($message) { - echo '
'; - echo 'editorObject error: '; - echo s($message, true); - echo '
'; - exit; - } -} - -?>