? config.php ? t ? lib/editor/htmlarea/messages.php ? lib/editor/htmlarea/meta.php ? lib/editor/tinymce/images ? message/.send.php.swp ? theme/standard/.meta.php.swp Index: admin/settings.php =================================================================== RCS file: /cvsroot/moodle/moodle/admin/settings.php,v retrieving revision 1.44 diff -u -F ^f -r1.44 settings.php --- admin/settings.php 2 Apr 2008 07:17:11 -0000 1.44 +++ admin/settings.php 12 May 2008 09:57:15 -0000 @@ -164,7 +164,7 @@  }    if (!empty($CFG->adminusehtmleditor)) { - use_html_editor(); + use_admin_editor();  }    print_footer(); Index: admin/upgradesettings.php =================================================================== RCS file: /cvsroot/moodle/moodle/admin/upgradesettings.php,v retrieving revision 1.23 diff -u -F ^f -r1.23 upgradesettings.php --- admin/upgradesettings.php 22 Dec 2007 18:17:15 -0000 1.23 +++ admin/upgradesettings.php 12 May 2008 09:57:15 -0000 @@ -56,7 +56,7 @@  echo '';    if (!empty($CFG->adminusehtmleditor)) { - use_html_editor(); + use_admin_editor();  }    print_footer(); Index: admin/roles/manage.php =================================================================== RCS file: /cvsroot/moodle/moodle/admin/roles/manage.php,v retrieving revision 1.57 diff -u -F ^f -r1.57 manage.php --- admin/roles/manage.php 10 Apr 2008 06:19:07 -0000 1.57 +++ admin/roles/manage.php 12 May 2008 09:57:15 -0000 @@ -497,7 +497,7 @@  print_simple_box_end();    if ($usehtmleditor) { - use_html_editor('description'); + use_admin_editor('description');  }    } else { Index: admin/settings/appearance.php =================================================================== RCS file: /cvsroot/moodle/moodle/admin/settings/appearance.php,v retrieving revision 1.31 diff -u -F ^f -r1.31 appearance.php --- admin/settings/appearance.php 26 Dec 2007 21:33:34 -0000 1.31 +++ admin/settings/appearance.php 12 May 2008 09:57:15 -0000 @@ -47,8 +47,19 @@  $ADMIN->add('appearance', $temp);    // "htmleditor" settingpage - $temp = new admin_settingpage('htmleditor', get_string('htmleditor', 'admin')); - $temp->add(new admin_setting_configcheckbox('htmleditor', get_string('usehtmleditor', 'admin'), get_string('confightmleditor','admin'), 1)); + $ADMIN->add('appearance', new admin_category('htmleditor', get_string('htmleditor', 'admin'))); + + $temp = new admin_settingpage('htmleditorsettings', get_string('htmleditorsettings', 'admin')); +  + $htmleditors = array(); + foreach (get_available_html_editors() as $editor) { + $htmleditors[$editor] = get_string($editor, 'admin'); + } + $temp->add(new admin_setting_configselect('defaulthtmleditor', get_string('defaulthtmleditor', 'admin'), null, 'tinymce', $htmleditors)); + $temp->add(new admin_setting_configcheckbox('usehtmleditor', get_string('usehtmleditor', 'admin'), get_string('confightmleditor','admin'), 1)); + $ADMIN->add('htmleditor', $temp); + + $temp = new admin_settingpage('htmlarea', get_string('htmlarea', 'admin'));  $temp->add(new admin_setting_configtext('editorbackgroundcolor', get_string('editorbackgroundcolor', 'admin'), get_string('edhelpbgcolor'), '#ffffff', PARAM_NOTAGS));  $temp->add(new admin_setting_configtext('editorfontfamily', get_string('editorfontfamily', 'admin'), get_string('edhelpfontfamily'), 'Trebuchet MS,Verdana,Arial,Helvetica,sans-serif', PARAM_NOTAGS));  $temp->add(new admin_setting_configtext('editorfontsize', get_string('editorfontsize', 'admin'), get_string('edhelpfontsize'), '', PARAM_NOTAGS)); @@ -60,7 +71,11 @@  }  $temp->add(new admin_setting_special_editorhidebuttons());  $temp->add(new admin_setting_emoticons()); - $ADMIN->add('appearance', $temp); + $ADMIN->add('htmleditor', $temp); + + $temp = new admin_settingpage('tinymce', get_string('tinymce', 'admin')); + // add tinymce configuration options here + $ADMIN->add('htmleditor', $temp);    // "documentation" settingpage  $temp = new admin_settingpage('documentation', get_string('moodledocs')); Index: lang/en_utf8/admin.php =================================================================== RCS file: /cvsroot/moodle/moodle/lang/en_utf8/admin.php,v retrieving revision 1.194 diff -u -F ^f -r1.194 admin.php --- lang/en_utf8/admin.php 6 May 2008 14:51:30 -0000 1.194 +++ lang/en_utf8/admin.php 12 May 2008 09:57:17 -0000 @@ -285,6 +285,7 @@  $string['debugnormal'] = 'NORMAL: Show errors, warnings and notices';  $string['defaultallowedmodules'] = 'Default allowed modules';  $string['defaultcourseroleid'] = 'Default role for users in a course'; +$string['defaulthtmleditor'] = 'Default HTML editor';  $string['defaultrequestcategory'] = 'Default category for course requests';  $string['defaultsettinginfo'] = 'Default: $a';  $string['defaultuserroleid'] = 'Default role for all users'; @@ -389,7 +390,9 @@  $string['hidefromall'] = 'Hide from all users';  $string['hidefromnone'] = 'Hide from nobody';  $string['hidefromstudents'] = 'Hide from students'; +$string['htmlarea'] = 'HtmlArea';  $string['htmleditor'] = 'HTML editor'; +$string['htmleditorsettings'] = 'HTML editor settings';  $string['http'] = 'HTTP';  $string['httpsecurity'] = 'HTTP security';  $string['iconvrecommended'] = 'Installing the optional ICONV library is highly recommended in order to improve site performance, particularly if your site is supporting non-Latin languages.'; @@ -668,6 +671,7 @@  $string['themeselector'] = 'Theme Selector';  $string['themesettings'] = 'Theme settings';  $string['therewereerrors'] = 'There were errors in your data'; +$string['tinymce'] = 'TinyMCE';  $string['timezone'] = 'Default timezone';  $string['timezoneforced'] = 'This is forced by the site administrator';  $string['timezoneisforcedto'] = 'Force all users to use'; Index: lang/en_utf8/editor.php =================================================================== RCS file: /cvsroot/moodle/moodle/lang/en_utf8/editor.php,v retrieving revision 1.4 diff -u -F ^f -r1.4 editor.php --- lang/en_utf8/editor.php 8 Dec 2006 04:41:19 -0000 1.4 +++ lang/en_utf8/editor.php 12 May 2008 09:57:17 -0000 @@ -126,5 +126,45 @@  $string['width'] = 'Width';  $string['wordclean'] = 'Clean Word HTML';  $string['zip'] = 'Zip'; +$string['advhr'] = 'Horizontal Rule'; +$string['anchor'] = 'Insert/edit anchor'; +$string['backcolor'] = 'Select background color'; +$string['bullist'] = 'Bulleted list'; +$string['charmap'] = 'Insert custom character'; +$string['cleanup'] = 'Cleanup messy code'; +$string['code'] = 'Toggle HTML Source'; +$string['dragmath'] = 'Insert Equation'; +$string['emotions'] = 'Insert emotion'; +$string['emoticons'] = 'Insert Smiley'; +$string['fckeditor'] = 'FCKEditor'; +$string['fontselect'] = 'Fontname'; +$string['fontsizeselect'] = 'Font-size'; +$string['forecolor'] = 'Font Color'; +$string['formatselect'] = 'Format'; +$string['fullscreen'] = 'Fullscreen editor'; +$string['htmlarea'] = 'HtmlArea'; +$string['image'] = 'Insert Image'; +$string['insertlayer'] = 'Insert layer'; +$string['link'] = 'Insert Link'; +$string['ltr'] = 'Direction from left to right'; +$string['media'] = 'Insert media'; +$string['nonbreaking'] = 'Insert nonbreaking space'; +$string['numlist'] = 'Ordered List'; +$string['pastetext'] = 'Paste text'; +$string['pasteword'] = 'Paste from Word'; +$string['removeformat'] = 'Remove formatting'; +$string['rtl'] = 'Direction from right to left'; +$string['search'] = 'Search'; +$string['selectall'] = 'Select all'; +$string['spellchecker'] = 'Spellchecker'; +$string['styleselect'] = 'Lang menu'; +$string['sub'] = 'Subscript'; +$string['sup'] = 'Superscript'; +$string['table'] = 'Table'; +$string['tinymce'] = 'TinyMCE'; +$string['toggleeditor'] = 'Toggle Editor on/off'; +$string['unlink'] = 'Unlink'; +$string['xinha'] = 'Xinha'; +$string['asciixinha'] = 'Xinha Asciimathml';    ?> Index: lang/en_utf8/help/richtext2.html =================================================================== RCS file: /cvsroot/moodle/moodle/lang/en_utf8/help/richtext2.html,v retrieving revision 1.2 diff -u -F ^f -r1.2 richtext2.html --- lang/en_utf8/help/richtext2.html 7 May 2008 07:40:50 -0000 1.2 +++ lang/en_utf8/help/richtext2.html 12 May 2008 09:57:17 -0000 @@ -5,7 +5,7 @@  print_string("htmleditordisabledadmin");  } else if (!$USER->htmleditor) {  print_string("htmleditordisabled"); - } else if (!can_use_html_editor()) { + } else if (!can_use_richtext_editor()) {  print_string("htmleditordisabledbrowser");  } else {  print_string("htmleditoravailable"); Index: lib/adminlib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/adminlib.php,v retrieving revision 1.202 diff -u -F ^f -r1.202 adminlib.php --- lib/adminlib.php 1 May 2008 20:27:42 -0000 1.202 +++ lib/adminlib.php 12 May 2008 09:57:20 -0000 @@ -2588,7 +2588,7 @@ function is_dataroot_insecure() {  */  class admin_setting_special_frontpagedesc extends admin_setting {  function admin_setting_special_frontpagedesc() { - parent::admin_setting('summary', get_string('frontpagedescription'), get_string('frontpagedescriptionhelp'), NULL); + parent::admin_setting('summary', get_string('frontpagedescription'), get_string('frontpagedescriptionhelp'), 'moodle');  }    function get_setting() { Index: lib/moodlelib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/moodlelib.php,v retrieving revision 1.1043 diff -u -F ^f -r1.1043 moodlelib.php --- lib/moodlelib.php 8 May 2008 03:50:15 -0000 1.1043 +++ lib/moodlelib.php 12 May 2008 09:57:23 -0000 @@ -6145,29 +6145,71 @@ function ini_get_bool($ini_get_arg) {  }    /** + * Get the list of available HTML editors + */ +function get_available_html_editors() { + global $CFG; + static $editors = null; + + if ($editors != null) { + return $editors; + } +  + $editors = array(); + + $dir = opendir($CFG->libdir .'/editor'); + while (($file = readdir($dir)) !== false) { + if ($file != '.' and $file != '..') { + $path_file = $CFG->libdir ."/editor/{$file}"; + if (is_dir($path_file) and file_exists($path_file ."/{$file}.class.php")) { + $editors[] = $file; + } + } + } + closedir($dir); + + return $editors; +} + +/**  * Determines if the HTML editor is enabled.  * - * This depends on site and user settings, as well as the current browser being  - * used. The current requirements are based on Tinymce's, which are available - * on http://wiki.moxiecode.com/index.php/TinyMCE:Compatiblity + * This depends on site and user + * settings, as well as the current browser being used.  * - * @return mixed false if editor cannot be used, or a string representing the compatible browser + * @return mixed string name of compatible editor, or bool false otherwise.  */  function can_use_html_editor() {  global $USER, $CFG;    if (!empty($USER->htmleditor) and !empty($CFG->htmleditor)) { - if (check_browser_version('MSIE', 5.5)) { - return 'MSIE'; - } else if (check_browser_version('Gecko', 20030516)) { - return 'Gecko'; - } else if (check_browser_version('Safari', 3)) { - return 'Safari'; - } else if (check_browser_version('Opera', 9)) { - return 'Opera'; + if (isset($_SERVER)) { + $sAgent = $_SERVER['HTTP_USER_AGENT']; + } else { + global $HTTP_SERVER_VARS; + if (isset($HTTP_SERVER_VARS)) { + $sAgent = $HTTP_SERVER_VARS['HTTP_USER_AGENT'] ; + } else { + global $HTTP_USER_AGENT ; + $sAgent = $HTTP_USER_AGENT ; + } + } + + if (strpos($sAgent, 'MSIE') !== false && strpos($sAgent, 'mac') === false && strpos($sAgent, 'Opera') === false) { + $iVersion = (float)substr($sAgent, strpos($sAgent, 'MSIE') + 5, 3); + return ($iVersion >= 5.5); + } else if (strpos($sAgent, 'Gecko/') !== false) { + $iVersion = (int)substr($sAgent, strpos($sAgent, 'Gecko/') + 6, 8); + return ($iVersion >= 20030210); + } else if (strpos($sAgent, 'Opera/') !== false) { + $fVersion = (float)substr($sAgent, strpos($sAgent, 'Opera/') + 6, 4); + return ($fVersion >= 9.5); + } else if (preg_match( "|AppleWebKit/(\d+)|i", $sAgent, $matches)) { + $iVersion = $matches[1]; + return ($matches[1] >= 522);  }  } - return false; + else return false ;  }    /** Index: lib/weblib.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/weblib.php,v retrieving revision 1.1068 diff -u -F ^f -r1.1068 weblib.php --- lib/weblib.php 8 May 2008 02:38:38 -0000 1.1068 +++ lib/weblib.php 12 May 2008 09:57:25 -0000 @@ -4769,189 +4769,6 @@ function print_recent_activity_note($tim  }  }   - -/** - * Prints a basic textarea field. - * - * @uses $CFG - * @param boolean $usehtmleditor ? - * @param int $rows ? - * @param int $cols ? - * @param null $width Legacy field no longer used! Set to zero to get control over mincols - * @param null $height Legacy field no longer used! Set to zero to get control over minrows - * @param string $name ? - * @param string $value ? - * @param int $courseid ? - * @todo Finish documenting this function - */ -function print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $value='', $courseid=0, $return=false, $id='') { -/// $width and height are legacy fields and no longer used as pixels like they used to be. -/// However, you can set them to zero to override the mincols and minrows values below. - - global $CFG, $COURSE, $HTTPSPAGEREQUIRED; - static $scriptcount = 0; // For loading the htmlarea script only once. - - $mincols = 65; - $minrows = 10; - $str = ''; - - if ($id === '') { - $id = 'edit-'.$name; - } - - if ( empty($CFG->editorsrc) ) { // for backward compatibility. - if (empty($courseid)) { - $courseid = $COURSE->id; - } - - if ($usehtmleditor) { - if (!empty($courseid) and has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $courseid))) { - $httpsrequired = empty($HTTPSPAGEREQUIRED) ? '' : '&httpsrequired=1'; - // needed for course file area browsing in image insert plugin - $str .= ($scriptcount < 1) ? ''."\n" : ''; - } else { - $httpsrequired = empty($HTTPSPAGEREQUIRED) ? '' : '?httpsrequired=1'; - $str .= ($scriptcount < 1) ? ''."\n" : ''; - - } - $str .= ($scriptcount < 1) ? ''."\n" : ''; - $scriptcount++; - - if ($height) { // Usually with legacy calls - if ($rows < $minrows) { - $rows = $minrows; - } - } - if ($width) { // Usually with legacy calls - if ($cols < $mincols) { - $cols = $mincols; - } - } - } - } - $str .= ''."\n"; - - if ($usehtmleditor) { - // Show shortcuts button if HTML editor is in use, but only if JavaScript is enabled (MDL-9556) - $str .= ''; - } - - if ($return) { - return $str; - } - echo $str; -} - -/** - * Sets up the HTML editor on textareas in the current page. - * If a field name is provided, then it will only be - * applied to that field - otherwise it will be used - * on every textarea in the page. - * - * In most cases no arguments need to be supplied - * - * @param string $name Form element to replace with HTMl editor by name - */ -function use_html_editor($name='', $editorhidebuttons='', $id='') { - global $THEME; - - $editor = 'editor_'.md5($name); //name might contain illegal characters - if ($id === '') { - $id = 'edit-'.$name; - } - echo "\n".''."\n"; -} - -function print_editor_config($editorhidebuttons='', $return=false) { - global $CFG; - - $str = "config.pageStyle = \"body {"; - - if (!(empty($CFG->editorbackgroundcolor))) { - $str .= " background-color: $CFG->editorbackgroundcolor;"; - } - - if (!(empty($CFG->editorfontfamily))) { - $str .= " font-family: $CFG->editorfontfamily;"; - } - - if (!(empty($CFG->editorfontsize))) { - $str .= " font-size: $CFG->editorfontsize;"; - } - - $str .= " }\";\n"; - $str .= "config.killWordOnPaste = "; - $str .= (empty($CFG->editorkillword)) ? "false":"true"; - $str .= ';'."\n"; - $str .= 'config.fontname = {'."\n"; - - $fontlist = isset($CFG->editorfontlist) ? explode(';', $CFG->editorfontlist) : array(); - $i = 1; // Counter is used to get rid of the last comma. - - foreach ($fontlist as $fontline) { - if (!empty($fontline)) { - if ($i > 1) { - $str .= ','."\n"; - } - list($fontkey, $fontvalue) = split(':', $fontline); - $str .= '"'. $fontkey ."\":\t'". $fontvalue ."'"; - - $i++; - } - } - $str .= '};'; - - if (!empty($editorhidebuttons)) { - $str .= "\nconfig.hideSomeButtons(\" ". $editorhidebuttons ." \");\n"; - } else if (!empty($CFG->editorhidebuttons)) { - $str .= "\nconfig.hideSomeButtons(\" ". $CFG->editorhidebuttons ." \");\n"; - } - - if (!empty($CFG->editorspelling) && !empty($CFG->aspellpath)) { - $str .= print_speller_code($CFG->htmleditor, true); - } - - if ($return) { - return $str; - } - echo $str; -} -  /**  * Returns a turn edit on/off button for course in a self contained form.  * Used to be an icon, but it's now a simple form button Index: lib/editor/htmlarea/htmlarea.class.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/editor/htmlarea/htmlarea.class.php,v retrieving revision 1.5 diff -u -F ^f -r1.5 htmlarea.class.php --- lib/editor/htmlarea/htmlarea.class.php 2 May 2008 03:34:01 -0000 1.5 +++ lib/editor/htmlarea/htmlarea.class.php 12 May 2008 09:57:25 -0000 @@ -43,11 +43,9 @@  var $defaults = array();    /** - * PHP4 style class constructor. - *  * @param int $courseid Courseid.  */ - function htmlarea($courseid) { + function __construct($courseid) {  parent::editorObject();  $this->courseid = clean_param($courseid, PARAM_INT);   @@ -78,14 +76,6 @@  }    /** - * PHP5 style class constructor. - * @param int $courseid Course id. - */ - function __construct($courseid) { - $this->htmlarea($courseid); - } - - /**  * Check if passed configuration key is valid.  * @param string $key  * @return bool Return true if key is valid and false if it's not. Index: message/discussion.php =================================================================== RCS file: /cvsroot/moodle/moodle/message/discussion.php,v retrieving revision 1.20 diff -u -F ^f -r1.20 discussion.php --- message/discussion.php 8 May 2008 03:50:15 -0000 1.20 +++ message/discussion.php 12 May 2008 09:57:27 -0000 @@ -13,6 +13,11 @@  print_error("Messaging is disabled on this site");  }   + //if (isloggedin()) { + // $eprof = intval($USER->htmleditor); + //} else { + // $eprof = 1; + //}  /// Script parameters  $userid = required_param('id', PARAM_INT);  $noframesjs = optional_param('noframesjs', 0, PARAM_BOOL); @@ -34,8 +39,17 @@      <?php echo get_string('discussion', 'message').': '.fullname($user) ?> +usehtmleditor)) { + if (isloggedin() && in_array($USER->htmleditor, get_available_html_editors())) { + include_once($CFG->libdir ."/editor/{$USER->htmleditor}/meta.php"); + } elseif (!empty($CFG->defaulthtmleditor) and in_array($CFG->defaulthtmleditor, get_available_html_editors())) { + include_once($CFG->libdir ."/editor/{$CFG->defaulthtmleditor}/meta.php"); + } +} +?>   -  +   <body><?php  echo '<a href="discussion.php?id='.$userid.'&amp;noframesjs=1">'.get_string('noframesjs', 'message').'</a>';  ?></body> @@ -163,7 +177,7 @@  echo '
';  if ($usehtmleditor) {  print_textarea(true, 8, 34, 100, 100, 'message', $refreshedmessage); - use_html_editor('message', 'formatblock subscript superscript copy cut paste clean undo redo justifyleft justifycenter justifyright justifyfull lefttoright righttoleft insertorderedlist insertunorderedlist outdent indent inserthorizontalrule createanchor nolink inserttable'); + use_admin_editor();  echo '';  } else {  print_textarea(false, 8, 50, 0, 0, 'message', $refreshedmessage); Index: message/send.php =================================================================== RCS file: /cvsroot/moodle/moodle/message/send.php,v retrieving revision 1.27 diff -u -F ^f -r1.27 send.php --- message/send.php 8 May 2008 03:50:16 -0000 1.27 +++ message/send.php 12 May 2008 09:57:27 -0000 @@ -14,8 +14,8 @@  }    if (has_capability('moodle/site:sendmessage', get_context_instance(CONTEXT_SYSTEM))) { - - + global $USER, $CFG, $THEME; +   /// Don't use print_header, for more speed  $stylesheetshtml = '';  foreach ($CFG->stylesheets as $stylesheet) { @@ -34,6 +34,19 @@  echo "\n\n";  echo '';  echo $stylesheetshtml; + //if (isloggedin()) { + // $eprof = intval($USER->htmleditor); + //} else { + // $eprof = 1; + //} + //include_once($CFG->dirroot.'/lib/editor/'.$eprof.'/messages.php'); + if (!empty($CFG->usehtmleditor)) { + if (isloggedin() && in_array($USER->htmleditor, get_available_html_editors())) { + include_once($CFG->libdir ."/editor/{$USER->htmleditor}/meta.php"); + } elseif (!empty($CFG->defaulthtmleditor) and in_array($CFG->defaulthtmleditor, get_available_html_editors())) { + include_once($CFG->libdir ."/editor/{$CFG->defaulthtmleditor}/meta.php"); + } + }  include($CFG->javascript);    /// Script parameters @@ -105,7 +118,7 @@  print_textarea($usehtmleditor, 9, 200, 0, 0, 'message', '');  echo '';  echo ''; - use_html_editor('message', 'formatblock subscript superscript copy cut paste clean undo redo justifyleft justifycenter justifyright justifyfull lefttoright righttoleft insertorderedlist insertunorderedlist outdent indent inserthorizontalrule createanchor nolink inserttable'); + use_admin_editor();  echo '';  } else {  print_textarea(false, 5, 34, 0, 0, 'message', ''); Index: theme/standard/meta.php =================================================================== RCS file: /cvsroot/moodle/moodle/theme/standard/meta.php,v retrieving revision 1.4 diff -u -F ^f -r1.4 meta.php --- theme/standard/meta.php 20 Dec 2007 17:32:08 -0000 1.4 +++ theme/standard/meta.php 12 May 2008 09:57:28 -0000 @@ -1,3 +1,12 @@ +usehtmleditor)) { + if (isloggedin() && in_array($USER->htmleditor, get_available_html_editors())) { + include_once($CFG->libdir ."/editor/{$USER->htmleditor}/meta.php"); + } elseif (!empty($CFG->defaulthtmleditor) and in_array($CFG->defaulthtmleditor, get_available_html_editors())) { + include_once($CFG->libdir ."/editor/{$CFG->defaulthtmleditor}/meta.php"); + } +} +?>   Index: user/editlib.php =================================================================== RCS file: /cvsroot/moodle/moodle/user/editlib.php,v retrieving revision 1.17 diff -u -F ^f -r1.17 editlib.php --- user/editlib.php 26 Mar 2008 02:58:16 -0000 1.17 +++ user/editlib.php 12 May 2008 09:57:28 -0000 @@ -140,14 +140,25 @@ function useredit_shared_definition(&$mf  $mform->setAdvanced('trackforums');  }   - if ($CFG->htmleditor) { - $choices = array(); - $choices['0'] = get_string('texteditor'); - $choices['1'] = get_string('htmleditor'); - $mform->addElement('select', 'htmleditor', get_string('textediting'), $choices); - $mform->setDefault('htmleditor', 1); - $mform->setAdvanced('htmleditor'); - } + + if ($CFG->htmleditor) { + $choices = array(); + $choices['0'] = get_string('texteditor'); + $choices['1'] = get_string('htmleditor'); + $mform->addElement('select', 'htmleditor', get_string('textediting'), $choices); + $mform->setDefault('htmleditor', 1); + $mform->setAdvanced('htmleditor'); + } + +// if ($CFG->usehtmleditor) { +// $choices = array(); +// foreach(get_available_html_editors() as $editor) { +// $choices[$editor] = get_string($editor, 'admin'); +// } +// $mform->addElement('select', 'htmleditor', get_string('textediting'), $choices); +// $mform->setDefault('htmleditor', $CFG->defaulthtmleditor); +// $mform->setAdvanced('htmleditor'); +// }    if (empty($CFG->enableajax)) {  $mform->addElement('static', 'ajaxdisabled', get_string('ajaxuse'), get_string('ajaxno'));