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