From: tjhunt Date: Thu, 25 Sep 2008 10:04:01 +0000 (+0000) Subject: MDL-16676 All references to the text.html and emoticons.html files need to be updated... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=16851b22ad816cd83cecf7876ac3ccf5dc3d0b96;p=moodle.git MDL-16676 All references to the text.html and emoticons.html files need to be updated to point to text2.html and emoticons2.html --- diff --git a/admin/user/user_message_form.php b/admin/user/user_message_form.php index 59d00d565b..b806b3a436 100644 --- a/admin/user/user_message_form.php +++ b/admin/user/user_message_form.php @@ -11,7 +11,7 @@ class user_message_form extends moodleform { $mform->addElement('textarea', 'messagebody', get_string('messagebody'), array('rows'=>15, 'cols'=>60)); $mform->addRule('messagebody', '', 'required', null, 'client'); - $mform->setHelpButton('messagebody', array('writing', 'reading', 'questions', 'richtext'), false, 'editorhelpbutton'); + $mform->setHelpButton('messagebody', array('writing', 'reading', 'questions', 'richtext2'), false, 'editorhelpbutton'); $mform->addElement('format', 'format', get_string('format')); $this->add_action_buttons(); diff --git a/blog/edit_form.php b/blog/edit_form.php index 14fdd40bdd..71b2426e24 100644 --- a/blog/edit_form.php +++ b/blog/edit_form.php @@ -20,7 +20,7 @@ class blog_edit_form extends moodleform { $mform->addElement('htmleditor', 'summary', get_string('entrybody', 'blog'), array('rows'=>25)); $mform->setType('summary', PARAM_RAW); $mform->addRule('summary', get_string('emptybody', 'blog'), 'required', null, 'client'); - $mform->setHelpButton('summary', array('writing', 'richtext'), false, 'editorhelpbutton'); + $mform->setHelpButton('summary', array('writing', 'richtext2'), false, 'editorhelpbutton'); $mform->addElement('format', 'format', get_string('format')); diff --git a/course/editcategory_form.php b/course/editcategory_form.php index 37efa02b62..73b54dbd7d 100644 --- a/course/editcategory_form.php +++ b/course/editcategory_form.php @@ -23,7 +23,7 @@ class editcategory_form extends moodleform { $themes += get_list_of_themes(); $mform->addElement('select', 'theme', get_string('forcetheme'), $themes); } - $mform->setHelpButton('description', array('writing', 'richtext'), false, 'editorhelpbutton'); + $mform->setHelpButton('description', array('writing', 'richtext2'), false, 'editorhelpbutton'); $mform->addElement('hidden', 'id', null); $mform->addElement('hidden', 'categoryadd', 0); diff --git a/lib/form/editorhelp.php b/lib/form/editorhelp.php index a4cc3b71a1..b2b0df5347 100644 --- a/lib/form/editorhelp.php +++ b/lib/form/editorhelp.php @@ -3,7 +3,7 @@ require_once('../../config.php'); $topics = array(); $titles = array(); for ($i=1; ; $i++){ - $button = optional_param("button$i", '', PARAM_ALPHAEXT); + $button = optional_param("button$i", '', PARAM_ALPHANUMEXT); if ($button){ switch ($button){ case 'reading' : @@ -16,12 +16,27 @@ for ($i=1; ; $i++){ $topics[$i] = helplink('questions', get_string('helpquestions')); break; case 'emoticons' : + debugging("You are referring to the old help file 'emoticons'. " . + "This was renamed to 'emoticons2' becuase of MDL-13233. " . + "Please update your code.", DEBUG_DEVELOPER); + // Fall through. + case 'emoticons2' : $topics[$i] = helplink('emoticons2', get_string('helpemoticons')); break; case 'richtext' : + debugging("You are referring to the old help file 'richtext'. " . + "This was renamed to 'richtext2' becuase of MDL-13233. " . + "Please update your code.", DEBUG_DEVELOPER); + // Fall through. + case 'richtext2' : $topics[$i] = helplink('richtext2', get_string('helprichtext')); break; case 'text' : + debugging("You are referring to the old help file 'text'. " . + "This was renamed to 'text2' becuase of MDL-13233. " . + "Please update your code.", DEBUG_DEVELOPER); + // Fall through. + case 'text2' : $topics[$i] = helplink('text2', get_string('helptext')); break; default : diff --git a/lib/form/htmleditor.php b/lib/form/htmleditor.php index 0eea8397de..23dfca6ffc 100644 --- a/lib/form/htmleditor.php +++ b/lib/form/htmleditor.php @@ -49,11 +49,11 @@ class MoodleQuickForm_htmleditor extends MoodleQuickForm_textarea{ if ('editorhelpbutton' == $function){ $key = array_search('richtext2', $helpbuttonargs); if ($key !== FALSE){ - array_splice($helpbuttonargs, $key, 1, array('text', 'emoticons')); + array_splice($helpbuttonargs, $key, 1, array('text2', 'emoticons2')); } } elseif ('helpbutton' == $function && $helpbuttonargs[0] == 'richtext2' && ((!isset($helpbuttonargs[2])) || $helpbuttonargs[2] == 'moodle')){ //replace single 'richtext' help button with text and emoticon button when htmleditor off. - return $this->setHelpButton(array('text', 'emoticons'), 'editorhelpbutton'); + return $this->setHelpButton(array('text2', 'emoticons2'), 'editorhelpbutton'); } } return parent::setHelpButton($helpbuttonargs, $function); diff --git a/lib/form/textarea.php b/lib/form/textarea.php index 06d3ed1a4b..3db9843b6b 100644 --- a/lib/form/textarea.php +++ b/lib/form/textarea.php @@ -29,23 +29,34 @@ class MoodleQuickForm_textarea extends HTML_QuickForm_textarea{ */ function setHelpButton($helpbuttonargs, $function='helpbutton'){ global $SESSION; - if (!is_array($helpbuttonargs)){ - $helpbuttonargs=array($helpbuttonargs); - }else{ - $helpbuttonargs=$helpbuttonargs; + if (!is_array($helpbuttonargs)) { + $helpbuttonargs = array($helpbuttonargs); + } else { + $helpbuttonargs = $helpbuttonargs; } + print_object($helpbuttonargs); // DONOTCOMMIT + debugging("'$function'", DEBUG_DEVELOPER); // DONOTCOMMIT //we do this to to return html instead of printing it //without having to specify it in every call to make a button. if ('helpbutton' == $function){ - $defaultargs=array('', '', 'moodle', true, false, '', true); - $helpbuttonargs=$helpbuttonargs + $defaultargs ; - } elseif ('editorhelpbutton' == $function){ - if (in_array('emoticons', $helpbuttonargs)){ + debugging("'tadpole'", DEBUG_DEVELOPER); // DONOTCOMMIT + $defaultargs = array('', '', 'moodle', true, false, '', true); + $helpbuttonargs = $helpbuttonargs + $defaultargs ; + if (in_array($helpbuttonargs[0], array('emoticons2', 'text2', 'richtext2'))) { + debugging("'frog'", DEBUG_DEVELOPER); // DONOTCOMMIT + $SESSION->inserttextform = $this->_formid; + $SESSION->inserttextfield = $this->getAttribute('name'); + } + } else if ('editorhelpbutton' == $function) { + debugging("'eft'", DEBUG_DEVELOPER); // DONOTCOMMIT + $specialhelp = array_intersect($helpbuttonargs, array('emoticons2', 'text2', 'richtext2')); + if (!empty($specialhelp)) { + debugging("'newt'", DEBUG_DEVELOPER); // DONOTCOMMIT $SESSION->inserttextform = $this->_formid; $SESSION->inserttextfield = $this->getAttribute('name'); } } - $this->_helpbutton=call_user_func_array($function, $helpbuttonargs); + $this->_helpbutton = call_user_func_array($function, $helpbuttonargs); } /** * get html for help button diff --git a/mod/assignment/mod_form.php b/mod/assignment/mod_form.php index 7ea56acee0..3d84e3acb9 100644 --- a/mod/assignment/mod_form.php +++ b/mod/assignment/mod_form.php @@ -41,7 +41,7 @@ class mod_assignment_mod_form extends moodleform_mod { $mform->addElement('htmleditor', 'description', get_string('description', 'assignment')); $mform->setType('description', PARAM_RAW); - $mform->setHelpButton('description', array('writing', 'questions', 'richtext'), false, 'editorhelpbutton'); + $mform->setHelpButton('description', array('writing', 'questions', 'richtext2'), false, 'editorhelpbutton'); $mform->addRule('description', get_string('required'), 'required', null, 'client'); $mform->addElement('modgrade', 'grade', get_string('grade')); diff --git a/mod/assignment/type/online/assignment.class.php b/mod/assignment/type/online/assignment.class.php index 5879abcef9..f4a3ca16cf 100644 --- a/mod/assignment/type/online/assignment.class.php +++ b/mod/assignment/type/online/assignment.class.php @@ -290,7 +290,7 @@ class mod_assignment_online_edit_form extends moodleform { // visible elements $mform->addElement('htmleditor', 'text', get_string('submission', 'assignment'), array('cols'=>60, 'rows'=>30)); $mform->setType('text', PARAM_RAW); // to be cleaned before display - $mform->setHelpButton('text', array('reading', 'writing', 'richtext'), false, 'editorhelpbutton'); + $mform->setHelpButton('text', array('reading', 'writing', 'richtext2'), false, 'editorhelpbutton'); $mform->addRule('text', get_string('required'), 'required', null, 'client'); $mform->addElement('format', 'format', get_string('format')); diff --git a/mod/chat/mod_form.php b/mod/chat/mod_form.php index 9be14b6432..be54108786 100644 --- a/mod/chat/mod_form.php +++ b/mod/chat/mod_form.php @@ -20,7 +20,7 @@ class mod_chat_mod_form extends moodleform_mod { $mform->addElement('htmleditor', 'intro', get_string('chatintro', 'chat')); $mform->setType('intro', PARAM_RAW); - $mform->setHelpButton('intro', array('writing', 'questions', 'richtext'), false, 'editorhelpbutton'); + $mform->setHelpButton('intro', array('writing', 'questions', 'richtext2'), false, 'editorhelpbutton'); $mform->addRule('intro', get_string('required'), 'required', null, 'client'); $mform->addElement('date_time_selector', 'chattime', get_string('chattime', 'chat')); diff --git a/mod/choice/mod_form.php b/mod/choice/mod_form.php index ba475073a0..16dbc68e03 100644 --- a/mod/choice/mod_form.php +++ b/mod/choice/mod_form.php @@ -22,7 +22,7 @@ class mod_choice_mod_form extends moodleform_mod { $mform->addElement('htmleditor', 'text', get_string('choicetext', 'choice')); $mform->setType('text', PARAM_RAW); $mform->addRule('text', null, 'required', null, 'client'); - $mform->setHelpButton('text', array('writing', 'questions', 'richtext'), false, 'editorhelpbutton'); + $mform->setHelpButton('text', array('writing', 'questions', 'richtext2'), false, 'editorhelpbutton'); $mform->addElement('format', 'format', get_string('format')); diff --git a/mod/data/mod_form.php b/mod/data/mod_form.php index d383eba0b5..8c20179814 100644 --- a/mod/data/mod_form.php +++ b/mod/data/mod_form.php @@ -22,7 +22,7 @@ class mod_data_mod_form extends moodleform_mod { $mform->addElement('htmleditor', 'intro', get_string('intro', 'data')); $mform->setType('intro', PARAM_RAW); $mform->addRule('intro', null, 'required', null, 'client'); - $mform->setHelpButton('intro', array('writing', 'questions', 'richtext'), false, 'editorhelpbutton'); + $mform->setHelpButton('intro', array('writing', 'questions', 'richtext2'), false, 'editorhelpbutton'); $mform->addElement('date_selector', 'timeavailablefrom', get_string('availablefromdate', 'data'), array('optional'=>true)); diff --git a/mod/forum/mod_form.php b/mod/forum/mod_form.php index 59cde393d0..cb8f21c951 100644 --- a/mod/forum/mod_form.php +++ b/mod/forum/mod_form.php @@ -30,7 +30,7 @@ class mod_forum_mod_form extends moodleform_mod { $mform->addElement('htmleditor', 'intro', get_string('forumintro', 'forum')); $mform->setType('intro', PARAM_RAW); $mform->addRule('intro', get_string('required'), 'required', null, 'client'); - $mform->setHelpButton('intro', array('writing', 'questions', 'richtext'), false, 'editorhelpbutton'); + $mform->setHelpButton('intro', array('writing', 'questions', 'richtext2'), false, 'editorhelpbutton'); $mform->addElement('format', 'format', get_string('format')); diff --git a/mod/forum/post_form.php b/mod/forum/post_form.php index d6ee1d58d0..16af6384b2 100644 --- a/mod/forum/post_form.php +++ b/mod/forum/post_form.php @@ -26,7 +26,7 @@ class mod_forum_post_form extends moodleform { $mform->addElement('htmleditor', 'message', get_string('message', 'forum'), array('cols'=>50, 'rows'=>30, 'filearea'=>'forumpost')); $mform->setType('message', PARAM_RAW); $mform->addRule('message', get_string('required'), 'required', null, 'client'); - $mform->setHelpButton('message', array('reading', 'writing', 'questions', 'richtext'), false, 'editorhelpbutton'); + $mform->setHelpButton('message', array('reading', 'writing', 'questions', 'richtext2'), false, 'editorhelpbutton'); $mform->addElement('format', 'format', get_string('format')); diff --git a/mod/glossary/comment_form.php b/mod/glossary/comment_form.php index 67579010e8..ceb21bfa68 100644 --- a/mod/glossary/comment_form.php +++ b/mod/glossary/comment_form.php @@ -10,7 +10,7 @@ class mod_glossary_comment_form extends moodleform { $mform->addElement('htmleditor', 'entrycomment',get_string('comment', 'glossary')); $mform->addRule('entrycomment', get_string('required'), 'required', null, 'client'); $mform->setType('entrycomment', PARAM_RAW); // processed by trusttext or cleaned before the display - $mform->setHelpButton('entrycomment', array('writing', 'richtext'), false, 'editorhelpbutton'); + $mform->setHelpButton('entrycomment', array('writing', 'richtext2'), false, 'editorhelpbutton'); $mform->addElement('format', 'format', get_string('format')); $mform->setHelpButton('format', array('textformat', get_string('helpformatting'))); diff --git a/mod/glossary/edit_form.php b/mod/glossary/edit_form.php index 224f5f03e2..cc9e00dc37 100644 --- a/mod/glossary/edit_form.php +++ b/mod/glossary/edit_form.php @@ -20,7 +20,7 @@ class mod_glossary_entry_form extends moodleform { $mform->addElement('htmleditor', 'definition', get_string('definition', 'glossary'), array('rows'=>20)); $mform->setType('definition', PARAM_RAW); $mform->addRule('definition', null, 'required', null, 'client'); - $mform->setHelpButton('definition', array('writing', 'richtext'), false, 'editorhelpbutton'); + $mform->setHelpButton('definition', array('writing', 'richtext2'), false, 'editorhelpbutton'); $mform->addElement('format'); diff --git a/mod/glossary/mod_form.php b/mod/glossary/mod_form.php index 2f90d15b98..69a95502ba 100644 --- a/mod/glossary/mod_form.php +++ b/mod/glossary/mod_form.php @@ -22,7 +22,7 @@ class mod_glossary_mod_form extends moodleform_mod { $mform->addElement('htmleditor', 'intro', get_string('description')); $mform->setType('intro', PARAM_RAW); $mform->addRule('intro', get_string('required'), 'required', null, 'client'); - $mform->setHelpButton('intro', array('writing', 'questions', 'text'), false, 'editorhelpbutton'); + $mform->setHelpButton('intro', array('writing', 'questions', 'text2'), false, 'editorhelpbutton'); $mform->addElement('text', 'entbypage', get_string('entbypage', 'glossary')); $mform->setDefault('entbypage', 10); diff --git a/mod/hotpot/mod_form.php b/mod/hotpot/mod_form.php index 9af7eb3699..7583d6680b 100644 --- a/mod/hotpot/mod_form.php +++ b/mod/hotpot/mod_form.php @@ -122,7 +122,7 @@ class mod_hotpot_mod_form extends moodleform_mod { $mform->addElement('hidden', 'summarysource', HOTPOT_TEXTSOURCE_SPECIFIC); $mform->addElement('htmleditor', 'summary', get_string('summary')); $mform->setType('summary', PARAM_RAW); - $mform->setHelpButton('summary', array('writing', 'questions', 'richtext'), false, 'editorhelpbutton'); + $mform->setHelpButton('summary', array('writing', 'questions', 'richtext2'), false, 'editorhelpbutton'); $mform->setAdvanced('summary'); } $mform->setType('summarysource', PARAM_INT); diff --git a/mod/label/mod_form.php b/mod/label/mod_form.php index 12f4cc6b56..a32cc1b7e9 100644 --- a/mod/label/mod_form.php +++ b/mod/label/mod_form.php @@ -10,7 +10,7 @@ class mod_label_mod_form extends moodleform_mod { $mform->addElement('htmleditor', 'content', get_string('labeltext', 'label'), array('size'=>'64')); $mform->setType('content', PARAM_RAW); $mform->addRule('content', get_string('required'), 'required', null, 'client'); - $mform->setHelpButton('content', array('questions', 'richtext'), false, 'editorhelpbutton'); + $mform->setHelpButton('content', array('questions', 'richtext2'), false, 'editorhelpbutton'); $features = array('groups'=>false, 'groupings'=>false, 'groupmembersonly'=>true, 'outcomes'=>false, 'gradecat'=>false, 'idnumber'=>false); diff --git a/mod/quiz/mod_form.php b/mod/quiz/mod_form.php index c762193290..d380a0fa2c 100644 --- a/mod/quiz/mod_form.php +++ b/mod/quiz/mod_form.php @@ -25,7 +25,7 @@ class mod_quiz_mod_form extends moodleform_mod { $mform->addElement('htmleditor', 'intro', get_string("introduction", "quiz")); $mform->setType('intro', PARAM_RAW); - $mform->setHelpButton('intro', array('richtext', get_string('helprichtext'))); + $mform->setHelpButton('intro', array('richtext2', get_string('helprichtext'))); //------------------------------------------------------------------------------- $mform->addElement('header', 'timinghdr', get_string('timing', 'form')); diff --git a/mod/resource/type/html/resource.class.php b/mod/resource/type/html/resource.class.php index be819dc064..a97e13b76e 100644 --- a/mod/resource/type/html/resource.class.php +++ b/mod/resource/type/html/resource.class.php @@ -165,7 +165,7 @@ function setup_elements(&$mform) { $mform->addElement('htmleditor', 'alltext', get_string('fulltext', 'resource'), array('cols'=>85, 'rows'=>30)); $mform->setType('alltext', PARAM_RAW); - $mform->setHelpButton('alltext', array('reading', 'writing', 'richtext'), false, 'editorhelpbutton'); + $mform->setHelpButton('alltext', array('reading', 'writing', 'richtext2'), false, 'editorhelpbutton'); $mform->addRule('alltext', get_string('required'), 'required', null, 'client'); $mform->addElement('header', 'displaysettings', get_string('display', 'resource')); diff --git a/mod/resource/type/text/resource.class.php b/mod/resource/type/text/resource.class.php index 9fed61d396..fd6fb20a55 100644 --- a/mod/resource/type/text/resource.class.php +++ b/mod/resource/type/text/resource.class.php @@ -167,7 +167,7 @@ function setup_elements(&$mform) { $mform->addElement('textarea', 'alltext', get_string('fulltext', 'resource'), array('cols'=>85, 'rows'=>30)); $mform->setType('alltext', PARAM_RAW); - $mform->setHelpButton('alltext', array('reading', 'writing', 'richtext'), false, 'editorhelpbutton'); + $mform->setHelpButton('alltext', array('reading', 'writing', 'richtext2'), false, 'editorhelpbutton'); $mform->addRule('alltext', get_string('required'), 'required', null, 'client'); $mform->addElement('format', 'reference', get_string('format'), null, false); diff --git a/mod/scorm/mod_form.php b/mod/scorm/mod_form.php index 4d1453dc6a..48a45f04a0 100644 --- a/mod/scorm/mod_form.php +++ b/mod/scorm/mod_form.php @@ -39,7 +39,7 @@ class mod_scorm_mod_form extends moodleform_mod { $mform->addElement('htmleditor', 'summary', get_string('summary')); $mform->setType('summary', PARAM_RAW); $mform->addRule('summary', get_string('required'), 'required', null, 'client'); - $mform->setHelpButton('summary', array('writing', 'questions', 'richtext'), false, 'editorhelpbutton'); + $mform->setHelpButton('summary', array('writing', 'questions', 'richtext2'), false, 'editorhelpbutton'); // Scorm types $options = array(SCORM_TYPE_LOCAL => get_string('typelocal', 'scorm')); diff --git a/mod/wiki/mod_form.php b/mod/wiki/mod_form.php index 80bebbebcf..7f2b86f06e 100644 --- a/mod/wiki/mod_form.php +++ b/mod/wiki/mod_form.php @@ -23,7 +23,7 @@ class mod_wiki_mod_form extends moodleform_mod { $mform->addElement('htmleditor', 'summary', get_string('summary')); $mform->setType('summary', PARAM_RAW); - $mform->setHelpButton('summary', array('writing', 'questions', 'richtext'), false, 'editorhelpbutton'); + $mform->setHelpButton('summary', array('writing', 'questions', 'richtext2'), false, 'editorhelpbutton'); $mform->addRule('summary', get_string('required'), 'required', null, 'client'); if (!$wikihasentries){ diff --git a/question/type/edit_question_form.php b/question/type/edit_question_form.php index 29cdf71524..b3467609c7 100644 --- a/question/type/edit_question_form.php +++ b/question/type/edit_question_form.php @@ -109,7 +109,7 @@ class question_edit_form extends moodleform { $mform->addElement('htmleditor', 'questiontext', get_string('questiontext', 'quiz'), array('rows' => 15, 'course' => $this->coursefilesid)); $mform->setType('questiontext', PARAM_RAW); - $mform->setHelpButton('questiontext', array(array('questiontext', get_string('questiontext', 'quiz'), 'quiz'), 'richtext'), false, 'editorhelpbutton'); + $mform->setHelpButton('questiontext', array(array('questiontext', get_string('questiontext', 'quiz'), 'quiz'), 'richtext2'), false, 'editorhelpbutton'); $mform->addElement('format', 'questiontextformat', get_string('format')); make_upload_directory($this->coursefilesid); // Just in case diff --git a/user/filters/text.php b/user/filters/text.php index 185d81346e..329397d000 100644 --- a/user/filters/text.php +++ b/user/filters/text.php @@ -42,7 +42,7 @@ class user_filter_text extends user_filter_type { $objs[] =& $mform->createElement('select', $this->_name.'_op', null, $this->getOperators()); $objs[] =& $mform->createElement('text', $this->_name, null); $grp =& $mform->addElement('group', $this->_name.'_grp', $this->_label, $objs, '', false); - $grp->setHelpButton(array('text',$this->_label,'filters')); + $grp->setHelpButton(array('text2',$this->_label,'filters')); $mform->disabledIf($this->_name, $this->_name.'_op', 'eq', 5); if ($this->_advanced) { $mform->setAdvanced($this->_name.'_grp');