MDL-16676 All references to the text.html and emoticons.html files need to be updated to point to text2.html and emoticons2.html

This commit is contained in:
tjhunt 2008-09-25 10:04:01 +00:00
parent a94cf79ee2
commit 16851b22ad
25 changed files with 60 additions and 34 deletions

View File

@ -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();

View File

@ -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'));

View File

@ -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);

View File

@ -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 :

View File

@ -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);

View File

@ -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

View File

@ -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'));

View File

@ -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'));

View File

@ -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'));

View File

@ -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'));

View File

@ -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));

View File

@ -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'));

View File

@ -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'));

View File

@ -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')));

View File

@ -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');

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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'));

View File

@ -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'));

View File

@ -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);

View File

@ -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'));

View File

@ -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){

View File

@ -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

View File

@ -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');