$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();
$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'));
$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);
$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' :
$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 :
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);
*/
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
$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'));
// 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'));
$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'));
$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'));
$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));
$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'));
$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'));
$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')));
$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');
$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);
$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);
$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);
$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'));
$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'));
$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);
$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'));
$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){
$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
$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');