From: skodak <skodak>
Date: Tue, 23 Sep 2008 15:19:21 +0000 (+0000)
Subject: MDL-16626 simplified editor selection, going to change it a bit more later
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5fc9760399284ad0d74288cbbde25facc44df1e3;p=moodle.git

MDL-16626 simplified editor selection, going to change it a bit more later
---

diff --git a/admin/settings/appearance.php b/admin/settings/appearance.php
index 37123c4ac6..f856a52984 100644
--- a/admin/settings/appearance.php
+++ b/admin/settings/appearance.php
@@ -51,11 +51,8 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
 
     $temp = new admin_settingpage('htmleditorsettings', get_string('htmleditorsettings', 'admin'));
 
-    $htmleditors = array();
-    foreach (get_available_html_editors() as $editor) {
-        //$htmleditors[$editor] = get_string($editor, 'admin');
-        $htmleditors[$editor] = $editor;
-    }
+    $htmleditors = get_available_html_editors();
+
     $temp->add(new admin_setting_configselect('defaulthtmleditor', get_string('defaulthtmleditor', 'admin'), null, 'tinymce', $htmleditors));
     $temp->add(new admin_setting_configcheckbox('htmleditor', get_string('usehtmleditor', 'admin'), get_string('confightmleditor','admin'), 1));
     $temp->add(new admin_setting_emoticons());
diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index 08d8defaac..763adb302e 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -6356,27 +6356,7 @@ 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 .'.js.php')) {
-                $editors[] = $file;
-            }
-        }
-    }
-    closedir($dir);
-
-    return $editors;
+    return array('tinymce'=>'TinyMCE');
 }
 
 /**