]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-21217, MDL-21198 simplified/improved outputlib help icon related apis + several...
authorPetr Skoda <skodak@moodle.org>
Wed, 30 Dec 2009 15:19:55 +0000 (15:19 +0000)
committerPetr Skoda <skodak@moodle.org>
Wed, 30 Dec 2009 15:19:55 +0000 (15:19 +0000)
113 files changed:
admin/index.php
admin/lang.php
admin/mnet/mnet_review.html
admin/roles/assign.php
admin/roles/check.php
admin/roles/define.php
admin/roles/lib.php
admin/roles/manage.php
admin/roles/override.php
admin/uploadpicture.php
admin/uploaduser.php
admin/user/user_bulk_forms.php
backup/backup_form.html
backup/restore_form.html
blocks/search_forums/block_search_forums.php
blocks/tags/block_tags.php
course/editsection.php
course/import/groups/mod.php
course/lib.php
course/modedit.php
course/report/participation/index.php
enrol/authorize/config_form.php
enrol/authorize/uploadcsv.php
enrol/imsenterprise/config.html
filter/manage.php
grade/edit/tree/lib.php
lib/completionlib.php
lib/deprecatedlib.php
lib/form/advcheckbox.php
lib/form/button.php
lib/form/checkbox.php
lib/form/file.php
lib/form/filemanager.php
lib/form/filepicker.php
lib/form/format.php
lib/form/group.php
lib/form/header.php
lib/form/htmleditor.php
lib/form/modgrade.php
lib/form/password.php
lib/form/radio.php
lib/form/recaptcha.php
lib/form/select.php
lib/form/selectgroups.php
lib/form/selectwithlink.php
lib/form/static.php
lib/form/text.php
lib/form/textarea.php
lib/form/url.php
lib/form/warning.php
lib/formslib.php
lib/outputcomponents.php
lib/outputrenderers.php
lib/simpletest/testoutputlib.php
lib/tablelib.php
lib/weblib.php
login/index_form.html
message/edit.php
mod/assignment/lib.php
mod/chat/gui_header_js/chatinput.php
mod/chat/gui_sockets/chatinput.php
mod/data/edit.php
mod/data/field.php
mod/data/field/textarea/field.class.php
mod/data/lib.php
mod/data/preset.php
mod/data/templates.php
mod/feedback/analysis.php
mod/feedback/edit.php
mod/feedback/mapcourse.php
mod/feedback/show_entries.php
mod/feedback/view.php
mod/forum/lib.php
mod/forum/mod_form.php
mod/glossary/editcategories.html
mod/glossary/import.html
mod/glossary/view.php
mod/hotpot/report.php
mod/hotpot/report/fullstat/report.php
mod/lesson/import.php
mod/lesson/importppt.php
mod/lesson/locallib.php
mod/lesson/renderer.php
mod/quiz/edit.php
mod/quiz/editlib.php
mod/quiz/locallib.php
mod/quiz/report/statistics/report.php
mod/quiz/report/statistics/statistics_table.php
mod/wiki/admin.php
mod/wiki/revertpages.html
mod/wiki/view.php
question/category_class.php
question/editlib.php
question/export.php
question/export_form.php
question/import.php
question/type/calculated/questiontype.php
question/type/questiontype.php
question/type/random/questiontype.php
tag/coursetags_edit.php
tag/coursetags_more.php
user/addnote.php
user/extendenrol.php
user/filters/courserole.php
user/filters/date.php
user/filters/globalrole.php
user/filters/profilefield.php
user/filters/select.php
user/filters/text.php
user/groupaddnote.php
user/groupextendenrol.php
user/index.php
user/message.html

index 46c4bd4ab70dfb29bf43a0eb43936e6afc35ccbd..1fe7be1d1c5c854db4ea0dab60035161fbfcf2ff 100644 (file)
@@ -380,7 +380,7 @@ if (defined('WARN_DISPLAY_ERRORS_ENABLED')) {
 $lastcron = $DB->get_field_sql('SELECT MAX(lastcron) FROM {modules}');
 if (time() - $lastcron > 3600 * 24) {
     $strinstallation = get_string('installation', 'install');
-    $helpbutton = $OUTPUT->help_icon(moodle_help_icon::make('install', $strinstallation));
+    $helpbutton = $OUTPUT->help_icon('install', $strinstallation);
     echo $OUTPUT->box(get_string('cronwarning', 'admin').'&nbsp;'.$helpbutton, 'generalbox adminwarning');
 }
 
index b80df3dd60acd93b19a3b27c1e524c1ed42cf055..f1d04684c118260886081fc61ae506360d22bd45 100644 (file)
         $select->nothinglabel = $strchoosefiletoedit;
         $select->set_label($selectionlabel);
         echo $OUTPUT->select($select);
-        echo $OUTPUT->help_icon(moodle_help_icon::make('langswitchstorage', $strfilestoredinhelp));
+        echo $OUTPUT->help_icon('langswitchstorage', $strfilestoredinhelp);
         echo $OUTPUT->box_end();
 
         if ($currentfile <> '') {
         $select->nothinglabel = $strchoosefiletoedit;
         $select->set_label($selectionlabel);
         echo $OUTPUT->select($select);
-        echo $OUTPUT->help_icon(moodle_help_icon::make('langswitchstorage', $strfilestoredinhelp));
+        echo $OUTPUT->help_icon('langswitchstorage', $strfilestoredinhelp);
         echo $OUTPUT->box_end();
 
         if (!empty($currentfile)) {
             echo '<div>';
 
             if ($uselocal) {
-                $strsavetotitle = $strlanglocalpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlanglocalpackage));
-                $straltdirtitle = $strlangmasterpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlangmasterpackage));
+                $strsavetotitle = $strlanglocalpackage . $OUTPUT->help_icon('langpackages', $strlanglocalpackage);
+                $straltdirtitle = $strlangmasterpackage . $OUTPUT->help_icon('langpackages', $strlangmasterpackage);
             } else {
-                $straltdirtitle = $strlanglocalpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlanglocalpackage));
-                $strsavetotitle = $strlangmasterpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlangmasterpackage));
+                $straltdirtitle = $strlanglocalpackage . $OUTPUT->help_icon('langpackages', $strlanglocalpackage);
+                $strsavetotitle = $strlangmasterpackage . $OUTPUT->help_icon('langpackages', $strlangmasterpackage);
 
             }
 
             }
             if (is_readable($ensrc)) {
                 echo '<fieldset><legend>'.$strlangmasterenglish;
-                echo $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlangmasterenglish));
+                echo $OUTPUT->help_icon('langpackages', $strlangmasterenglish);
                 echo '</legend>';
                 echo "<div class='mdl-align'>\n<textarea rows=\"$fileeditorrows\" cols=\"$fileeditorcols\" name=\"\">";
                 echo htmlspecialchars(file_get_contents($ensrc));
index f224a1e0623c1fc89f7e0c4bba127200c78e2e4e..0ca46e3c0a41b702b6648de39da732d152d6e910 100644 (file)
@@ -32,7 +32,7 @@ if (empty($mnet_peer->public_key)) $mnet_peer->public_key = '';
     <td align="right" valign="top"><?php
         print_string('publickey', 'mnet');
         echo ': <br />';
-        echo $OUTPUT->help_icon(moodle_help_icon::make("publickey", get_string('publickey', 'mnet'), "mnet", true));
+        echo $OUTPUT->help_icon("publickey", get_string('publickey', 'mnet'), "mnet", true);
     ?></td>
 <?php
 
@@ -105,7 +105,7 @@ if (isset($mnet_peer->ip_address) && '' != $mnet_peer->ip_address){
     <tr>
         <td align="right" valign="top"><?php print_string('ipaddress', 'mnet');
         echo ': <br />';
-        echo $OUTPUT->help_icon(moodle_help_icon::make("ipaddress", get_string('ipaddress', 'mnet'), "mnet", true));
+        echo $OUTPUT->help_icon("ipaddress", get_string('ipaddress', 'mnet'), "mnet", true);
         ?>:</td>
         <td valign="top"><?php echo $mnet_peer->ip_address; ?></td>
     </tr>
index e362dc85dfe97e29d066ae35ed2cab7442d76894..33e65f7f85b86919afe080731b8b3fab097cacdb 100755 (executable)
     }
 
     /// Print heading.
-    $helpicon = new moodle_help_icon();
-    $helpicon->text = $title;
-    $helpicon->page = 'assignroles';
-    echo $OUTPUT->heading_with_help($helpicon);
+    echo $OUTPUT->heading_with_help($title, 'assignroles');
 
     if ($roleid) {
     /// Show UI for assigning a particular role to users.
               if ($hidden) { echo 'checked="checked" '; } ?>/>
               <label for="hidden" title="<?php print_string('createhiddenassign', 'role'); ?>">
                   <?php print_string('hidden', 'role'); ?>
-                  <?php echo $OUTPUT->help_icon(moodle_help_icon::make('hiddenassign', get_string('createhiddenassign', 'role'))); ?>
+                  <?php echo $OUTPUT->help_icon('hiddenassign', get_string('createhiddenassign', 'role')); ?>
               </label></p>
 
               <p><label for="extendperiod"><?php print_string('enrolperiod') ?></label><br />
index 9a7dd6e9e0cb28dcb693d39db95e4c5e15df8a59..34a0849e4accd1a146deb0dd360dfcced93102a3 100755 (executable)
     }
 
 /// Print heading.
-    $helpicon = new moodle_help_icon();
-    $helpicon->text = $title;
-    $helpicon->page = 'checkpermissions';
-    echo $OUTPUT->heading_with_help($helpicon);
+    echo $OUTPUT->heading_with_help($title, 'checkpermissions');
 
 /// If a user has been chosen, show all the permissions for this user.
     $reportuser = $userselector->get_selected_user();
index a959519df8379b960a37cba9ad76ee14f5a4ebfe..ec8c49f854df11cccf2ebbf9d9978a82706e3808 100755 (executable)
     } else if ($action == 'edit') {
         $title = get_string('editingrolex', 'role', $rolenames[$roleid]->localname);
     }
-    $helpicon = new moodle_help_icon();
-    $helpicon->text = $title;
-    $helpicon->page = 'roles';
-    echo $OUTPUT->heading_with_help($helpicon);
+    echo $OUTPUT->heading_with_help($title, 'roles');
 
 /// Work out some button labels.
     if ($action == 'add' || $action == 'duplicate') {
index 5e96bc121e9cb9a416e523c812e09f8831ee1878..171640777bfdfd97e306ed2ce22e876fc900e3c2 100644 (file)
@@ -380,7 +380,7 @@ abstract class capability_table_with_risks extends capability_table_base {
     protected function add_header_cells() {
         global $OUTPUT;
         echo '<th colspan="' . count($this->displaypermissions) . '" scope="col">' .
-                get_string('permission', 'role') . ' ' . $OUTPUT->help_icon(moodle_help_icon::make('permissions', get_string('permissions', 'role'))) . '</th>';
+                get_string('permission', 'role') . ' ' . $OUTPUT->help_icon('permissions', get_string('permissions', 'role')) . '</th>';
         echo '<th class="risk" colspan="' . count($this->allrisks) . '" scope="col">' . get_string('risks','role') . '</th>';
     }
 
index 623a503e4d646d8150bca56b4d197c8535bdd53d..e13f9320a68c145bc55a2d65dee2533d6b1803e3 100755 (executable)
     $table->wrap = array('nowrap', '', 'nowrap','nowrap');
     $table->width = '90%';
     $table->head = array(
-        get_string('role') . ' ' . $OUTPUT->help_icon(moodle_help_icon::make('roles', get_string('roles'))),
+        get_string('role') . ' ' . $OUTPUT->help_icon('roles', get_string('roles')),
         get_string('description'),
         get_string('shortname'),
         get_string('edit')
index 7d7c096ea625be75aafc149f3e402b68d67ca2be..65612c238ad5be9586860703554ce6e241db64f5 100755 (executable)
         include_once('tabs.php');
     }
 
-    $helpicon = new moodle_help_icon();
-    $helpicon->text = $title;
-    $helpicon->page = 'overrides';
-    echo $OUTPUT->heading_with_help($helpicon);
+    echo $OUTPUT->heading_with_help($title, 'overrides');
 
     if ($roleid) {
     /// Show UI for overriding roles.
index 85fe9e095d36a7000b7787b2afc40f087285c8fb..5d9e8b68239288284294c33513d19364750bdc73 100644 (file)
@@ -58,10 +58,7 @@ $overwritepicture = optional_param('overwritepicture', 0, PARAM_BOOL);
 /// Print the header
 admin_externalpage_print_header();
 
-$helpicon = new moodle_help_icon();
-$helpicon->text = $struploadpictures;
-$helpicon->page = 'uploadpictures';
-echo $OUTPUT->heading_with_help($helpicon);
+echo $OUTPUT->heading_with_help($struploadpictures, 'uploadpictures');
 
 $mform = new admin_uploadpicture_form(null, $userfields);
 if ($formdata = $mform->get_data()) {
index 10efcb57d652b9a00dd28a3d0fddfad6fd56b3b8..b8dce1997b17f05f3df5c5c21e1e562655e1c221 100755 (executable)
@@ -107,10 +107,7 @@ if (empty($iid)) {
     } else {
         admin_externalpage_print_header();
 
-        $helpicon = new moodle_help_icon();
-        $helpicon->text = get_string('uploadusers');
-        $helpicon->page = 'uploadusers3';
-        echo $OUTPUT->heading_with_help($helpicon);
+        echo $OUTPUT->heading_with_help(get_string('uploadusers'), 'uploadusers3');
 
         $mform->display();
         echo $OUTPUT->footer();
@@ -749,10 +746,7 @@ admin_externalpage_print_header();
 
 /// Print the form
 
-$helpicon = new moodle_help_icon();
-$helpicon->text = get_string('uploaduserspreview', 'admin');
-$helpicon->page = 'uploadusers2';
-echo $OUTPUT->heading_with_help($helpicon);
+echo $OUTPUT->heading_with_help(get_string('uploaduserspreview', 'admin'), 'uploadusers2');
 
 $ci = 0;
 $ri = 0;
index 6bce8cce47c825958b635ca8ba6fbc41aa50157b..1d3556aa54b34999cd198d9fd807ddf1a5ee9861 100644 (file)
@@ -94,7 +94,7 @@ class user_bulk_form extends moodleform {
 
 
         $grp =& $mform->addElement('group', 'usersgrp', get_string('users'), $objs, ' ', false);
-        $grp->setHelpButton(array('lists', get_string('users'), 'bulkusers'));
+        $mform->setHelpButton('usersgrp', array('lists', get_string('users'), 'bulkusers'));
 
         $mform->addElement('static', 'comment');
 
@@ -104,7 +104,7 @@ class user_bulk_form extends moodleform {
         $objs[] =& $mform->createElement('submit', 'addall', get_string('addall', 'bulkusers'));
         $objs[] =& $mform->createElement('submit', 'removeall', get_string('removeall', 'bulkusers'));
         $grp =& $mform->addElement('group', 'buttonsgrp', get_string('selectedlist', 'bulkusers'), $objs, array(' ', '<br />'), false);
-        $grp->setHelpButton(array('selectedlist', get_string('selectedlist', 'bulkusers'), 'bulkusers'));
+        $mform->setHelpButton('buttonsgrp', array('selectedlist', get_string('selectedlist', 'bulkusers'), 'bulkusers'));
 
         $renderer =& $mform->defaultRenderer();
         $template = '<label class="qflabel" style="vertical-align:top">{label}</label> {element}';
index 1b21f6c3b0ef3a737ddcc8373d50333478d8688d..64583f866c9a314833d11c1087f958e43acf363d 100644 (file)
@@ -281,7 +281,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
             echo "<tr>";
             echo "<td align=\"right\" colspan=\"2\"><b>";
             echo '<label for="menubackup_site_files">'.get_string ("sitefilesused").'</label>';
-            echo $OUTPUT->help_icon(moodle_help_icon::make('sitefilesused', get_string('sitefilesused')));
+            echo $OUTPUT->help_icon('sitefilesused', get_string('sitefilesused'));
             echo "</b></td><td colspan=\"2\">";
             $course_file_options[0] = get_string("no");
             $course_file_options[1] = get_string("yes");
index ed0c9eda2559641dd6e90b6a360e8efb911f13b6..443886cb11d45de54cb21d6c65c556344dd31029 100644 (file)
@@ -269,7 +269,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
         echo '<label for="shortnamefield">'.get_string ('shortname').'</label>';
         echo "</td>";
         echo "<td><input type=\"text\" id=\"shortnamefield\" name=\"shortname\" maxlength=\"100\"  size=\"20\" value=\"".s($form1->shortname)."\" alt=\"".get_string("shortname")."\"  />" ;
-        echo $OUTPUT->help_icon(moodle_help_icon::make("courseshortname", get_string("shortname"))) ;
+        echo $OUTPUT->help_icon("courseshortname", get_string("shortname"));
         if (isset($err["shortname"])) echo $OUTPUT->error_text($err["shortname"]);
         echo "</td>";
         echo "</tr>";
@@ -278,7 +278,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
         echo '<label for="fullnamefield">'.get_string ('fullname').'</label>';
         echo "</td>";
         echo "<td><input type=\"text\" id=\"fullnamefield\" name=\"fullname\" maxlength=\"254\" size=\"50\" value=\"".s($form1->fullname)."\" alt=\" ".get_string("fullname")."\"  />" ;
-        echo $OUTPUT->help_icon(moodle_help_icon::make("coursefullname", get_string("fullname"))) ;
+        echo $OUTPUT->help_icon("coursefullname", get_string("fullname"));
         if (isset($err["fullname"])) echo $OUTPUT->error_text($err["fullname"]);
         echo"</td></tr>";
     } else {
@@ -303,7 +303,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
             $yearselector = html_select::make_time_selector('years', "startyear", $form1->startdate);
 
             echo $OUTPUT->select($dayselector) . $OUTPUT->select($monthselector) . $OUTPUT->select($yearselector);
-            echo $OUTPUT->help_icon(moodle_help_icon::make("coursestartdate", get_string("startdate")));
+            echo $OUTPUT->help_icon("coursestartdate", get_string("startdate"));
         } else {
             print_string('notavailable');
             echo '<input type="hidden" name="startyear" value="0" />';
@@ -463,7 +463,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
         //Now print the Groups tr (assume there is no $info->backup_groups)
         echo "<tr>";
         echo "<td align=\"right\" colspan=\"2\"><b>";
-        $helplink = $OUTPUT->help_icon(moodle_help_icon::make('grouprestore', get_string('groups')));
+        $helplink = $OUTPUT->help_icon('grouprestore', get_string('groups'));
         echo '<label for="menurestore_groups">'.get_string ("groups").'</label>'.$helplink;
         echo "</b></td><td colspan=\"2\">";
         if (empty($CFG->enablegroupings)) {
index 0d5f618c0cadc4e3827f725c87f87af2d12111f7..be18bc5739ed8a0a654021acc4e39e347f1479eb 100644 (file)
@@ -36,7 +36,7 @@ class block_search_forums extends block_base {
                                 '<input id="searchform_search" name="search" type="text" size="16" />';
         $this->content->text .= '<button id="searchform_button" type="submit" title="'.$search.'">'.$button.'</button><br />';
         $this->content->text .= '<a href="'.$CFG->wwwroot.'/mod/forum/search.php?id='.$this->page->course->id.'">'.$advancedsearch.'</a>';
-        $this->content->text .= $OUTPUT->help_icon(moodle_help_icon::make('search', $advancedsearch));
+        $this->content->text .= $OUTPUT->help_icon('search', $advancedsearch);
         $this->content->text .= '</fieldset></form></div>';
 
         return $this->content;
index 2211e142d57bf09c6588f1bdd1fd741ca7029669..8421d1401dad367607d3be0a031b5621f1ac5de3 100644 (file)
@@ -232,7 +232,7 @@ class block_tags extends block_base {
                     $tagthisunit = get_string('tagthisunit', $tagslang);
                     $buttonadd = get_string('add', $tagslang);
                     $arrowtitle = get_string('arrowtitle', $tagslang);
-                    $coursetaghelpbutton = $OUTPUT->help_icon(moodle_help_icon::make('addtags', 'adding tags', $tagslang));
+                    $coursetaghelpbutton = $OUTPUT->help_icon('addtags', 'adding tags', $tagslang);
                     $sesskey = sesskey();
                     $arrowright = $OUTPUT->pix_url('t/arrow_left');
                     $this->content->footer .= <<<EOT
index 9b2c2a334f4db98ed8dbbcadd598e9ba32e914f0..4ad92ca4720724cbdbe2a2bab32ec8d746f85c53 100644 (file)
@@ -79,10 +79,7 @@ $PAGE->navbar->add($stredit);
 $PAGE->set_focuscontrol('theform.summary');
 echo $OUTPUT->header();
 
-$helpicon = new moodle_help_icon();
-$helpicon->text = $strsummaryof;
-$helpicon->page = 'summaries';
-echo $OUTPUT->heading_with_help($helpicon);
+echo $OUTPUT->heading_with_help($strsummaryof, 'summaries');
 
 $mform->display();
 echo $OUTPUT->footer();
\ No newline at end of file
index b264515c26447bdf9b6c6bd07ce8157f3d38617d..c80afd21d7dfaaef249601ebc48b35a6cbc61c3a 100644 (file)
@@ -35,10 +35,7 @@ $strusers = get_string("users");
 $strusersnew = get_string("usersnew");
 $strimportgroups = get_string("importgroups");
 
-$helpicon = new moodle_help_icon();
-$helpicon->text = $strimportgroups;
-$helpicon->page = 'uploadgroups';
-echo $OUTPUT->heading_with_help($helpicon);
+echo $OUTPUT->heading_with_help($strimportgroups, 'uploadgroups');
 
 $maxuploadsize = get_max_upload_file_size();
 echo '<p align="center">';
index f680d82a909602c93c348aa889ed4ff40215bfac..9c260cea5f10e01f251c06466ee964d1b973ca4f 100644 (file)
@@ -3026,7 +3026,7 @@ function print_groupmode_setting($form, $course=NULL) {
         $select = html_select::make($choices, 'groupmode', $groupmode, false);
         $select->disabled = $course->groupmodeforce;
         echo $OUTPUT->select($select);
-        echo $OUTPUT->help_icon(moodle_help_icon::make('groupmode', get_string('groupmode')));
+        echo $OUTPUT->help_icon('groupmode', get_string('groupmode'));
         echo '</td></tr>';
     }
 }
index 3a25584ae96da2023ab8272eb5f7a3fc567916d5..da5620e8f5d6843f69bffc3f4dfe2345365a351c 100644 (file)
             require($CFG->dirroot.'/'.$CFG->admin.'/roles/tabs.php');
         }
 
-        $helpicon = new moodle_help_icon();
-        $helpicon->page = 'mods';
-        $helpicon->text = $pageheading;
-        $helpicon->module = $module->name;
-        echo $OUTPUT->heading_with_help($helpicon, $OUTPUT->pix_url('icon', $module->name));
+        echo $OUTPUT->heading_with_help($pageheading, 'mods', $module->name, 'icon');
 
         $mform->display();
 
index 6395dc53a1dc77e76185a744b4d2968bd088a17d..62c7311cd8005f115ae14492c8b9475547e40905 100644 (file)
     echo $OUTPUT->select(html_select::make($roleoptions,'roleid',$roleid,false));
     echo '<label for="menuaction">'.get_string('showactions').'</label>'."\n";
     echo $OUTPUT->select(html_select::make($actionoptions,'action',$action,false));
-    echo $OUTPUT->help_icon(moodle_help_icon::make('participationreport',get_string('participationreport')));
+    echo $OUTPUT->help_icon('participationreport', get_string('participationreport'));
     echo '<input type="submit" value="'.get_string('go').'" />'."\n</div></form>\n";
 
     $baseurl =  $CFG->wwwroot.'/course/report/participation/index.php?id='.$course->id.'&amp;roleid='
         $select->label = get_string("withselectedusers");
         $select->add_action('change', 'conditionalsubmit', array('formid' => 'studentsform'));
         echo $OUTPUT->select($select);
-        echo $OUTPUT->help_icon(moodle_help_icon::make("participantswithselectedusers", get_string("withselectedusers")));
+        echo $OUTPUT->help_icon("participantswithselectedusers", get_string("withselectedusers"));
         echo '<input type="submit" value="' . get_string('ok') . '" />'."\n";
         echo '</div>'."\n";
         echo '</form>'."\n";
index 26d6bc7e2db334cfacfe6e2c326b62ef02d578c6..a7d4466ac6d95502c836f5a6c9a8dcbfd5c29085 100755 (executable)
@@ -131,7 +131,7 @@ if (!isset($frm->acceptechecktypes)) {
 <tr valign="top">
     <td align="right">an_authcode:</td>
     <td><?php echo $OUTPUT->checkbox(html_select_option::make_checkbox('1', !empty($frm->an_authcode), get_string("adminauthcode", "enrol_authorize")), 'an_authcode');  ?>
-        <?php echo $OUTPUT->help_icon(moodle_help_icon::make('authorize/authcode', 'authcode', 'enrol')); ?><br />
+        <?php echo $OUTPUT->help_icon('authorize/authcode', 'authcode', 'enrol'); ?><br />
     </td>
 </tr>
 
@@ -177,20 +177,20 @@ if (!isset($frm->acceptechecktypes)) {
 </tr>
 
 <tr valign="top"><td colspan="2"><h4><?php print_string("adminauthorizeccapture", "enrol_authorize") ?>
-                                     <?php echo $OUTPUT->help_icon(moodle_help_icon::make('authorize/orderreview', 'orderreview', 'enrol')); ?>
+                                     <?php echo $OUTPUT->help_icon('authorize/orderreview', 'orderreview', 'enrol'); ?>
                                  </h4></td></tr>
 
 <tr valign="top">
     <td align="right">an_review:</td>
     <td><?php echo $OUTPUT->checkbox(html_select_option::make_checkbox('1', !empty($frm->an_review), get_string("adminreview", "enrol_authorize")), 'an_review'); ?>
-        <?php echo $OUTPUT->help_icon(moodle_help_icon::make('authorize/review', get_string('adminhelpreviewtitle', 'enrol_authorize'), 'enrol')); ?><br />
+        <?php echo $OUTPUT->help_icon('authorize/review', get_string('adminhelpreviewtitle', 'enrol_authorize'), 'enrol'); ?><br />
     </td>
 </tr>
 
 <tr valign="top">
     <td align="right">an_capture_day:</td>
     <td><input type="text" name="an_capture_day" size="2" maxlength="2" value="<?php p($frm->an_capture_day) ?>" />
-        <?php echo $OUTPUT->help_icon(moodle_help_icon::make('authorize/captureday', get_string('adminhelpcapturetitle', 'enrol_authorize'), 'enrol')); ?><br />
+        <?php echo $OUTPUT->help_icon('authorize/captureday', get_string('adminhelpcapturetitle', 'enrol_authorize'), 'enrol'); ?><br />
         <?php print_string("reviewday", "enrol_authorize", $frm->an_capture_day) ?></td>
 </tr>
 
index 417f463d781890ce957d9cb0a0dd11a3756544ca..845ef8d4b7d230c1a9e0ce7fec5d0f6056045d74 100644 (file)
     $PAGE->set_button($managebutton);
     echo $OUTPUT->header();
 
-    $helpicon = new moodle_help_icon();
-    $helpicon->text = $struploadcsv;
-    $helpicon->page = 'authorize/uploadcsv';
-    $helpicon->module = 'enrol';
-    echo $OUTPUT->heading_with_help($helpicon);
+    echo $OUTPUT->heading_with_help($struploadcsv, 'authorize/uploadcsv', 'enrol');
 
 /// Handle CSV file
     if (($form = data_submitted()) && confirm_sesskey()) {
index c0fc8461081e42e1b145db6188c30736039dc4fa..40275ba1defacab6617e1acb8c723db41c379bd9 100644 (file)
@@ -38,7 +38,7 @@
         <input type="checkbox" value="1" name="enrol_createnewusers" <?php if ($frm->enrol_createnewusers) echo "checked=\"checked\"" ?> />
     </td>
     <td>
-    <?php echo $OUTPUT->help_icon(moodle_help_icon::make('createnewusers', 'More detail about this option', 'enrol/imsenterprise')); ?>
+    <?php echo $OUTPUT->help_icon('createnewusers', 'More detail about this option', 'enrol/imsenterprise'); ?>
     </td>
 </tr>
 
@@ -48,7 +48,7 @@
         <input type="checkbox" value="1" name="enrol_imsdeleteusers" <?php if ($frm->enrol_imsdeleteusers) echo "checked=\"checked\"" ?> />
     </td>
     <td>
-    <?php echo $OUTPUT->help_icon(moodle_help_icon::make('deleteusers', 'More detail about this option', 'enrol/imsenterprise')); ?>
+    <?php echo $OUTPUT->help_icon('deleteusers', 'More detail about this option', 'enrol/imsenterprise'); ?>
     </td>
 </tr>
 
@@ -78,7 +78,7 @@
         <input type="checkbox" value="1" name="enrol_imssourcedidfallback" <?php if ($frm->enrol_imssourcedidfallback) echo "checked=\"checked\"" ?> />
     </td>
     <td>
-    <?php echo $OUTPUT->help_icon(moodle_help_icon::make('sourceddidfallback', 'More detail about this option', 'enrol/imsenterprise')); ?>
+    <?php echo $OUTPUT->help_icon('sourceddidfallback', 'More detail about this option', 'enrol/imsenterprise'); ?>
     </td>
 </tr>
 <!--
@@ -138,7 +138,7 @@ foreach($this->imsroles as $imsrolenum=>$imsrolename){
         <input type="text" <?php echo 'value="'.intval($frm->enrol_truncatecoursecodes).'"' ?> name="enrol_truncatecoursecodes" size="3" maxlength="3" />
     </td>
     <td>
-    <?php echo $OUTPUT->help_icon(moodle_help_icon::make('truncatecoursecodes', 'More detail about this option', 'enrol/imsenterprise')); ?>
+    <?php echo $OUTPUT->help_icon('truncatecoursecodes', 'More detail about this option', 'enrol/imsenterprise'); ?>
     </td>
 </tr>
 
@@ -148,7 +148,7 @@ foreach($this->imsroles as $imsrolenum=>$imsrolename){
         <input type="checkbox" value="1" name="enrol_createnewcourses" <?php if ($frm->enrol_createnewcourses) echo "checked=\"checked\"" ?> />
     </td>
     <td>
-    <?php echo $OUTPUT->help_icon(moodle_help_icon::make('createnewcourses', 'More detail about this option', 'enrol/imsenterprise')); ?>
+    <?php echo $OUTPUT->help_icon('createnewcourses', 'More detail about this option', 'enrol/imsenterprise'); ?>
     </td>
 </tr>
 
@@ -158,7 +158,7 @@ foreach($this->imsroles as $imsrolenum=>$imsrolename){
         <input type="checkbox" value="1" name="enrol_createnewcategories" <?php if ($frm->enrol_createnewcategories) echo "checked=\"checked\"" ?> />
     </td>
     <td>
-    <?php echo $OUTPUT->help_icon(moodle_help_icon::make('categorisation', 'More detail about this option', 'enrol/imsenterprise')); ?>
+    <?php echo $OUTPUT->help_icon('categorisation', 'More detail about this option', 'enrol/imsenterprise'); ?>
     </td>
 </tr>
 
@@ -168,7 +168,7 @@ foreach($this->imsroles as $imsrolenum=>$imsrolename){
         <input type="checkbox" value="1" name="enrol_imsunenrol" <?php if ($frm->enrol_imsunenrol) echo "checked=\"checked\"" ?> />
     </td>
     <td>
-    <?php echo $OUTPUT->help_icon(moodle_help_icon::make('unenrol', 'More detail about this option', 'enrol/imsenterprise')); ?>
+    <?php echo $OUTPUT->help_icon('unenrol', 'More detail about this option', 'enrol/imsenterprise'); ?>
     </td>
 </tr>
 
@@ -180,7 +180,7 @@ foreach($this->imsroles as $imsrolenum=>$imsrolename){
     <td align="right"><?php  print_string('restricttarget', 'enrol_imsenterprise') ?>:</td>
     <td colspan="2">
         <input type="text" <?php echo 'value="'.htmlspecialchars($frm->enrol_imsrestricttarget).'"' ?> name="enrol_imsrestricttarget" size="20" maxlength="32" />
-    <?php echo $OUTPUT->help_icon(moodle_help_icon::make('target', 'More detail about this option', 'enrol/imsenterprise')); ?>
+    <?php echo $OUTPUT->help_icon('target', 'More detail about this option', 'enrol/imsenterprise'); ?>
     </td>
 </tr>
 
@@ -190,7 +190,7 @@ foreach($this->imsroles as $imsrolenum=>$imsrolename){
         <input type="checkbox" value="1" name="enrol_imscapitafix" <?php if ($frm->enrol_imscapitafix) echo "checked=\"checked\"" ?> />
     </td>
     <td>
-    <?php echo $OUTPUT->help_icon(moodle_help_icon::make('capita', 'More detail about this option', 'enrol/imsenterprise')); ?>
+    <?php echo $OUTPUT->help_icon('capita', 'More detail about this option', 'enrol/imsenterprise'); ?>
     </td>
 </tr>
 
index 3c48533dcc8c4ae558dee266149abae9d3af111e..e134881a85a03097c4599c82e4174ece5a4319d7 100644 (file)
@@ -125,10 +125,7 @@ if ($context->contextlevel == CONTEXT_COURSE and $context->instanceid == SITEID)
 }
 
 /// Print heading.
-$helpicon = new moodle_help_icon();
-$helpicon->text = $title;
-$helpicon->page = 'localfiltersettings';
-echo $OUTPUT->heading_with_help($helpicon);
+echo $OUTPUT->heading_with_help($title, 'localfiltersettings');
 
 if (empty($availablefilters)) {
     echo '<p class="centerpara">' . get_string('nofiltersenabled', 'filters') . "</p>\n";
index e25c0a9bdbf808af6db4050fb7365729e6336012..0ad6c417d51167ffcffc73580984b0fbc4ee7031 100755 (executable)
@@ -649,7 +649,7 @@ class grade_edit_tree_column_aggregation extends grade_edit_tree_column_category
     public function get_header_cell() {
         global $OUTPUT;
         $headercell = clone($this->headercell);
-        $headercell->text = get_string('aggregation', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('aggregation', 'aggregation', 'grade'));
+        $headercell->text = get_string('aggregation', 'grades').$OUTPUT->help_icon('aggregation', 'aggregation', 'grade');
         return $headercell;
     }
 
@@ -706,7 +706,7 @@ class grade_edit_tree_column_extracredit extends grade_edit_tree_column {
     public function get_header_cell() {
         global $OUTPUT;
         $headercell = clone($this->headercell);
-        $headercell->text = get_string('extracredit', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('aggregationcoefcombo', 'aggregationcoefcombo', 'grade'));
+        $headercell->text = get_string('extracredit', 'grades').$OUTPUT->help_icon('aggregationcoefcombo', 'aggregationcoefcombo', 'grade');
         return $headercell;
     }
 
@@ -748,7 +748,7 @@ class grade_edit_tree_column_weight extends grade_edit_tree_column {
     public function get_header_cell() {
         global $OUTPUT;
         $headercell = clone($this->headercell);
-        $headercell->text = get_string('weightuc', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('aggregationcoefweight', 'aggregationcoefweight', 'grade'));
+        $headercell->text = get_string('weightuc', 'grades').$OUTPUT->help_icon('aggregationcoefweight', 'aggregationcoefweight', 'grade');
         return $headercell;
     }
 
@@ -846,7 +846,7 @@ class grade_edit_tree_column_aggregateonlygraded extends grade_edit_tree_column_
         $headercell = clone($this->headercell);
         $headercell->style .= 'width: 40px;';
         $headercell->text = get_string('aggregateonlygraded', 'grades')
-                . $OUTPUT->help_icon(moodle_help_icon::make('aggregateonlygraded', 'aggregateonlygraded', 'grade'));
+                . $OUTPUT->help_icon('aggregateonlygraded', 'aggregateonlygraded', 'grade');
         return $headercell;
     }
 
@@ -892,7 +892,7 @@ class grade_edit_tree_column_aggregatesubcats extends grade_edit_tree_column_cat
         $headercell = clone($this->headercell);
         $headercell->style .= 'width: 40px;';
         $headercell->text = get_string('aggregatesubcats', 'grades')
-              .$OUTPUT->help_icon(moodle_help_icon::make('aggregatesubcats', 'aggregatesubcats', 'grade'));
+              .$OUTPUT->help_icon('aggregatesubcats', 'aggregatesubcats', 'grade');
         return $headercell;
     }
 
@@ -938,7 +938,7 @@ class grade_edit_tree_column_aggregateoutcomes extends grade_edit_tree_column_ca
         $headercell = clone($this->headercell);
         $headercell->style .= 'width: 40px;';
         $headercell->text = get_string('aggregateoutcomes', 'grades')
-              .$OUTPUT->help_icon(moodle_help_icon::make('aggregateoutcomes', 'aggregateoutcomes', 'grade'));
+              .$OUTPUT->help_icon('aggregateoutcomes', 'aggregateoutcomes', 'grade');
         return $headercell;
     }
 
@@ -990,7 +990,7 @@ class grade_edit_tree_column_droplow extends grade_edit_tree_column_category {
     public function get_header_cell() {
         global $OUTPUT;
         $headercell = clone($this->headercell);
-        $headercell->text = get_string('droplow', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('droplow', 'droplow', 'grade'));
+        $headercell->text = get_string('droplow', 'grades').$OUTPUT->help_icon('droplow', 'droplow', 'grade');
         return $headercell;
     }
 
@@ -1026,7 +1026,7 @@ class grade_edit_tree_column_keephigh extends grade_edit_tree_column_category {
     public function get_header_cell() {
         global $OUTPUT;
         $headercell = clone($this->headercell);
-        $headercell->text = get_string('keephigh', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('keephigh', 'keephigh', 'grade'));
+        $headercell->text = get_string('keephigh', 'grades').$OUTPUT->help_icon('keephigh', 'keephigh', 'grade');
         return $headercell;
     }
 
@@ -1062,7 +1062,7 @@ class grade_edit_tree_column_multfactor extends grade_edit_tree_column {
     public function get_header_cell() {
         global $OUTPUT;
         $headercell = clone($this->headercell);
-        $headercell->text = get_string('multfactor', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('multfactor', 'multfactor', 'grade'));
+        $headercell->text = get_string('multfactor', 'grades').$OUTPUT->help_icon('multfactor', 'multfactor', 'grade');
         return $headercell;
     }
 
@@ -1104,7 +1104,7 @@ class grade_edit_tree_column_plusfactor extends grade_edit_tree_column {
     public function get_header_cell() {
         global $OUTPUT;
         $headercell = clone($this->headercell);
-        $headercell->text = get_string('plusfactor', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('plusfactor', 'plusfactor', 'grade'));
+        $headercell->text = get_string('plusfactor', 'grades').$OUTPUT->help_icon('plusfactor', 'plusfactor', 'grade');
         return $headercell;
     }
 
index 7b429a12ffaf24d5996eab998fffb72b56f2430c..349d0df12f6713e313484c99b8951499d2e6187b 100644 (file)
@@ -169,7 +169,7 @@ class completion_info {
         global $PAGE, $OUTPUT;
         if ($this->is_enabled() && !$PAGE->user_is_editing() && isloggedin() && !isguestuser()) {
             echo '<span id = "completionprogressid" class="completionprogress">'.get_string('yourprogress','completion').' ';
-            echo $OUTPUT->help_icon(moodle_help_icon::make('completionicons',get_string('completionicons','completion'),'completion'));
+            echo $OUTPUT->help_icon('completionicons',get_string('completionicons','completion'),'completion');
             echo '</span>';
         }
     }
index 675a94fbb85b4decd9cb3d14315f1bb2bab7feda..dbdbdee1a973cb7adaaf22e3196b22f9a710b4a6 100644 (file)
@@ -2443,54 +2443,10 @@ function print_table($table, $return=false) {
  * @param string $class class added to the element
  * @return string html code to display a link to a popup window.
  */
-function link_to_popup_window ($url, $name=null, $linkname=null,
-                               $height=400, $width=500, $title=null,
-                               $options=null, $return=false) {
-    global $OUTPUT;
-
-    debugging('link_to_popup_window() has been deprecated. Please change your code to use $OUTPUT->link().');
-
-    if ($options == 'none') {
-        $options = null;
-    }
-
-    if (empty($linkname)) {
-        throw new coding_exception('A link must have a descriptive text value! See $OUTPUT->link_to_popup() for usage.');
-    }
-
-    // Create a html_link object
-    $link = html_link::make($url, $linkname);
-    $link->title = $title;
-
-    // Parse the $options string
-    $popupparams = array();
-    if (!empty($options)) {
-        $optionsarray = explode(',', $options);
-        foreach ($optionsarray as $option) {
-            if (strstr($option, '=')) {
-                $parts = explode('=', $option);
-                if ($parts[1] == '0') {
-                    $popupparams[$parts[0]] = false;
-                } else {
-                    $popupparams[$parts[0]] = $parts[1];
-                }
-            } else {
-                $popupparams[$option] = true;
-            }
-        }
-    }
-
-    $popupaction = new popup_action('click', $url, $name, $popupparams);
-    $link->add_action($popupaction);
-
-    // Call the output method
-    $output = $OUTPUT->link($link);
+function link_to_popup_window ($url, $name=null, $linkname=null, $height=400, $width=500, $title=null, $options=null, $return=false) {
+    debugging('link_to_popup_window() has been removed. Please change your code to use $OUTPUT->link(). Please note popups are discouraged for accessibility reasons');
 
-    if ($return) {
-        return $output;
-    } else {
-        echo $output;
-    }
+    return $OUTPUT->link($url, $name);
 }
 
 /**
@@ -2523,7 +2479,7 @@ function button_to_popup_window ($url, $name=null, $linkname=null,
     }
 
     if (empty($linkname)) {
-        throw new coding_exception('A link must have a descriptive text value! See $OUTPUT->link_to_popup() for usage.');
+        throw new coding_exception('A link must have a descriptive text value! See $OUTPUT->link() for usage.');
     }
 
     // Create a html_button object
@@ -2796,36 +2752,132 @@ function helpbutton($page, $title, $module='moodle', $image=true, $linktext=fals
 
     global $OUTPUT;
 
-    if (!empty($text)) {
-        throw new coding_exception('The $text parameter has been deprecated. Please update your code and use $OUTPUT->help_icon() instead. <br />' .
-            "You will also need to copy the following text into a proper html help file if not already done so: <p>$text</p>");
-    }
-
-    if (!empty($imagetext)) {
-        throw new coding_exception('The $imagetext parameter has been deprecated. Please update your code and use $OUTPUT->help_icon() instead.');
-    }
-
-    $helpicon = new moodle_help_icon();
-    $helpicon->page = $page;
-    $helpicon->text = $title;
-    $helpicon->module = $module;
-    $helpicon->linktext = $linktext;
+    $output = $OUTPUT->help_icon($page, $title, $module, $linktext);
 
-    // If image is true, the defaults are handled by the helpicon's prepare method
-    if (!$image) {
-        $helpicon->image = false;
-    }
-
-    $output = $OUTPUT->help_icon($helpicon);
+    // hide image with CSS if needed
 
     if ($return) {
         return $output;
     } else {
         echo $output;
     }
+}
+
+/**
+ * Print a help button.
+ *
+ * Prints a special help button that is a link to the "live" emoticon popup
+ *
+ * @todo Finish documenting this function
+ *
+ * @global object
+ * @global object
+ * @param string $form ?
+ * @param string $field ?
+ * @param boolean $return If true then the output is returned as a string, if false it is printed to the current page.
+ * @return string|void Depending on value of $return
+ */
+function emoticonhelpbutton($form, $field, $return = false) {
+    /// TODO: MDL-21215
+
+    debugging('emoticonhelpbutton() was removed, new text editors will implement this feature');
+}
+
+/**
+ * Returns a string of html with an image of a help icon linked to a help page on a number of help topics.
+ * Should be used only with htmleditor or textarea.
+ *
+ * @global object
+ * @global object
+ * @param mixed $helptopics variable amount of params accepted. Each param may be a string or an array of arguments for
+ *                  helpbutton.
+ * @return string Link to help button
+ */
+function editorhelpbutton(){
+    return '';
+
+    /// TODO: MDL-21215
+
+    global $CFG, $SESSION, $OUTPUT;
+    $items = func_get_args();
+    $i = 1;
+    $urlparams = array();
+    $titles = array();
+    foreach ($items as $item){
+        if (is_array($item)){
+            $urlparams[] = "keyword$i=".urlencode($item[0]);
+            $urlparams[] = "title$i=".urlencode($item[1]);
+            if (isset($item[2])){
+                $urlparams[] = "module$i=".urlencode($item[2]);
+            }
+            $titles[] = trim($item[1], ". \t");
+        } else if (is_string($item)) {
+            $urlparams[] = "button$i=".urlencode($item);
+            switch ($item) {
+                case 'reading' :
+                    $titles[] = get_string("helpreading");
+                    break;
+                case 'writing' :
+                    $titles[] = get_string("helpwriting");
+                    break;
+                case 'questions' :
+                    $titles[] = get_string("helpquestions");
+                    break;
+                case 'emoticons2' :
+                    $titles[] = get_string("helpemoticons");
+                    break;
+                case 'richtext2' :
+                    $titles[] = get_string('helprichtext');
+                    break;
+                case 'text2' :
+                    $titles[] = get_string('helptext');
+                    break;
+                default :
+                    print_error('unknownhelp', '', '', $item);
+            }
+        }
+        $i++;
+    }
+    if (count($titles)>1){
+        //join last two items with an 'and'
+        $a = new object();
+        $a->one = $titles[count($titles) - 2];
+        $a->two = $titles[count($titles) - 1];
+        $titles[count($titles) - 2] = get_string('and', '', $a);
+        unset($titles[count($titles) - 1]);
+    }
+    $alttag = join (', ', $titles);
 
+    $paramstring = join('&', $urlparams);
+    $linkobject = '<img alt="'.$alttag.'" class="iconhelp" src="'.$OUTPUT->pix_url('help') . '" />';
+    $link = html_link::make(s('/lib/form/editorhelp.php?'.$paramstring), $linkobject);
+    $link->add_action(new popup_action('click', $link->url, 'popup', array('height' => 400, 'width' => 500)));
+    $link->title = $alttag;
+    return $OUTPUT->link($link);
 }
 
+/**
+ * Print a help button.
+ *
+ * Prints a special help button for html editors (htmlarea in this case)
+ *
+ * @todo Write code into this function! detect current editor and print correct info
+ * @global object
+ * @return string Only returns an empty string at the moment
+ */
+function editorshortcutshelpbutton() {
+    /// TODO: MDL-21215
+
+    global $CFG;
+    //TODO: detect current editor and print correct info
+/*    $imagetext = '<img src="' . $CFG->httpswwwroot . '/lib/editor/htmlarea/images/kbhelp.gif" alt="'.
+        get_string('editorshortcutkeys').'" class="iconkbhelp" />';
+
+    return helpbutton('editorshortcuts', get_string('editorshortcutkeys'), 'moodle', true, false, '', true, $imagetext);*/
+    return '';
+}
+
+
 /**
  * Returns an image of an up or down arrow, used for column sorting. To avoid unnecessary DB accesses, please
  * provide this function with the language strings for sortasc and sortdesc.
@@ -3143,10 +3195,10 @@ function choose_from_menu_nested($options,$name,$selected='',$nothing='choose',$
  * @return string|bool Depending on value of $return
  */
 function print_scale_menu_helpbutton($courseid, $scale, $return=false) {
-    // debugging('print_scale_menu_helpbutton() has been deprecated. Please change your code to use $OUTPUT->help_button($scaleselect).');
+    // debugging('print_scale_menu_helpbutton() has been deprecated. Please change your code to use $OUTPUT->help_scale($courseid, $scale).');
     global $OUTPUT;
 
-    $output = $OUTPUT->help_button(help_button::make_scale_menu($courseid, $scale));
+    $output = $OUTPUT->help_icon_scale($courseid, $scale);
 
     if ($return) {
         return $output;
@@ -3451,17 +3503,15 @@ function print_heading_with_help($text, $helppage, $module='moodle', $icon=false
 
     global $OUTPUT;
 
-    $helpicon = new moodle_help_icon();
-    $helpicon->page = $helppage;
-    $helpicon->text = $text;
-    $helpicon->module = $module;
-
     // Extract the src from $icon if it exists
     if (preg_match('/src="([^"]*)"/', $icon, $matches)) {
         $icon = $matches[1];
+        $icon = moodle_url($icon);
+    } else {
+        $icon = '';
     }
 
-    $output = $OUTPUT->heading_with_help($helpicon, $icon);
+    $output = $OUTPUT->heading_with_help($text, $helppage, $module, $icon);
 
     if ($return) {
         return $output;
index 7507627ab6d7a8c2f5be15373cac193b779badfc..349fb8c02fd3d56f460806d7417e2dec337d4498 100644 (file)
@@ -76,18 +76,7 @@ class MoodleQuickForm_advcheckbox extends HTML_QuickForm_advcheckbox{
      * @param string $function function name to call to get html
      */
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        if (!is_array($helpbuttonargs)){
-            $helpbuttonargs=array($helpbuttonargs);
-        }else{
-            $helpbuttonargs=$helpbuttonargs;
-        }
-        //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 ;
-        }
-        $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
     /**
      * get html for help button
index adc5a0f73ecc6bc897870fc293920601d6fe8b09..eb16bad9f9dce30e7fd4769679acd36d504082ee 100644 (file)
@@ -47,18 +47,7 @@ class MoodleQuickForm_button extends HTML_QuickForm_button
      * @param string $function function name to call to get html
      */
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        if (!is_array($helpbuttonargs)){
-            $helpbuttonargs=array($helpbuttonargs);
-        }else{
-            $helpbuttonargs=$helpbuttonargs;
-        }
-        //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 ;
-        }
-        $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
     /**
      * get html for help button
index c621213bba57ae4cf24e44fedb5c01d05fb935cb..237c796a14950e489907f3ff51a65f8af6abc6f8 100644 (file)
@@ -25,18 +25,7 @@ class MoodleQuickForm_checkbox extends HTML_QuickForm_checkbox{
      * @param string $function function name to call to get html
      */
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        if (!is_array($helpbuttonargs)){
-            $helpbuttonargs=array($helpbuttonargs);
-        }else{
-            $helpbuttonargs=$helpbuttonargs;
-        }
-        //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 ;
-        }
-        $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
     /**
      * get html for help button
index b34062a06dde20028624cabbf893ce3c0624f5b2..7f12a06715e819b9ae16b21d832ee701462a3a09 100644 (file)
@@ -25,18 +25,7 @@ class MoodleQuickForm_file extends HTML_QuickForm_file{
      * @param string $function function name to call to get html
      */
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        if (!is_array($helpbuttonargs)){
-            $helpbuttonargs=array($helpbuttonargs);
-        }else{
-            $helpbuttonargs=$helpbuttonargs;
-        }
-        //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 ;
-        }
-        $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
     /**
      * set html for help button
index d56be509eb0bb6902bac9ebeb5812f97fa08f835..5bb90bf99c5c036a75262e5a87c30e5cd1b9c8c9 100644 (file)
@@ -97,18 +97,7 @@ class MoodleQuickForm_filemanager extends HTML_QuickForm_element {
     }
 
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        if (!is_array($helpbuttonargs)){
-            $helpbuttonargs=array($helpbuttonargs);
-        }else{
-            $helpbuttonargs=$helpbuttonargs;
-        }
-        //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 ;
-        }
-        $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
 
     function getHelpButton() {
index e7513fcc1cd27960cc8a7c1efdb0cabac6711f51..6f2a3ecae78ef04260ba28d463ed8ce478bc0c04 100644 (file)
@@ -36,18 +36,7 @@ class MoodleQuickForm_filepicker extends HTML_QuickForm_input {
     }
 
     function setHelpButton($helpbuttonargs, $function='helpbutton') {
-        if (!is_array($helpbuttonargs)) {
-            $helpbuttonargs = array($helpbuttonargs);
-        } else {
-            $helpbuttonargs = $helpbuttonargs;
-        }
-        //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 ;
-        }
-        $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
 
     function getHelpButton() {
index 49f4ab0fa8963a98bbc3f51cd157b310fe9ec020..fce9aee10eec00a5ea6edcd3a6e9f89bb47727fa 100644 (file)
@@ -51,34 +51,6 @@ class MoodleQuickForm_format extends MoodleQuickForm_select{
         }
     } //end constructor
 
-    /**
-     * Add a single button.
-     *
-     * @param string $elementname name of the element to add the item to
-     * @param array $button arguments to pass to function $function
-     * @param boolean $suppresscheck whether to throw an error if the element
-     *                                  doesn't exist.
-     * @param string $function - function to generate html from the arguments in $button
-     * @param string $function
-     */
-    function setHelpButton($button, $function='helpbutton'){
-        global $OUTPUT;
-        //_elements has a numeric index, this code accesses the elements by name
-        $buttonparams = array('page', 'text', 'module', 'image', 'linktext', 'text', 'return', 'imagetext');
-        $helpiconoptions = array('page' => null, 'text' => null, 'module' => 'moodle', 'image' => null, 'linktext' => false);
-
-        foreach ($button as $key => $val) {
-            if (isset($button[$key])) {
-                $helpiconoptions[$buttonparams[$key]] = $val;
-            }
-        }
-        $helpicon = moodle_help_icon::make($helpiconoptions['page'], $helpiconoptions['text'], $helpiconoptions['module'], $helpiconoptions['linktext']);
-        if (!$helpiconoptions['image']) {
-            $helpicon->image = false;
-        }
-
-        $this->_helpbutton = $OUTPUT->help_icon($helpicon);
-    }
     /**
      * Called by HTML_QuickForm whenever form event is made on this element
      *
@@ -95,7 +67,7 @@ class MoodleQuickForm_format extends MoodleQuickForm_select{
             case 'createElement':
                 $menu = format_text_menu();
                 $this->load($menu);
-                $this->setHelpButton(array('textformat', get_string('helpformatting')));
+                //$this->setHelpButton(array('textformat', get_string('helpformatting')));
                 break;
             case 'updateValue' :
                 $value = $this->_findValue($caller->_constantValues);
index 74a49e5ca61ba4772a994cd9d78ada4a90d27edc..64fe56acbb5227350e8a7217098ba083aa05999d 100644 (file)
@@ -30,21 +30,7 @@ class MoodleQuickForm_group extends HTML_QuickForm_group{
      * @param string $function function name to call to get html
      */
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        global $OUTPUT;
-        if (!is_array($helpbuttonargs)){
-            $helpbuttonargs=array($helpbuttonargs);
-        }else{
-            $helpbuttonargs=$helpbuttonargs;
-        }
-        //we do this to to return html instead of printing it
-        //without having to specify it in every call to make a button.
-        if ($function == 'helpbutton') {
-            $defaultargs=array('', '', 'moodle', true, false, '', true);
-            $helpbuttonargs=$helpbuttonargs + $defaultargs ;
-            $this->_helpbutton=$OUTPUT->help_icon(call_user_func_array('moodle_help_icon::make', $helpbuttonargs));
-        } else {
-            $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
-        }
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
     /**
      * set html for help button
index 86bef4db58183b5632f68db405fd25e0d6f4f91f..9f22503b46b2e1bcc253aee3c6f71c7ed26301f9 100644 (file)
@@ -43,18 +43,7 @@ class MoodleQuickForm_header extends HTML_QuickForm_header
      * @param string $function function name to call to get html
      */
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        if (!is_array($helpbuttonargs)){
-            $helpbuttonargs=array($helpbuttonargs);
-        }else{
-            $helpbuttonargs=$helpbuttonargs;
-        }
-        //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 ;
-        }
-        $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
     /**
      * get html for help button
index c1961d7629a4ae43420ca8582c689654316365d2..f260a6c4e2de13f38132572a7958e4f66714fe19 100644 (file)
@@ -47,18 +47,7 @@ class MoodleQuickForm_htmleditor extends MoodleQuickForm_textarea{
      * @param string $function function name to call to get html
      */
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        if (!$this->_canUseHtmlEditor){
-            if ('editorhelpbutton' == $function){
-                $key = array_search('richtext2', $helpbuttonargs);
-                if ($key !== FALSE){
-                    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('text2', 'emoticons2'), 'editorhelpbutton');
-            }
-        }
-        return parent::setHelpButton($helpbuttonargs, $function);
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
 
     function toHtml(){
index 2c6dabb88fbf55b4764355de472c2a1b32e94e04..75a0897f1ea89eb193ef597bb20598e140b458a1 100644 (file)
@@ -62,7 +62,8 @@ class MoodleQuickForm_modgrade extends MoodleQuickForm_select{
                     $grades[$i] = $i;
                 }
                 $this->load($grades);
-                $this->setHelpButton(array($COURSE->id), 'modgradehelpbutton');
+                //TODO: rewrite mod grading support in modforms 
+                // $this->setHelpButton(array($COURSE->id), 'modgradehelpbutton');
                 return $result;
         }
         return parent::onQuickFormEvent($event, $arg, $caller);
index 33ba3bd6158170dea30822d01d68b98f0f7523d7..1883897edab5e0d070297aa2ccc656048c775685 100644 (file)
@@ -25,18 +25,7 @@ class MoodleQuickForm_password extends HTML_QuickForm_password{
      * @param string $function function name to call to get html
      */
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        if (!is_array($helpbuttonargs)){
-            $helpbuttonargs=array($helpbuttonargs);
-        }else{
-            $helpbuttonargs=$helpbuttonargs;
-        }
-        //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 ;
-        }
-        $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
     /**
      * get html for help button
index abc66b76b8e314962d7a6b4419bb0656d826a693..ed5bdf8787504a8d4b14f1d8217c71f0fc3dd214 100644 (file)
@@ -25,18 +25,7 @@ class MoodleQuickForm_radio extends HTML_QuickForm_radio{
      * @param string $function function name to call to get html
      */
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        if (!is_array($helpbuttonargs)){
-            $helpbuttonargs=array($helpbuttonargs);
-        }else{
-            $helpbuttonargs=$helpbuttonargs;
-        }
-        //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 ;
-        }
-        $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
     /**
      * get html for help button
index 2613e227b95c611e0001a91e18fab725a197280c..9f7296b49ad5e4fcdc0150f0692a4e78ddba87c0 100644 (file)
@@ -7,7 +7,6 @@
  * @category  Admin
  * @package   admin
  * @author    Nicolas Connault <nicolasconnault@gmail.com>
- * @version   $Id$
  */
 
 
@@ -96,18 +95,7 @@ class MoodleQuickForm_recaptcha extends HTML_QuickForm_input {
      * @param string $function function name to call to get html
      */
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        if (!is_array($helpbuttonargs)){
-            $helpbuttonargs=array($helpbuttonargs);
-        }else{
-            $helpbuttonargs=$helpbuttonargs;
-        }
-        //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 ;
-        }
-        $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
 
     /**
index 92443e2a908ba28bdbce7bc31edba4abbfa9c910..9742d923f751e881d2c9acdf3ec1ad2c89878f9e 100644 (file)
@@ -57,21 +57,7 @@ class MoodleQuickForm_select extends HTML_QuickForm_select{
      * @param string $function function name to call to get html
      */
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        global $OUTPUT;
-        if (!is_array($helpbuttonargs)){
-            $helpbuttonargs=array($helpbuttonargs);
-        }else{
-            $helpbuttonargs=$helpbuttonargs;
-        }
-        //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 ;
-            $this->_helpbutton=$OUTPUT->help_icon(call_user_func_array('moodle_help_icon::make', $helpbuttonargs));
-        } else {
-            $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
-        }
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
     /**
      * get html for help button
index 04420b1a7f84a94acf4652d4eb434919d9a42029..9db9b8f52f198492cc5f0134d0918bdc78dca549 100644 (file)
@@ -570,18 +570,7 @@ class MoodleQuickForm_selectgroups extends HTML_QuickForm_element {
      * @param string $function function name to call to get html
      */
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        if (!is_array($helpbuttonargs)){
-            $helpbuttonargs=array($helpbuttonargs);
-        }else{
-            $helpbuttonargs=$helpbuttonargs;
-        }
-        //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 ;
-        }
-        $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
     /**
      * get html for help button
index 53e5d71e647f31e41752e961d2c8fc3b029c33b8..6d5a1de4318ccda53745bc132475faf970349593 100755 (executable)
@@ -90,18 +90,7 @@ class MoodleQuickForm_selectwithlink extends HTML_QuickForm_select{
      * @param string $function function name to call to get html
      */
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        if (!is_array($helpbuttonargs)){
-            $helpbuttonargs=array($helpbuttonargs);
-        }else{
-            $helpbuttonargs=$helpbuttonargs;
-        }
-        //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 ;
-        }
-        $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
     /**
      * get html for help button
index 1c976ee67a64cef6260812b32623296459219f0b..82584393fbeae309ff0d610072956e3f105c61ee 100644 (file)
@@ -26,18 +26,7 @@ class MoodleQuickForm_static extends HTML_QuickForm_static{
      * @param string $function function name to call to get html
      */
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        if (!is_array($helpbuttonargs)){
-            $helpbuttonargs=array($helpbuttonargs);
-        }else{
-            $helpbuttonargs=$helpbuttonargs;
-        }
-        //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 ;
-        }
-        $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
     /**
      * get html for help button
index 9c650a719fd277632938217a9424f0c55655c509..2e119b0abef49934eb9e12cb090e303b3215df30 100644 (file)
@@ -58,18 +58,7 @@ class MoodleQuickForm_text extends HTML_QuickForm_text{
      * @param string $function function name to call to get html
      */
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        if (!is_array($helpbuttonargs)){
-            $helpbuttonargs=array($helpbuttonargs);
-        }else{
-            $helpbuttonargs=$helpbuttonargs;
-        }
-        //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 ;
-        }
-        $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
     /**
      * get html for help button
index 21a7a8921520097d1ee21818bf8c2327b1d4fc3f..7587ddfa1dae379ba2ee8ce57ee799f178e52627 100644 (file)
@@ -34,29 +34,7 @@ class MoodleQuickForm_textarea extends HTML_QuickForm_textarea{
      * @param string $function function name to call to get html
      */
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        global $SESSION;
-        if (!is_array($helpbuttonargs)) {
-            $helpbuttonargs = array($helpbuttonargs);
-        } else {
-            $helpbuttonargs = $helpbuttonargs;
-        }
-        //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 ;
-            if (in_array($helpbuttonargs[0], array('emoticons2', 'text2', 'richtext2'))) {
-                $SESSION->inserttextform = $this->_formid;
-                $SESSION->inserttextfield = $this->getAttribute('name');
-            }
-        } else if ('editorhelpbutton' == $function) {
-            $specialhelp = array_intersect($helpbuttonargs, array('emoticons2', 'text2', 'richtext2'));
-            if (!empty($specialhelp)) {
-                $SESSION->inserttextform = $this->_formid;
-                $SESSION->inserttextfield = $this->getAttribute('name');
-            }
-        }
-        $this->_helpbutton = call_user_func_array($function, $helpbuttonargs);
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
     /**
      * get html for help button
index 7d3ace9dfca8953bb2d1ff6b3e54d91104ddc7ad..22fe5d7a92664760cac8c360c2b247ee25862f95 100755 (executable)
@@ -95,18 +95,7 @@ EOD;
      * @param string $function function name to call to get html
      */
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        if (!is_array($helpbuttonargs)){
-            $helpbuttonargs=array($helpbuttonargs);
-        }else{
-            $helpbuttonargs=$helpbuttonargs;
-        }
-        //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 ;
-        }
-        $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
     /**
      * get html for help button
index 4e9053b3177a0a2f14eb4047fea919309f0836d1..d472b9f48f57ed9e8d2ce44da41d766fc7f38f67 100644 (file)
@@ -34,18 +34,7 @@ class MoodleQuickForm_warning extends HTML_QuickForm_static{
      * @param string $function function name to call to get html
      */
     function setHelpButton($helpbuttonargs, $function='helpbutton'){
-        if (!is_array($helpbuttonargs)){
-            $helpbuttonargs=array($helpbuttonargs);
-        }else{
-            $helpbuttonargs=$helpbuttonargs;
-        }
-        //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 ;
-        }
-        $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+        debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
     }
 
     function toHtml() {
index 60de06c4bac6f296b106076ccb26d16c656d677b..4204eb2c32e8c235afc39aa13e3f861d776d08e3 100644 (file)
@@ -1334,26 +1334,26 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless {
      * @param string $function - function to generate html from the arguments in $button
      * @param string $function
      */
-    function setHelpButton($elementname, $button, $suppresscheck=false, $function='helpbutton'){
+    function setHelpButton($elementname, $buttonargs, $suppresscheck=false, $function='helpbutton'){
         global $OUTPUT;
-        if (array_key_exists($elementname, $this->_elementIndex)){
+        if ($function !== 'helpbutton') {
+            debugging('parameter $function in moodle_form::setHelpButton() is not supported any more');
+        }
+
+        $buttonargs = (array)$buttonargs;
+
+        if (array_key_exists($elementname, $this->_elementIndex)) {
             //_elements has a numeric index, this code accesses the elements by name
-            $element=&$this->_elements[$this->_elementIndex[$elementname]];
-            $buttonparams = array('page', 'text', 'module', 'image', 'linktext', 'text', 'return', 'imagetext');
-            $helpiconoptions = array('page' => null, 'text' => null, 'module' => 'moodle', 'image' => null, 'linktext' => false);
+            $element = $this->_elements[$this->_elementIndex[$elementname]];
 
-            foreach ($button as $key => $val) {
-                if (isset($button[$key])) {
-                    $helpiconoptions[$buttonparams[$key]] = $val;
-                }
-            }
-            $helpicon = moodle_help_icon::make($helpiconoptions['page'], $helpiconoptions['text'], $helpiconoptions['module'], $helpiconoptions['linktext']);
-            if (!$helpiconoptions['image']) {
-                $helpicon->image = false;
-            }
+            $page     = isset($buttonargs[0]) ? $buttonargs[0] : null;
+            $text     = isset($buttonargs[1]) ? $buttonargs[1] : null;
+            $module   = isset($buttonargs[2]) ? $buttonargs[2] : 'moodle';
+            $linktext = isset($buttonargs[3]) ? $buttonargs[3] : false;
+
+            $element->_helpbutton = $OUTPUT->help_icon($page, $text, $module, $linktext);
 
-            $element->_helpbutton = $OUTPUT->help_icon($helpicon);
-        }elseif (!$suppresscheck){
+        } else if (!$suppresscheck) {
             print_error('nonexistentformelements', 'form', '', $elementname);
         }
     }
index dc1a6179f61af97b447f6683ec64cdd2436debbc..e4f36a230068a7cda32e2c41eb14e56c3d9d5cd8 100644 (file)
@@ -385,7 +385,7 @@ class html_select extends labelled_html_component {
      */
     public $form;
     /**
-     * @var moodle_help_icon $form An optional moodle_help_icon component
+     * @var help_icon $array help icon params
      */
     public $helpicon;
     /**
@@ -621,34 +621,21 @@ class html_select extends labelled_html_component {
     /**
      * Adds a help icon next to the select menu.
      *
-     * This can be used in two ways:
-     *
      * <pre>
-     * $select->set_help_icon($page, $text, $linktext);
-     * // OR
-     * $helpicon = new moodle_help_icon();
-     * $helpicon->page = $page;
-     * $helpicon->text = $text;
-     * $helpicon->linktext = $linktext;
-     * $select->set_help_icon($helpicon);
+     * $select->set_help_icon($page, $text, $component);
      * </pre>
      *
-     * Use the second form when you need to add additional HTML attributes
-     * to the label and/or JS actions.
-     *
-     * @param mixed $page Either the keyword that defines a help page or a moodle_help_icon object
+     * @param string $helppage Either the keyword that defines a help page or a help_icon object
      * @param text  $text The text of the help icon
+     * @param component $component
      * @param boolean $linktext Whether or not to show text next to the icon
      * @return void
      */
-    public function set_help_icon($page, $text, $linktext=false) {
-        if ($page instanceof moodle_help_icon) {
-            $this->helpicon = $page;
-        } else if (!empty($page)) {
-            $this->helpicon = new moodle_help_icon();
-            $this->helpicon->page = $page;
-            $this->helpicon->text = $text;
-            $this->helpicon->linktext = $linktext;
+    public function set_help_icon($helppage='', $text='', $component='moodle') {
+        if ($helppage) {
+            $this->helpicon = array('helppage'=>$helppage, 'text'=>$text, 'component'=>$component);
+        } else {
+            $this->helpicon = null;
         }
     }
 
@@ -1292,10 +1279,10 @@ class html_link extends html_component {
             // to be filled later
 
         } else if ($url instanceof moodle_url) {
-            $this->src = clone($url);
+            $this->url = clone($url);
 
         } else if (is_string($url)) {
-            $this->src = new moodle_url($url);
+            $this->url = new moodle_url($url);
 
         } else {
             throw new coding_style_exception('Image can be constructed only from moodle_url or string url.');
@@ -1403,17 +1390,17 @@ class html_image extends labelled_html_component {
      * @param moodle_url|string $url url of the image
      * @param array $options image attributes such as title, id, alt, widht, height
      */
-    public function __construct($url = null, array $options = null) {
+    public function __construct($src = null, array $options = null) {
         parent::__construct($options);
 
-        if (is_null($url)) {
+        if (is_null($src)) {
             // to be filled later
 
-        } else if ($url instanceof moodle_url) {
-            $this->src = clone($url);
+        } else if ($src instanceof moodle_url) {
+            $this->src = clone($src);
 
-        } else if (is_string($url)) {
-            $this->src = new moodle_url($url);
+        } else if (is_string($src)) {
+            $this->src = new moodle_url($src);
 
         } else {
             throw new coding_style_exception('Image can be constructed only from moodle_url or string url.');
@@ -1443,8 +1430,8 @@ class html_image extends labelled_html_component {
      *
      * @param mixed $url The URL to the image (string or moodle_url)
      */
-    public static function make($url) {
-        return new html_image($url);
+    public static function make($src) {
+        return new html_image($src);
     }
 }
 
@@ -2027,11 +2014,11 @@ class user_picture extends html_image {
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  * @since     Moodle 2.0
  */
-class moodle_help_icon extends labelled_html_component {
+class help_icon extends html_image {
+    public $page;
     /**
-     * @var html_link $link A html_link object that will hold the URL info
+     * @var string $module Which module is the page defined in
      */
-    public $link;
     /**
      * @var string $text A descriptive text
      */
@@ -2039,29 +2026,46 @@ class moodle_help_icon extends labelled_html_component {
     /**
      * @var string $page  The keyword that defines a help page
      */
-    public $page;
-    /**
-     * @var string $module Which module is the page defined in
-     */
-    public $module = 'moodle';
+    public $component = 'moodle';
     /**
      * @var boolean $linktext Whether or not to show text next to the icon
      */
     public $linktext = false;
+
     /**
-     * @var mixed $image The help icon. Can be set to true (will use default help icon),
-     *                   false (will not use any icon), the URL to an image, or a full
-     *                   html_image object.
+     * @var html_link $link A html_link object that will hold the URL info
      */
-    public $image;
+    public $link;
 
     /**
      * Constructor: sets up the other components in case they are needed
+     * @param string $page  The keyword that defines a help page
+     * @param string $text A descriptive text
+     * @param string $component
+     * @param bool $linktext add extra text to icon
      * @return void
      */
-    public function __construct() {
+    public function __construct($helppage, $text, $component='moodle', $linktext=false) {
+        global $CFG;
+
+        if (empty($helppage)) {
+            throw new coding_exception('A help_icon object requires a $helppage parameter');
+        }
+
+        if (empty($text)) {
+            throw new coding_exception('A help_icon object requires a $text parameter');
+        }
+
+        parent::__construct(null, array('class'=>'iconhelp'));
+
+        $this->helppage  = $helppage;
+        $this->text      = $text;
+        $this->component = $component;
+        $this->linktext  = $linktext;
+
         $this->link = new html_link();
-        $this->image = new html_image();
+        $this->link->url = new moodle_url($CFG->wwwroot.'/help.php', array('module' => $this->component, 'file' => $this->helppage .'.html'));
+        // Warn users about new window for Accessibility
     }
 
     /**
@@ -2071,97 +2075,24 @@ class moodle_help_icon extends labelled_html_component {
     public function prepare(renderer_base $output, moodle_page $page, $target) {
         global $CFG;
 
-        if (empty($this->page)) {
-            throw new coding_exception('A moodle_help_icon object requires a $page parameter');
-        }
-
-        if (empty($this->text) && empty($this->link->text)) {
-            throw new coding_exception('A moodle_help_icon object (or its $link attribute) requires a $text parameter');
-        } else if (!empty($this->text) && empty($this->link->text)) {
-            $this->link->text = $this->text;
+        if (empty($this->link->title)) {
+            $this->link->title = get_string('helpprefix2', '', trim($this->text, ". \t")) .' ('.get_string('newwindow').')';
         }
 
-        // fix for MDL-7734
-        $this->link->url = new moodle_url($CFG->wwwroot.'/help.php', array('module' => $this->module, 'file' => $this->page .'.html'));
-
-        // fix for MDL-7734
-        if (!empty($page->course->lang)) {
-            $this->link->url->param('forcelang', $page->course->lang);
-        }
-
-        // Catch references to the old text.html and emoticons.html help files that
-        // were renamed in MDL-13233.
-        if (in_array($this->page, array('text', 'emoticons', 'richtext'))) {
-            $oldname = $this->page;
-            $this->page .= '2';
-            debugging("You are referring to the old help file '$oldname'. " .
-                    "This was renamed to '$this->page' because of MDL-13233. " .
-                    "Please update your code.", DEBUG_DEVELOPER);
-        }
-
-        if ($this->module == '') {
-            $this->module = 'moodle';
+        if (empty($this->src)) {
+            $this->src = $output->pix_url('help');
         }
 
-        // Warn users about new window for Accessibility
-        $this->title = get_string('helpprefix2', '', trim($this->text, ". \t")) .' ('.get_string('newwindow').')';
-
-        // Prepare image and linktext
-        if ($this->image && !($this->image instanceof html_image)) {
-            $image = fullclone($this->image);
-            $this->image = new html_image();
-
-            if ($image instanceof moodle_url) {
-                $this->image->src = $image->out();
-            } else if ($image === true) {
-                $this->image->src = $output->pix_url('help');
-            } else if (is_string($image)) {
-                $this->image->src = $image;
-            }
+        if ($this->linktext) {
+            $this->image->alt = get_string('helpwiththis');
+        } else {
             $this->image->alt = $this->text;
-
-            if ($this->linktext) {
-                $this->image->alt = get_string('helpwiththis');
-            } else {
-                $this->image->alt = $this->title;
-            }
-            $this->image->add_class('iconhelp');
-        } else if (empty($this->image->src)) {
-            if (!($this->image instanceof html_image)) {
-                $this->image = new html_image();
-            }
-            $this->image->src = $output->pix_url('help');
         }
 
-        parent::prepare($output, $page, $target);
-    }
-
-    /**
-     * This is a shortcut for creating a help_icon with only the 2 required params
-     * @param string $page  The keyword that defines a help page
-     * @param string $text A descriptive text
-     * @return moodle_help_icon A moodle_help_icon object with the two common fields initialised.
-     */
-    public static function make($page, $text, $module='moodle', $linktext=false) {
-        $helpicon = new moodle_help_icon();
-        $helpicon->page = $page;
-        $helpicon->text = $text;
-        $helpicon->module = $module;
-        $helpicon->linktext = $linktext;
-        return $helpicon;
-    }
+        $popup = new popup_action('click', $this->link->url);
+        $this->link->add_action($popup);
 
-    public static function make_scale_menu($courseid, $scale) {
-        $helpbutton = new moodle_help_icon();
-        $strscales = get_string('scales');
-        $helpbutton->image->alt = $scale->name;
-        $helpbutton->link->url = new moodle_url('/course/scales.php', array('id' => $courseid, 'list' => true, 'scaleid' => $scale->id));
-        $popupaction = new popup_action('click', $helpbutton->url, 'ratingscale', $popupparams);
-        $popupaction->width = 500;
-        $popupaction->height = 400;
-        $helpbutton->link->add_action($popupaction);
-        $helpbutton->link->title = $scale->name;
-        return $helpbutton;
+        parent::prepare($output, $page, $target);
     }
 }
 
index ddede978f80c890ac97e646d426062254465f6a8..5341e18af6a37dcbf2b6283fcaa7e0a4075346b1 100644 (file)
@@ -459,13 +459,13 @@ class core_renderer extends renderer_base {
      */
     public function login_info() {
         global $USER, $CFG, $DB;
-    
+
         if (during_initial_install()) {
             return '';
         }
-    
+
         $course = $this->page->course;
-    
+
         if (session_is_loggedinas()) {
             $realuser = session_get_realuser();
             $fullname = fullname($realuser, true);
@@ -474,15 +474,15 @@ class core_renderer extends renderer_base {
         } else {
             $realuserinfo = '';
         }
-    
+
         $loginurl = get_login_url();
-    
+
         if (empty($course->id)) {
             // $course->id is not defined during installation
             return '';
         } else if (!empty($USER->id)) {
             $context = get_context_instance(CONTEXT_COURSE, $course->id);
-    
+
             $fullname = fullname($USER, true);
             $username = "<a $CFG->frametarget href=\"$CFG->wwwroot/user/view.php?id=$USER->id&amp;course=$course->id\">$fullname</a>";
             if (is_mnet_remote_user($USER) and $idprovider = $DB->get_record('mnet_host', array('id'=>$USER->mnethostid))) {
@@ -507,9 +507,9 @@ class core_renderer extends renderer_base {
             $loggedinas = get_string('loggedinnot', 'moodle').
                           " (<a $CFG->frametarget href=\"$loginurl\">".get_string('login').'</a>)';
         }
-    
+
         $loggedinas = '<div class="logininfo">'.$loggedinas.'</div>';
-    
+
         if (isset($SESSION->justloggedin)) {
             unset($SESSION->justloggedin);
             if (!empty($CFG->displayloginfailures)) {
@@ -530,7 +530,7 @@ class core_renderer extends renderer_base {
                 }
             }
         }
-    
+
         return $loggedinas;
     }
 
@@ -758,7 +758,7 @@ class core_renderer extends renderer_base {
 
         $currlang = current_language();
         $langs = get_list_of_languages();
-        
+
         if (count($langs) < 2) {
             return '';
         }
@@ -1145,89 +1145,70 @@ class core_renderer extends renderer_base {
     /*
      * Centered heading with attached help button (same title text)
      * and optional icon attached
-     * @param moodle_help_icon $helpicon A moodle_help_icon object
-     * @param mixed $image An image URL or a html_image object
+     * @param string $text A heading text
+     * @param string $page The keyword that defines a help page
+     * @param string $component component name
+     * @param string|moodle_url $icon
+     * @param string $iconalt icon alt text
      * @return string HTML fragment
      */
-    public function heading_with_help($helpicon, $image=false) {
-        if (!($image instanceof html_image) && !empty($image)) {
-            $htmlimage = new html_image();
-            $htmlimage->src = $image;
-            $image = $htmlimage;
+    public function heading_with_help($text, $helppage, $component='moodle', $icon='', $iconalt='') {
+        $image = '';
+        if ($icon) {
+            if ($icon instanceof moodle_url) {
+                $image = $this->image($icon, array('class'=>'icon', 'alt'=>$iconalt));
+            } else {
+                $image = $this->image($this->pix_url($icon, $component), array('class'=>'icon', 'alt'=>$iconalt));
+            }
         }
-        return $this->container($this->image($image) . $this->heading($helpicon->text, 2, 'main help') . $this->help_icon($helpicon), 'heading-with-help');
+
+        $help = $this->help_icon($helppage, $text, $component);
+
+        return $this->heading($image.$text.$help, 2, 'main help');
     }
 
     /**
      * Print a help icon.
      *
-     * @param moodle_help_icon $helpicon A moodle_help_icon object, subclass of html_link
-     *
+     * @param string $page The keyword that defines a help page
+     * @param string $text A descriptive text
+     * @param string $component component name
+     * @param bool $linktext show extra descriptive text
+
      * @return string  HTML fragment
      */
-    public function help_icon($icon) {
-        global $COURSE;
-        $icon = clone($icon);
-        $icon->prepare($this, $this->page, $this->target);
+    public function help_icon($helppage, $text=null, $component='moodle', $linktext=false) {
+        $icon = new help_icon($helppage, $text, $component, $linktext);
 
-        $popup = new popup_action('click', $icon->link->url);
-        $icon->link->add_action($popup);
-
-        $image = null;
+        $icon->prepare($this, $this->page, $this->target);
 
-        if (!empty($icon->image)) {
-            $image = $icon->image;
-            $image->add_class('iconhelp');
+        $icon->link->text = $this->image($icon);
+        if ($icon->linktext) {
+            $icon->link->text .= $icon->text;
         }
 
-        return $this->output_tag('span', array('class' => 'helplink'), $this->link_to_popup($icon->link, $image));
+        return $this->output_tag('span', array('class' => 'helplink'), $this->link($icon->link));
     }
 
     /**
-     * Creates and returns a button to a popup window
+     * Print scale help icon.
      *
-     * @param html_link $link Subclass of html_component
-     * @param moodle_popup $popup A moodle_popup object
-     * @param html_image $image An optional image replacing the link text
-     *
-     * @return string HTML fragment
+     * @param int $courseid
+     * @param object $scale instance
+     * @return string  HTML fragment
      */
-    public function link_to_popup($link, $image=null) {
-        //TODO: decide if this should be removed completely, because link() already handles this
-        //      we could also add html_link::make_popup() factory method
-        $link = clone($link);
-
-        // Use image if one is given
-        if (!empty($image) && $image instanceof html_image) {
-
-            if (empty($image->alt) || $image->alt == HTML_ATTR_EMPTY) {
-                $image->alt = $link->text;
-                $image->title = $link->text;
-            }
-
-            $link->text = $this->image($image);
-
-            if (!empty($link->linktext)) { // TODO: this is weird!
-                $link->text = "$link->title &#160; $link->text";
-            }
-        }
-
-        $link->prepare($this, $this->page, $this->target);
-        $this->prepare_event_handlers($link);
+    public function help_icon_scale($courseid, stdClass $scale) {
+        global $CFG;
 
-        if (empty($link->url)) {
-            throw new coding_exception('Called $OUTPUT->link_to_popup($link) method without $link->url set.');
-        }
+        $title = get_string('helpprefix2', '', $scale->name) .' ('.get_string('newwindow').')';
 
-        $linkurl = prepare_url($link->url);
+        $icon = $this->image($this->pix_url('help'), array('class'=>'iconhelp', 'alt'=>get_string('scales')));
 
-        $tagoptions = array(
-                'title' => $link->title,
-                'id' => $link->id,
-                'href' => ($linkurl) ? $linkurl : prepare_url($popup->url),
-                'class' => $link->get_classes_string());
+        $link = new html_link(new moodle_url($CFG->wwwroot.'/course/scales.php', array('id' => $courseid, 'list' => true, 'scaleid' => $scale->id)), $icon);
+        $popupaction = new popup_action('click', $link->url, 'ratingscale');
+        $link->add_action($popupaction);
 
-        return $this->output_tag('a', $tagoptions, $link->text);
+        return $this->output_tag('span', array('class' => 'helplink'), $this->link($link));
     }
 
     /**
@@ -1499,7 +1480,7 @@ class core_renderer extends renderer_base {
      * html_select::set_label($label) passing a html_label object
      *
      * To add a help icon, use html_select::set_help($page, $text, $linktext) or
-     * html_select::set_help($helpicon) passing a moodle_help_icon object
+     * html_select::set_help($helpicon) passing a help_icon object
      *
      * If you html_select::$rendertype to "radio", it will render radio buttons
      * instead of a <select> menu, unless $multiple is true, in which case it
@@ -1558,8 +1539,8 @@ class core_renderer extends renderer_base {
             $html .= $this->label($select->label);
         }
 
-        if (!empty($select->helpicon) && $select->helpicon instanceof moodle_help_icon) {
-            $html .= $this->help_icon($select->helpicon);
+        if ($select->helpicon) {
+            $html .= $this->help_icon($select->helpicon['helppage'], $select->helpicon['text'], $select->helpicon['component']);
         }
 
         if ($select->rendertype == 'menu') {
index 9247dc26b6f337b78744a1c3f5c415bcf7d042d0..ef25cd7c5b81e4e8f6734283c50d6dcadeade5d5 100644 (file)
@@ -890,7 +890,7 @@ class core_renderer_test extends UnitTestCase {
     }
 
     public function test_heading_with_help() {
-        $originalicon = new moodle_help_icon();
+        $originalicon = new help_icon();
         $originalicon->page = 'myhelppage';
         $originalicon->text = 'Cool help text';
 
index 7dd5c269f4956bb49267b853e49130bdab2b13ac..938bb4b7e6e0bb24274a525c44b9af1252191139 100644 (file)
@@ -920,7 +920,7 @@ class flexible_table {
             $select = html_select::make($downloadoptions, 'download', $this->defaultdownloadformat, false);
             $select->nothingvalue = '';
             $html .= $OUTPUT->select($select);
-            $html .= $OUTPUT->help_icon(moodle_help_icon::make('tableexportformats', get_string('tableexportformats', 'table')));
+            $html .= $OUTPUT->help_icon('tableexportformats', get_string('tableexportformats', 'table'));
             $html .= '</div></form>';
 
             return $html;
index 0afb83d8afe7299e68ff38d28a643b92d1eee7bc..bf572d8b390196b7969062c8e17611b01109c874 100644 (file)
@@ -2401,127 +2401,6 @@ function mdie($msg='', $errorcode=1) {
     exit($errorcode);
 }
 
-/**
- * Returns a string of html with an image of a help icon linked to a help page on a number of help topics.
- * Should be used only with htmleditor or textarea.
- *
- * @global object
- * @global object
- * @param mixed $helptopics variable amount of params accepted. Each param may be a string or an array of arguments for
- *                  helpbutton.
- * @return string Link to help button
- */
-function editorhelpbutton(){
-    global $CFG, $SESSION, $OUTPUT;
-    $items = func_get_args();
-    $i = 1;
-    $urlparams = array();
-    $titles = array();
-    foreach ($items as $item){
-        if (is_array($item)){
-            $urlparams[] = "keyword$i=".urlencode($item[0]);
-            $urlparams[] = "title$i=".urlencode($item[1]);
-            if (isset($item[2])){
-                $urlparams[] = "module$i=".urlencode($item[2]);
-            }
-            $titles[] = trim($item[1], ". \t");
-        } else if (is_string($item)) {
-            $urlparams[] = "button$i=".urlencode($item);
-            switch ($item) {
-                case 'reading' :
-                    $titles[] = get_string("helpreading");
-                    break;
-                case 'writing' :
-                    $titles[] = get_string("helpwriting");
-                    break;
-                case 'questions' :
-                    $titles[] = get_string("helpquestions");
-                    break;
-                case 'emoticons2' :
-                    $titles[] = get_string("helpemoticons");
-                    break;
-                case 'richtext2' :
-                    $titles[] = get_string('helprichtext');
-                    break;
-                case 'text2' :
-                    $titles[] = get_string('helptext');
-                    break;
-                default :
-                    print_error('unknownhelp', '', '', $item);
-            }
-        }
-        $i++;
-    }
-    if (count($titles)>1){
-        //join last two items with an 'and'
-        $a = new object();
-        $a->one = $titles[count($titles) - 2];
-        $a->two = $titles[count($titles) - 1];
-        $titles[count($titles) - 2] = get_string('and', '', $a);
-        unset($titles[count($titles) - 1]);
-    }
-    $alttag = join (', ', $titles);
-
-    $paramstring = join('&', $urlparams);
-    $linkobject = '<img alt="'.$alttag.'" class="iconhelp" src="'.$OUTPUT->pix_url('help') . '" />';
-    $link = html_link::make(s('/lib/form/editorhelp.php?'.$paramstring), $linkobject);
-    $link->add_action(new popup_action('click', $link->url, 'popup', array('height' => 400, 'width' => 500)));
-    $link->title = $alttag;
-    return $OUTPUT->link($link);
-}
-
-/**
- * Print a help button.
- *
- * Prints a special help button that is a link to the "live" emoticon popup
- *
- * @todo Finish documenting this function
- *
- * @global object
- * @global object
- * @param string $form ?
- * @param string $field ?
- * @param boolean $return If true then the output is returned as a string, if false it is printed to the current page.
- * @return string|void Depending on value of $return
- */
-function emoticonhelpbutton($form, $field, $return = false) {
-
-    global $SESSION, $OUTPUT;
-
-    $SESSION->inserttextform = $form;
-    $SESSION->inserttextfield = $field;
-    $helpicon = moodle_help_icon::make('emoticons2', get_string('helpemoticons'), 'moodle', true);
-    $helpicon->image->src = $OUTPUT->pix_url('s/smiley');
-    $helpicon->image->add_class('emoticon');
-    $helpicon->style = "margin-left:3px; padding-right:1px;width:15px;height:15px;";
-    $help = $OUTPUT->help_icon($helpicon);
-    if (!$return){
-        echo $help;
-    } else {
-        return $help;
-    }
-}
-
-/**
- * Print a help button.
- *
- * Prints a special help button for html editors (htmlarea in this case)
- *
- * @todo Write code into this function! detect current editor and print correct info
- * @global object
- * @return string Only returns an empty string at the moment
- */
-function editorshortcutshelpbutton() {
-
-    global $CFG;
-    //TODO: detect current editor and print correct info
-/*    $imagetext = '<img src="' . $CFG->httpswwwroot . '/lib/editor/htmlarea/images/kbhelp.gif" alt="'.
-        get_string('editorshortcutkeys').'" class="iconkbhelp" />';
-
-    return helpbutton('editorshortcuts', get_string('editorshortcutkeys'), 'moodle', true, false, '', true, $imagetext);*/
-    return '';
-}
-
 /**
  * Returns html code to be used as help icon of modgrade form element
  *
index 79dc667f792fa357b0784a2b848aa787e3a62d93..92824a1374871acdf2c12c9a26983235da1c17bc 100644 (file)
@@ -15,7 +15,7 @@ if ($show_instructions) {
             if (empty($CFG->usesid)) {
                 echo '<br/>';
                 echo '('.get_string("cookiesenabled").')';
-                echo $OUTPUT->help_icon(moodle_help_icon::make("cookies", get_string("cookiesenabled")));
+                echo $OUTPUT->help_icon("cookies", get_string("cookiesenabled"));
             }
            ?>
         </div>
index e0a13117665086820e42718e6b80c1b4f351bafc..1df895a80f7596a407ad4ee059a050d6066aa62c 100644 (file)
@@ -210,9 +210,9 @@ foreach ( $providers as $providerid => $provider){
 
 /// TODO XXX: This is only a quick hack ... helpfile locations should be provided as part of the provider definition
     if ($provider->component == 'moodle') {
-        $helpbtn = $OUTPUT->help_icon(moodle_help_icon::make('moodle_'.$provider->name, $providername, 'message'));
+        $helpbtn = $OUTPUT->help_icon('moodle_'.$provider->name, $providername, 'message');
     } else {
-        $helpbtn = $OUTPUT->help_icon(moodle_help_icon::make('message_'.$provider->name, $providername, basename($provider->component)));
+        $helpbtn = $OUTPUT->help_icon('message_'.$provider->name, $providername, basename($provider->component));
     }
 
     echo '<tr><th align="right">'.$providername.$helpbtn.'</th><td colspan="'.$number_procs.'"></td></tr>'."\n";
index 4d53c218477a88ddd942c115a775f80e88adcda7..d99b8957af836d45e9f67c1c9a5b61cfbfec8ecd 100644 (file)
@@ -1009,7 +1009,7 @@ class assignment_base {
             } else {
                 echo '<div class="format">';
                 echo $OUTPUT->select(html_select::make(format_text_menu(), "format", $submission->format, false));
-                echo $OUTPUT->help_icon(moodle_help_icon::make("textformat", get_string("helpformatting")));
+                echo $OUTPUT->help_icon("textformat", get_string("helpformatting"));
                 echo '</div>';
             }
         }
@@ -1418,7 +1418,7 @@ class assignment_base {
             echo '<label for="mailinfo">'.get_string('enableemailnotification','assignment').'</label>';
             echo '<input type="hidden" name="mailinfo" value="0" />';
             echo '<input type="checkbox" id="mailinfo" name="mailinfo" value="1" '.$lastmailinfo.' />';
-            echo $OUTPUT->help_icon(moodle_help_icon::make('emailnotification', get_string('enableemailnotification', 'assignment'), 'assignment')).'</p></div>';
+            echo $OUTPUT->help_icon('emailnotification', get_string('enableemailnotification', 'assignment'), 'assignment').'</p></div>';
             echo '</div>';
             echo '<div class="fastgbutton"><input type="submit" name="fastg" value="'.get_string('saveallfeedback', 'assignment').'" /></div>';
             echo '</div>';
@@ -1436,7 +1436,7 @@ class assignment_base {
         echo '</td>';
         echo '<td>';
         echo '<input type="text" id="perpage" name="perpage" size="1" value="'.$perpage.'" />';
-        echo $OUTPUT->help_icon(moodle_help_icon::make('pagesize', get_string('pagesize','assignment'), 'assignment'));
+        echo $OUTPUT->help_icon('pagesize', get_string('pagesize','assignment'), 'assignment');
         echo '</td></tr>';
         echo '<tr><td>';
         echo '<label for="quickgrade">'.get_string('quickgrade','assignment').'</label>';
@@ -1444,7 +1444,7 @@ class assignment_base {
         echo '<td>';
         $checked = $quickgrade ? 'checked="checked"' : '';
         echo '<input type="checkbox" id="quickgrade" name="quickgrade" value="1" '.$checked.' />';
-        echo $OUTPUT->help_icon(moodle_help_icon::make('quickgrade', get_string('quickgrade', 'assignment'), 'assignment')).'</p></div>';
+        echo $OUTPUT->help_icon('quickgrade', get_string('quickgrade', 'assignment'), 'assignment').'</p></div>';
         echo '</td></tr>';
         echo '<tr><td colspan="2">';
         echo '<input type="submit" value="'.get_string('savepreferences').'" />';
index 8bd8c71c417626edd55ddc9f305c3e05260ea399..5638204bec0e623c106bbb2b967b58d1fa4bcc59 100644 (file)
@@ -42,8 +42,8 @@ echo $OUTPUT->header();
     <form action="../empty.php" method="post" target="empty" id="inputForm"
           onsubmit="return empty_field_and_submit()" style="margin:0">
         <input type="text" id="input_chat_message" name="chat_message" size="50" value="" />
-        <?php echo $OUTPUT->help_icon(moodle_help_icon::make('chatting', get_string('helpchatting', 'chat'), 'chat', true)); ?><br />
-        <input type="checkbox" id="auto" size="50" value="" checked='true' /><label for="auto"><?php echo get_string('autoscroll', 'chat');?></label>
+        <?php echo $OUTPUT->help_icon('chatting', get_string('helpchatting', 'chat'), 'chat', true); ?><br />
+        <input type="checkbox" id="auto" size="50" value="" checked="checked" /><label for="auto"><?php echo get_string('autoscroll', 'chat');?></label>
     </form>
 
     <form action="insert.php" method="post" target="empty" id="sendForm">
index c772ca3ba22fef65d0ab5a197dc468c5b8e3fd10..0439208e52580c7d4dd22bfd80b5524e6c9808df 100644 (file)
@@ -29,7 +29,7 @@ echo $OUTPUT->header();
     <form action="../empty.php" method="get" target="empty" id="inputform"
           onsubmit="return empty_field_and_submit();">
         <input type="text" name="chat_message" id="chat_message" size="60" value="" />
-        <?php echo $OUTPUT->help_icon(moodle_help_icon::make("chatting", get_string("helpchatting", "chat"), "chat", true)); ?>
+        <?php echo $OUTPUT->help_icon("chatting", get_string("helpchatting", "chat"), "chat", true); ?>
     </form>
 
     <form action="<?php echo "http://$CFG->chat_serverhost:$CFG->chat_serverport/"; ?>" method="get" target="empty" id="sendform">
index b6c91db4a21ecce05fa4b1ec9b683e868011bc3a..9bb1d766017ee38102b57999018b9e40765d8789 100755 (executable)
@@ -333,7 +333,7 @@ if (has_capability('mod/data:manageentries',$context)) {
         echo '<tr>';
         echo '<td align="right">'.get_string('csvfile', 'data').':</td>';
         echo '<td><input type="file" name="recordsfile" size="30" />';
-        echo $OUTPUT->help_icon(moodle_help_icon::make('importcsv', get_string('csvimport', 'data'), 'data'));
+        echo $OUTPUT->help_icon('importcsv', get_string('csvimport', 'data'), 'data');
         echo '</td><tr>';
         echo '<td align="right">'.get_string('fielddelimiter', 'data').':</td>';
         echo '<td><input type="text" name="fielddelimiter" size="6" />';
index 23cfce676e9020f51237611ec7004e8f29f7f349..2c6f27631796f4bc74f93499ed4937f3f951aef6 100755 (executable)
@@ -306,7 +306,7 @@ if (($mode == 'new') && (!empty($newtype)) && confirm_sesskey()) {          ///
     echo '<label for="fieldform_jump">'.get_string('newfield','data').'</label>';
     $popupurl = $CFG->wwwroot.'/mod/data/field.php?d='.$data->id.'&mode=new&sesskey='.  sesskey();
     echo $OUTPUT->select(html_select::make_popup_form($popupurl, 'newtype', $menufield, "fieldform"));
-    echo $OUTPUT->help_icon(moodle_help_icon::make('fields', get_string('addafield','data'), 'data'));
+    echo $OUTPUT->help_icon('fields', get_string('addafield','data'), 'data');
     echo '</div>';
 
     echo '<div class="sortdefault">';
index a6d3eaa44bdb5619dd9674e0750746fe37729667..22caa2af90f4f57fa3a240a76d9c777f9f17e7cd 100755 (executable)
@@ -73,7 +73,7 @@ class data_field_textarea extends data_field_base {
             $str .= '<option value="'.s($key).'" '.$selected.'>'.$desc.'</option>';
         }
         $str .= '</select>';
-        $str .= $OUTPUT->help_icon(moodle_help_icon::make('textformat', get_string('helpformatting'), 'moodle'));
+        $str .= $OUTPUT->help_icon('textformat', get_string('helpformatting'), 'moodle');
         $str .= '</div>';
 
         $str .= '</div>';
index a62bc8fbae2d354edd7e4f2ad42340b4354f0a86..fc3c85fad40b8373212bc761673879a44f37dbdb 100755 (executable)
@@ -1549,7 +1549,7 @@ function data_print_ratings($data, $record) {
 
             if ($data->scale < 0) {
                 if ($scale = $DB->get_record('scale', array('id'=>abs($data->scale)))) {
-                    echo $OUTPUT->help_button(moodle_help_icon::make_scale_menu($data->course, $scale));
+                    echo $OUTPUT->help_icon_scale($data->course, $scale);
                 }
             }
 
@@ -2214,7 +2214,7 @@ class PresetImporter {
 
         if (!empty($currentfields) && !empty($newfields)) {
             echo "<h3>$strfieldmappings ";
-            echo $OUTPUT->help_icon(moodle_help_icon::make('fieldmappings', $strfieldmappings, 'data'));
+            echo $OUTPUT->help_icon('fieldmappings', $strfieldmappings, 'data');
             echo '</h3><table>';
 
             foreach ($newfields as $nid => $newfield) {
index 6d3bf2ae23af9a2ad493d9a4a14755afe44b2a81..863b47ef3860cab931e5ba82319546a92f7f6a26 100644 (file)
@@ -333,7 +333,7 @@ echo '<table class="presets" cellpadding="5">';
 echo '<tr><td valign="top" colspan="2" align="center"><h3>'.$strexport.'</h3></td></tr>';
 
 echo '<tr><td><label>'.$strexportaszip.'</label>';
-echo $OUTPUT->help_icon(moodle_help_icon::make('exportzip', get_string('help'), 'data', false));
+echo $OUTPUT->help_icon('exportzip', get_string('help'), 'data', false);
 echo '</td><td>';
 $options = array();
 $options['sesskey'] = sesskey();
@@ -343,7 +343,7 @@ echo $OUTPUT->button(html_form::make_button('preset.php', $options, $strexport))
 echo '</td></tr>';
 
 echo '<tr><td><label>'.$strsaveaspreset.'</label>';
-echo $OUTPUT->help_icon(moodle_help_icon::make('savepreset', get_string('help'), 'data', false));
+echo $OUTPUT->help_icon('savepreset', get_string('help'), 'data', false);
 echo '</td><td>';
 $options = array();
 $options['sesskey'] = sesskey();
@@ -353,7 +353,7 @@ echo $OUTPUT->button(html_form::make_button('preset.php', $options, $strsave));
 echo '</td></tr>';
 echo '<tr><td valign="top" colspan="2" align="center"><h3>'.$strimport.'</h3></td></tr>';
 echo '<tr><td><label for="fromfile">'.$strfromfile.'</label>';
-echo $OUTPUT->help_icon(moodle_help_icon::make('importfromfile', get_string('help'), 'data', true));
+echo $OUTPUT->help_icon('importfromfile', get_string('help'), 'data', true);
 echo '</td><td>';
 echo '<form id="uploadpreset" method="post" action="preset.php">';
 echo '<fieldset class="invisiblefieldset">';
@@ -366,7 +366,7 @@ echo '</fieldset></form>';
 echo '</td></tr>';
 
 echo '<tr valign="top"><td><label>'.$strusestandard.'</label>';
-echo $OUTPUT->help_icon(moodle_help_icon::make('usepreset', get_string('help'), 'data', true));
+echo $OUTPUT->help_icon('usepreset', get_string('help'), 'data', true);
 echo '</td><td>';
 
 echo '<form id="presets" method="post" action="preset.php" >';
index b486af70a3f57f632c41014a544b73e3994852f9..1344d366bc223c2e681c1d81c4025e41f57b7e30 100755 (executable)
@@ -203,7 +203,7 @@ echo '<tr><td valign="top">';
 if ($mode != 'csstemplate' and $mode != 'jstemplate') {
     // Add all the available fields for this data.
     echo '<label for="availabletags">'.get_string('availabletags','data').'</label>';
-    echo $OUTPUT->help_icon(moodle_help_icon::make('tags', get_string('tags'), 'data'));
+    echo $OUTPUT->help_icon('tags', get_string('tags'), 'data');
     echo '<br />';
 
 
index 4636414d515d6182b47127f60b8b39e5e6ed6c8a..950a4f0767d48bc16e6d5f452e8c111a15de1242 100644 (file)
@@ -142,11 +142,7 @@ if($check_anonymously) {
         echo '</table>';
     }
 }else {
-    $helpicon = new moodle_help_icon();
-    $helpicon->text = get_string('insufficient_responses_for_this_group', 'feedback');
-    $helpicon->page = 'insufficient_responses';
-    $helpicon->module = 'feedback';
-    echo $OUTPUT->heading_with_help($helpicon);
+    echo $OUTPUT->heading_with_help(get_string('insufficient_responses_for_this_group', 'feedback'), 'insufficient_responses', 'feedback');
 }
 echo '</td></tr></table></div>';
 echo $OUTPUT->box_end();
index f6c082942f33d469c18e1d1089b889992ba669e2..32d2a7575fdb78e32c072538b6b5b24e80244965 100644 (file)
@@ -211,7 +211,7 @@ if($do_show == 'edit') {
     if(is_array($feedbackitems)){
         $itemnr = 0;
 
-        $helpbutton = $OUTPUT->help_icon(moodle_help_icon::make('preview', get_string('preview','feedback'), 'feedback',true));
+        $helpbutton = $OUTPUT->help_icon('preview', get_string('preview','feedback'), 'feedback',true);
 
         echo $OUTPUT->heading($helpbutton . get_string('preview', 'feedback'));
         if(isset($SESSION->feedback->moving) AND $SESSION->feedback->moving->shouldmoving == 1) {
index 8b413d162e36f727919e4dac2ce12ca129185975..3ef6922b3e535ebfabf94448950bbf7140d4d716 100644 (file)
@@ -97,14 +97,14 @@ if (($courses = $DB->get_records_sql_menu($sql, $params)) && !empty($searchcours
     echo ' ' . get_string('courses') . ': ';
     echo $OUTPUT->select(html_select::make ($courses, 'coursefilter', $coursefilter));
     echo '<input type="submit" value="'.get_string('mapcourse', 'feedback').'"/>';
-    echo $OUTPUT->help_icon(moodle_help_icon::make('mapcourses', '', 'feedback', true));
+    echo $OUTPUT->help_icon('mapcourses', '', 'feedback', true);
     echo '<input type="button" value="'.get_string('searchagain').'" onclick="document.location=\'mapcourse.php?id='.$id.'\'"/>';
     echo '<input type="hidden" name="searchcourse" value="'.$searchcourse.'"/>';
     echo '<input type="hidden" name="feedbackid" value="'.$feedback->id.'"/>';
-    echo $OUTPUT->help_icon(moodle_help_icon::make('searchcourses', '', 'feedback', true));
+    echo $OUTPUT->help_icon('searchcourses', '', 'feedback', true);
 } else {
     echo '<input type="text" name="searchcourse" value="'.$searchcourse.'"/> <input type="submit" value="'.get_string('searchcourses').'"/>';
-    echo $OUTPUT->help_icon(moodle_help_icon::make('searchcourses', '', 'feedback', true));
+    echo $OUTPUT->help_icon('searchcourses', '', 'feedback', true);
 }
 
 echo '</form>';
index 8b0bac6dc3132cfe38825edd7f8f9f0c90cb6a2a..c3b029f1e0088b21eeffcf15b9fdc0948da38b4a 100644 (file)
@@ -112,7 +112,7 @@ if($do_show == 'showentries'){
         if($feedback->course == SITEID){
             echo '<div class="mdl-align"><a href="'.htmlspecialchars('analysis_course.php?id=' . $id . '&courseid='.$courseid).'">';
             echo get_string('course') .' '. get_string('analysis', 'feedback') . ' ('.get_string('completed_feedbacks', 'feedback').': '.intval($completedFeedbackCount).')</a>';
-            echo $OUTPUT->help_icon(moodle_help_icon::make('viewcompleted', '', 'feedback', true));
+            echo $OUTPUT->help_icon('viewcompleted', '', 'feedback', true);
             echo '</div>';
         }else {
             echo '<div class="mdl-align"><a href="'.htmlspecialchars('analysis.php?id=' . $id . '&courseid='.$courseid).'">';
index 882c0069be5506ae8def046eab5f7f90653d71d9..562b97b8c0fc458a053058de3365f37ed4a9ded6 100644 (file)
@@ -136,7 +136,7 @@ if($capabilities->mapcourse) {
         echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
         echo '<input type="hidden" name="id" value="'.$id.'" />';
         echo '<button type="submit">'.get_string('mapcourses', 'feedback').'</button>';
-        echo $OUTPUT->help_icon(moodle_help_icon::make('mapcourse', '', 'feedback', true));
+        echo $OUTPUT->help_icon('mapcourse', '', 'feedback', true);
         echo '</form>';
         echo '<br />';
         echo '</div>';
index da9601f69b63157c058dcb6c9a2927cfc03bff38..beab9d6088cbd491ed4870d40fe38e74752e8cac 100644 (file)
@@ -4212,7 +4212,7 @@ function forum_search_form($course, $search='') {
     $output  = '<div class="forumsearch">';
     $output .= '<form action="'.$CFG->wwwroot.'/mod/forum/search.php" style="display:inline">';
     $output .= '<fieldset class="invisiblefieldset">';
-    $output .= $OUTPUT->help_icon(moodle_help_icon::make('search', get_string('search')));
+    $output .= $OUTPUT->help_icon('search', get_string('search'));
     $output .= '<input name="search" type="text" size="18" value="'.s($search, true).'" alt="search" />';
     $output .= '<input value="'.get_string('searchforums', 'forum').'" type="submit" />';
     $output .= '<input name="id" type="hidden" value="'.$course->id.'" />';
@@ -5890,7 +5890,7 @@ function forum_print_discussion($course, $cm, $forum, $discussion, $post, $mode,
             }
             if ($forum->scale < 0) {
                 if ($scale = $DB->get_record("scale", array("id" => abs($forum->scale)))) {
-                    echo $OUTPUT->help_button(help_button::make_scale_menu($course->id, $scale));
+                    echo $OUTPUT->help_icon_scale($course->id, $scale);
                 }
             }
             echo '</div>';
@@ -8051,10 +8051,7 @@ function forum_extend_settings_navigation($settingsnav, $module=null) {
         if (forum_is_forcesubscribed($forumobject)) {
             $notekey = $forum->add(get_string("forcessubscribe", 'forum'));
             $string = get_string('allowchoice', 'forum');
-            $helpbutton = new moodle_help_icon();
-            $helpbutton->page = "subscription";
-            $helpbutton->text = $string;
-            $helpbutton->module = "forum";
+            $helpbutton = $OUTPUT->help_icon("subscription", $string, "forum");
             if (has_capability('mod/forum:managesubscriptions', $PAGE->cm->context)) {
                 $url = new moodle_url($CFG->wwwroot.'/mod/forum/subscribe.php', array('id'=>$forumobject->id, 'force'=>'no'));
                 $forum->add($string, $url, navigation_node::TYPE_SETTING);
@@ -8064,18 +8061,11 @@ function forum_extend_settings_navigation($settingsnav, $module=null) {
         } else if ($forumobject->forcesubscribe == FORUM_DISALLOWSUBSCRIBE) {
             $string = get_string('disallowsubscribe', 'forum');
             $notekey = $forum->add($string);
-            $helpbutton = new moodle_help_icon();
-            $helpbutton->page = "subscription";
-            $helpbutton->text = $string;
-            $helpbutton->module = "forum";
+            $helpbutton = $OUTPUT->help_icon("subscription", $string, "forum");
         } else {
             $string = get_string("forcesubscribe", "forum");
             $notekey = $forum->add(get_string("allowsallsubscribe", 'forum'));
-
-            $helpbutton = new moodle_help_icon();
-            $helpbutton->page = "subscription";
-            $helpbutton->text = $string;
-            $helpbutton->module = "forum";
+            $helpbutton = $OUTPUT->help_icon("subscription", $string, "forum");
 
             if (has_capability('mod/forum:managesubscriptions', $PAGE->cm->context)) {
                 $url = new moodle_url($CFG->wwwroot.'/mod/forum/subscribe.php', array('id'=>$forumobject->id, 'force'=>'yes'));
@@ -8113,7 +8103,7 @@ function forum_extend_settings_navigation($settingsnav, $module=null) {
         if ($notekey!==false) {
             $forum->get($notekey)->add_class('note');
             if ($helpbutton!==false) {
-                $forum->get($notekey)->helpbutton = $OUTPUT->help_icon($helpbutton);
+                $forum->get($notekey)->helpbutton = $helpbutton;
             }
         }
         if (has_capability('moodle/course:manageactivities', $PAGE->cm->context)) {
index f6d8a322e9f385e86ff73ed2f0cd42e8c81959f9..b07eebe59875b1c22de4b701ff54c43ae4af67f2 100644 (file)
@@ -175,7 +175,7 @@ class mod_forum_mod_form extends moodleform_mod {
         //we want the form to display them if they are set.
         if ($typevalue[0]=='news') {
             $type->addOption(get_string('namenews', 'forum'), 'news');
-            $type->setHelpButton(array('forumtypenews', get_string('forumtype', 'forum'), 'forum'));
+            $mform->setHelpButton('type', array('forumtypenews', get_string('forumtype', 'forum'), 'forum'));
             $type->freeze();
             $type->setPersistantFreeze(true);
         }
index 6dd0520389658240da54a22b105925a9e9b08ea4..258ede1e78373f0e7fe927f68683001b275243ff 100644 (file)
@@ -27,7 +27,7 @@
        }
        ?>><?php echo get_string("no") ?>
       </option>
-      </select> <?php echo $OUTPUT->help_icon(moodle_help_icon::make("linkcategory", get_string("linkcategory", "glossary"), "glossary")) ?>
+      </select> <?php echo $OUTPUT->help_icon("linkcategory", get_string("linkcategory", "glossary"), "glossary") ?>
     </td>
 </tr>
 <tr>
index 60dfc17e4ca758976c78b1ee140f7aad9149a395..312f5970819659329ba70927ee6d84fc8a020acd 100644 (file)
@@ -6,7 +6,7 @@
            echo '(';
            print_string("maxsize", "", display_size(get_max_upload_file_size($CFG->maxbytes, $course->maxbytes)));
            echo ') ';
-           echo $OUTPUT->help_icon(moodle_help_icon::make("filetoimport", get_string("filetoimport", "glossary"), "glossary"));
+           echo $OUTPUT->help_icon("filetoimport", get_string("filetoimport", "glossary"), "glossary");
         ?>
     </b></td>
     <td style="width:70%">
         <td style="width:25%"><select size="1" name="dest">
         <option selected="selected" value="current"><?php print_string("currentglossary","glossary") ?></option>
         <option value="new"><?php print_string("newglossary","glossary") ?></option>
-        </select> <?php echo $OUTPUT->help_icon(moodle_help_icon::make("destination", get_string("destination", "glossary"), "glossary")) ?></td>
+        </select> <?php echo $OUTPUT->help_icon("destination", get_string("destination", "glossary"), "glossary") ?></td>
         <td style="width:25%" align="right"><?php print_string("importcategories","glossary") ?>:</td>
         <td style="width:25%"><input type="checkbox" name="catsincl" value="1" alt="<?php print_string("importcategories","glossary") ?>" />
-            <?php echo $OUTPUT->help_icon(moodle_help_icon::make("importcategories", get_string("importcategories", "glossary"), "glossary")) ?>
+            <?php echo $OUTPUT->help_icon("importcategories", get_string("importcategories", "glossary"), "glossary") ?>
         </td>
       </tr>
     </table>
index 390684731a04d2e8a2768b4c12f987d713a768d0..f8640e8374b16d967fdcccab52792e3ea6ac3f3b 100644 (file)
@@ -500,7 +500,7 @@ if ($ratingsmenuused) {
     echo "<div class=\"boxaligncenter\"><input type=\"submit\" value=\"".get_string("sendinratings", "glossary")."\" />";
     if ($glossary->scale < 0) {
         if ($scale = $DB->get_record("scale", array("id"=>abs($glossary->scale)))) {
-            echo $OUTPUT->help_button(help_button::make_scale_menu($course->id, $scale));
+            echo $OUTPUT->help_icon_scale($course->id, $scale);
         }
     }
     echo "</div>";
index 72727071ce202e23aaff647b5d179299f2bc5711..62b3b49aa5d40da3e21346ac06ddece8813cbd78 100644 (file)
@@ -548,7 +548,7 @@ function hotpot_print_report_selector(&$course, &$hotpot, &$formdata) {
     );
 
     print '<tr><td>';
-    echo $OUTPUT->help_icon(moodle_help_icon::make('reportcontent', get_string('reportcontent', 'hotpot'), 'hotpot'));
+    echo $OUTPUT->help_icon('reportcontent', get_string('reportcontent', 'hotpot'), 'hotpot');
     print '</td><th align="right" scope="col">'.get_string('reportcontent', 'hotpot').':</th><td colspan="7">';
     foreach ($menus as $name => $options) {
         $value = $formdata[$name];
@@ -587,7 +587,7 @@ function hotpot_print_report_selector(&$course, &$hotpot, &$formdata) {
     );
 
     print '<tr><td>';
-    echo $OUTPUT->help_icon(moodle_help_icon::make('reportformat', get_string('reportformat', 'hotpot'), 'hotpot'));
+    echo $OUTPUT->help_icon('reportformat', get_string('reportformat', 'hotpot'), 'hotpot');
     print '</td>';
     foreach ($menus as $name => $options) {
         $value = $formdata[$name];
index 0b7cbe1cf1e8c386105b23b0eaab516a56430e99..95974bdd89469e3435f4e6b82796741154eceaf3 100644 (file)
@@ -136,7 +136,7 @@ class hotpot_report extends hotpot_default_report {
                                                        if (empty($table->caption)) {
                                                                $table->caption = get_string('indivresp', 'quiz');
                                                                if ($is_html) {
-                                                                       $table->caption .= $OUTPUT->help_icon(moodle_help_icon::make('responsestable', $table->caption, 'hotpot'));
+                                                                       $table->caption .= $OUTPUT->help_icon('responsestable', $table->caption, 'hotpot');
                                                                }
                                                        }
                                                        $hints = empty($response->hints) ? 0 : $response->hints;
@@ -260,14 +260,14 @@ class hotpot_report extends hotpot_default_report {
                        $br = $is_html ? '<br />' : "\n";
                        $space = $is_html ? '&nbsp;' : "";
                        $no_value = $is_html ? '--' : "";
-                       $help_button = $is_html ? $OUTPUT->help_icon(moodle_help_icon::make("discrimination", get_string('discrimination', 'quiz'), "quiz")) : "";
+                       $help_button = $is_html ? $OUTPUT->help_icon("discrimination", get_string('discrimination', 'quiz'), "quiz") : "";
                        // table properties
                        unset($table);
                        $table->border = 1;
                        $table->width = '100%';
                        $table->caption = get_string('itemanal', 'quiz');
                        if ($is_html) {
-                               $table->caption .= $OUTPUT->help_icon(moodle_help_icon::make('analysistable', $table->caption, 'hotpot'));
+                               $table->caption .= $OUTPUT->help_icon('analysistable', $table->caption, 'hotpot');
                        }
                        // initialize legend, if necessary
                        if (!empty($options['reportshowlegend'])) {
index 3811f22563239e2a4682355ab758c7cbb98a506f..548146cb609575165e54d2c1785b267156017458 100644 (file)
@@ -62,11 +62,7 @@ $mform->set_data($data);
     $PAGE->set_heading($strimportquestions);
     echo $OUTPUT->header();
 
-$helpicon = new moodle_help_icon();
-$helpicon->text = $strimportquestions;
-$helpicon->page = "import";
-$helpicon->module = "lesson";
-echo $OUTPUT->heading_with_help($helpicon);
+echo $OUTPUT->heading_with_help($strimportquestions, 'import', 'lesson' );
 
 if ($data = $mform->get_data()) {
 
index 42e1a6b83c46a9f87e50ad0b439e0c9bbc46c738..0238a1746e27f7af637c9a265e0b0332d1ef58de 100644 (file)
@@ -205,12 +205,7 @@ $PAGE->set_heading($strimportppt);
 echo $OUTPUT->header();
 
 /// Print upload form
-$helpicon = new moodle_help_icon();
-$helpicon->text = $strimportppt;
-$helpicon->page = "importppt";
-$helpicon->module = "lesson";
-
-echo $OUTPUT->heading_with_help($helpicon);
+echo $OUTPUT->heading_with_help($strimportppt, 'importppt', 'lesson');
 echo $OUTPUT->box_start('generalbox boxaligncenter');
 $mform->display();
 echo $OUTPUT->box_end();
index e02d9601a9adae8c6d45434bf334019bd515e6d7..2f4ff0c0ce4e9eb78d4859c235ca04044f9b9589 100644 (file)
@@ -455,7 +455,7 @@ function lesson_mediafile_block_contents($cmid, $lesson) {
     $link->title = get_string('mediafilepopup', 'lesson');
     $content = $OUTPUT->link($link);
 
-    $content .= $OUTPUT->help_icon(moodle_help_icon::make("mediafilestudent", get_string("mediafile", "lesson"), "lesson"));
+    $content .= $OUTPUT->help_icon("mediafilestudent", get_string("mediafile", "lesson"), "lesson");
 
     $bc = new block_contents();
     $bc->title = get_string('linkedmedia', 'lesson');
index 98879c31fe4430d156fc8740caab7d267b87a1c0..2b238dcde6eff8fd522ff71725056248c60ef488 100644 (file)
@@ -49,13 +49,7 @@ class mod_lesson_renderer extends plugin_renderer_base {
         $output = $this->output->header();
 
         if (has_capability('mod/lesson:manage', $context)) {
-
-            $helpicon = new moodle_help_icon();
-            $helpicon->text = $activityname;
-            $helpicon->page = "overview";
-            $helpicon->module = "lesson";
-
-            $output .= $this->output->heading_with_help($helpicon);
+            $output .= $this->output->heading_with_help($activityname, 'overview', 'lesson');
 
             if (!empty($currenttab)) {
                 ob_start();
index 0a3a2ac0c2799206a7aee41a88e86017e044b830..a1bf2e3563f6f6a5ac682e26a463c10744266216 100644 (file)
@@ -106,7 +106,7 @@ function module_specific_controls($totalnumber, $recurse, $category, $cmid, $cmo
             $out .= '<input type="hidden" name="categoryid" value="' . $category->id . '" />';
             $out .= ' <input type="submit" name="addrandom" value="'.
                     $straddtoquiz.'" '.$disabled.' />';
-            $out .= $OUTPUT->help_icon(moodle_help_icon::make('random', get_string('random', 'quiz'), 'quiz'));
+            $out .= $OUTPUT->help_icon('random', get_string('random', 'quiz'), 'quiz');
         }
     }
     return $out;
@@ -516,7 +516,7 @@ if ($quiz_reordertool) {
     echo '</div>';
 }
 echo $OUTPUT->heading($pagetitle.": ".$quiz->name, 2);
-echo $OUTPUT->help_icon(moodle_help_icon::make('editconcepts', get_string('basicideasofquiz', 'quiz'), 'quiz', get_string('basicideasofquiz', 'quiz')));
+echo $OUTPUT->help_icon('editconcepts', get_string('basicideasofquiz', 'quiz'), 'quiz', true);
 quiz_print_status_bar($quiz);
 
 $tabindex = 0;
index 9f65e0a3cde2f02d39e3a6e0691e681f065ba339..9b784237e3c4187ef67b5c7b6757f9c0d33500e0 100644 (file)
@@ -676,7 +676,7 @@ function quiz_print_pagecontrols($quiz, $pageurl, $page, $hasattempts) {
             </div>
         </form>
     </div>
-    <?php echo $OUTPUT->help_icon(moodle_help_icon::make('random', get_string('random', 'quiz'), 'quiz')); ?>
+    <?php echo $OUTPUT->help_icon('random', get_string('random', 'quiz'), 'quiz'); ?>
     <?php
     echo "\n</div>";
 }
@@ -1144,7 +1144,7 @@ function quiz_print_grading_form($quiz, $pageurl, $tabindex) {
     echo '<label for="inputmaxgrade">' . get_string('maximumgradex', '', $a) . "</label>";
     echo '<input type="hidden" name="savechanges" value="save" />';
     echo '<input type="submit" value="' . $strsave . '" />';
-    echo $OUTPUT->help_icon(moodle_help_icon::make('maxgrade', get_string('maximumgrade'), 'quiz'));
+    echo $OUTPUT->help_icon('maxgrade', get_string('maximumgrade'), 'quiz');
     echo '</fieldset>';
     echo "</div></form>\n";
     return $tabindex + 1;
index 8cf076fd807e9577dec718d03785883d6ef703fd..591b263cf90251b990dde740d0f9e719fcf02118 100644 (file)
@@ -823,16 +823,13 @@ function quiz_question_preview_button($quiz, $question, $label = false) {
     }
 
     // Build the icon.
-    $image = new html_image();
-    $image->src = $OUTPUT->pix_url('t/preview');
-    $image->add_class('iconsmall');
-    $image->alt = $strpreviewquestion;
+    $image = $OUTPUT->image($OUTPUT->pix_url('t/preview'), array('class'=>'iconsmall', 'alt'=>$strpreviewquestion));
 
-    $link = html_link::make("/question/preview.php?id=$question->id&quizid=$quiz->id", $strpreviewlabel);
+    $link = new html_link($CFG->wwwroot."/question/preview.php?id=$question->id&quizid=$quiz->id", $image, array('title' => $strpreviewquestion));
     parse_str(QUESTION_PREVIEW_POPUP_OPTIONS, $options);
     $link->add_action(new popup_action('click', $link->url, 'questionpreview', $options));
-    $link->title = $strpreviewquestion;
-    return $OUTPUT->link_to_popup($link, $image);
+
+    return $OUTPUT->link($link);
 }
 
 /**
index 3d1921e1036fa025ca93b5e783519a5e548f5230..1ea18cdd39269ed2b248bc392f7a6c9ab536a718 100644 (file)
@@ -2,7 +2,6 @@
 /**
  * This script calculates various statistics about student attempts
  *
- * @version $Id$
  * @author Martin Dougiamas, Jamie Pratt, Tim Hunt and others.
  * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
  * @package quiz
@@ -422,7 +421,7 @@ class quiz_statistics_report extends quiz_default_report {
             $select = html_select::make($downloadoptions, 'download', $this->table->defaultdownloadformat, false);
             $select->nothingvalue = '';
             $quizinformationtablehtml .= $OUTPUT->select($select);;
-            $quizinformationtablehtml .= $OUTPUT->help_icon(moodle_help_icon::make('tableexportformats', get_string('tableexportformats', 'table')));
+            $quizinformationtablehtml .= $OUTPUT->help_icon('tableexportformats', get_string('tableexportformats', 'table'));
             $quizinformationtablehtml .= '</div></form>';
         }
         $quizinformationtablehtml .= $OUTPUT->table($quizinformationtable);
index 3f9c1ba04a7208553b4ea279cd0e56c5fccf2ea7..ef79cc51f8e3f2ddf2f40aca0df86db0ae138e66 100644 (file)
@@ -146,7 +146,7 @@ class quiz_report_statistics_table extends flexible_table {
             if ($question->_stats->negcovar){
                 $negcovar = get_string('negcovar', 'quiz_statistics');
                 if (!$this->is_downloading()){
-                    $negcovar .= $OUTPUT->help_icon(moodle_help_icon::make('negcovar', $negcovar, 'quiz_statistics'));
+                    $negcovar .= $OUTPUT->help_icon('negcovar', $negcovar, 'quiz_statistics');
                     return '<div class="negcovar">'.$negcovar.'</div>';
                 } else {
                     return $negcovar;
index b297e78ad19d94fd3566caa4a2e32b69cbe1ad0b..2897dd1d4e37f67346172b0f5c990d13e75d101e 100644 (file)
     // Do the Action
     # "setpageflags", "removepages", "strippages", "checklinks", "revertpages"
 
-    $helpicon = new moodle_help_icon();
-    $helpicon->text = get_string($action,"wiki");
-    $helpicon->page = $action;
-    $helpicon->module = "wiki";
-    echo $OUTPUT->heading_with_help($helpicon);
+    echo $OUTPUT->heading_with_help(get_string($action,"wiki"), $action, 'wiki');
 
     include $action.".html";
     echo $OUTPUT->box_end();
index 8b3f4527a48714ee097240eb08b515f2257adf37..b23e2cbf63a40b25a8d55f047a1523d5f564e456 100644 (file)
@@ -28,7 +28,7 @@ if($err->remark) {
     <td>
         <input type="text" name="authorfieldpattern" size="30" value="<?php p($form->authorfieldpattern) ?>" />
 <?php
-        echo $OUTPUT->help_icon(moodle_help_icon::make('revertauthorfieldpattern', get_string('authorfieldpattern', 'wiki'), 'wiki'));
+        echo $OUTPUT->help_icon('revertauthorfieldpattern', get_string('authorfieldpattern', 'wiki'), 'wiki');
         if (!empty($err->authorfieldpattern)) { echo $OUTPUT->error_text($err->authorfieldpattern); }
 ?>
     </td>
index 2109d2a336f61efad6823e44c892c46b827f60fa..a0010f19a39584552bdbd4484db449f3bd065ebe 100644 (file)
 
         /// Formatting Rules
         echo '<td class="howtowiki">';
-        echo $OUTPUT->help_icon(moodle_help_icon::make('howtowiki', get_string('howtowiki', 'wiki'), 'wiki'));
+        echo $OUTPUT->help_icon('howtowiki', get_string('howtowiki', 'wiki'), 'wiki');
         echo '</td>';
 
         echo '</tr></table>';
index 0f703bcb1a3ae617f2f561d0a86b760eced8741e..33c3e53dff55ce5ee021b722d629407f4bc56385 100644 (file)
@@ -257,11 +257,7 @@ class question_category_object {
     public function output_edit_lists() {
         global $OUTPUT;
 
-        $helpicon = new moodle_help_icon();
-        $helpicon->text = get_string('editcategories', 'quiz');
-        $helpicon->page = 'categories';
-        $helpicon->module = 'question';
-        echo $OUTPUT->heading_with_help($helpicon);
+        echo $OUTPUT->heading_with_help(get_string('editcategories', 'quiz'), 'categories', 'question'); 
 
         foreach ($this->editlists as $context => $list){
             $listhtml = $list->to_html(0, array('str'=>$this->str));
index 07d66f09dcbe63a6ab8ca910bc26330bf81510ca..937d1fd9d00daff5c397cb7ded6d281414e87ae2 100644 (file)
@@ -625,16 +625,14 @@ class question_bank_preview_action_column extends question_bank_action_column_ba
     protected function display_content($question, $rowclasses) {
         global $OUTPUT;
         if (question_has_capability_on($question, 'use')) {
-            parse_str(QUESTION_PREVIEW_POPUP_OPTIONS, $options);
-            $image = new html_image();
-            $image->src = $OUTPUT->pix_url('t/preview');
-            $image->add_class('iconsmall');
-            $image->alt = $this->strpreview;
+            // Build the icon.
+            $image = $OUTPUT->image($OUTPUT->pix_url('t/preview'), array('class'=>'iconsmall', 'alt'=>$this->strpreview));
 
-            $link = html_link::make($this->qbank->preview_question_url($question->id), $this->strpreview);
+            $link = new html_link($this->qbank->preview_question_url($question->id), $image, array('title' => $this->strpreview));
+            parse_str(QUESTION_PREVIEW_POPUP_OPTIONS, $options);
             $link->add_action(new popup_action('click', $link->url, 'questionpreview', $options));
-            $link->title = $this->strpreview;
-            echo $OUTPUT->link_to_popup($link, $image);
+        
+            echo $OUTPUT->link($link);
         }
     }
 
@@ -1934,7 +1932,7 @@ function create_new_question_button($categoryid, $params, $caption, $tooltip = '
     $form->button->disabled = $disabled;
     echo $OUTPUT->button($form);
 
-    echo $OUTPUT->help_icon(moodle_help_icon::make('types', get_string('createnewquestion', 'question'), 'question'));
+    echo $OUTPUT->help_icon('types', get_string('createnewquestion', 'question'), 'question');
     $PAGE->requires->yui2_lib('dragdrop');
     $PAGE->requires->yui2_lib('container');
     if (!$choiceformprinted) {
index 7a57c4a362be36858f58666f635047ff2b694f31..b5cc0ec26f9bf5cb64005d5650f1d481cff7e155 100644 (file)
     }
 
     /// Display export form
-    $helpicon = new moodle_help_icon();
-    $helpicon->text = $strexportquestions;
-    $helpicon->page = 'export';
-    $helpicon->module = 'quiz';
-    echo $OUTPUT->heading_with_help($helpicon);
+    echo $OUTPUT->heading_with_help($strexportquestions, 'export', 'quiz');
 
     $export_form->display();
 
index 4a52accfa8da0eeb287e748bdbedb3d37d3cfc32..f98d2071aedd992ca30c98a20615de200b6c6c46 100644 (file)
@@ -16,7 +16,7 @@ class question_export_form extends moodleform {
         $radioarray = array();
         foreach ($fileformatnames as $shortname => $fileformatname) {
             $radioelement = &MoodleQuickForm::createElement('radio','format','',$fileformatname,$shortname);
-            $radioelement->setHelpButton(array("$shortname",$fileformatname,"qformat_$shortname"));
+            $mform->setHelpButton('format', array("$shortname",$fileformatname,"qformat_$shortname"));
             $radioarray[] = $radioelement;
         }
         $mform->addGroup($radioarray,'format','',array('<br />'),false);
index bde0415f0bd888975920e0b35192c8495ef12793..5fbc8ba2c9253d781c76f900e6f1fffa552634c1 100644 (file)
         }
     }
 
-    $helpicon = new moodle_help_icon();
-    $helpicon->text = $txt->importquestions;
-    $helpicon->page = 'import';
-    $helpicon->module = 'quiz';
-    echo $OUTPUT->heading_with_help($helpicon);
+    echo $OUTPUT->heading_with_help($txt->importquestions, 'import', 'quiz');
 
     /// Print upload form
     $import_form->display();
index c8841fe99adc807f858245b18e5287c060da3275..39effd2768f179ca359c2f811754a055017d56a9 100644 (file)
@@ -573,18 +573,10 @@ class question_calculated_qtype extends default_questiontype {
                 return;
                 break;
             case 'datasetdefinitions':
-                $helpicon = new moodle_help_icon();
-                $helpicon->text = get_string("choosedatasetproperties", "quiz");
-                $helpicon->page = 'questiondatasets';
-                $helpicon->module = 'quiz';
-                echo $OUTPUT->heading_with_help($helpicon);
+                echo $OUTPUT->heading_with_help(get_string("choosedatasetproperties", "quiz"), 'questiondatasets', 'quiz');
                 break;
             case 'datasetitems':
-                $helpicon = new moodle_help_icon();
-                $helpicon->text = get_string("editdatasets", "quiz");
-                $helpicon->page = 'questiondatasets';
-                $helpicon->module = 'quiz';
-                echo $OUTPUT->heading_with_help($helpicon);
+                echo $OUTPUT->heading_with_help(get_string("editdatasets", "quiz"), 'questiondatasets', 'quiz');
                 break;
         }
 
index 337ecc3d8503eaf405188cf35988a26271470724..c5e993d1b51b5528c2cf5da49a153f00e5e4db8f 100644 (file)
@@ -228,11 +228,7 @@ class default_questiontype {
         global $OUTPUT;
         $heading = $this->get_heading(empty($question->id));
 
-        $helpicon = new moodle_help_icon();
-        $helpicon->text = $heading;
-        $helpicon->page = $this->name();
-        $helpicon->module = $this->plugin_name();
-        echo $OUTPUT->heading_with_help($helpicon);
+        echo $OUTPUT->heading_with_help($heading, $this->name(), $this->plugin_name());
 
         $permissionstrs = array();
         if (!empty($question->id)){
index 9fa059edfe6776f0ec63bd89b9fdaa07021e6090..958501fbcd4e58e0136c15f3e975f878fd43c1d5 100644 (file)
@@ -89,11 +89,7 @@ class random_qtype extends default_questiontype {
 
     function display_question_editing_page(&$mform, $question, $wizardnow){
         $heading = $this->get_heading(empty($question->id));
-        $helpicon = new moodle_help_icon();
-        $helpicon->text = $heading;
-        $helpicon->page = $this->name();
-        $helpicon->module = $this->plugin_name();
-        echo $OUTPUT->heading_with_help($helpicon);
+        echo $OUTPUT->heading_with_help($heading, $this->name(), $this->plugin_name());
         $mform->display();
     }
 
index c7587c1e23a054eed2662a60f8fb8abe37e64429..9f7858f287ccbacfb3ae18da27355ed699d72dbb 100644 (file)
@@ -127,7 +127,7 @@ echo $OUTPUT->header();
 
         // Print the add and delete form
         coursetag_get_jscript();
-        $addtagshelp = $OUTPUT->help_icon(moodle_help_icon::make('addtags', 'adding tags', $tagslang));
+        $addtagshelp = $OUTPUT->help_icon('addtags', 'adding tags', $tagslang);
         $edittagthisunit = get_string('edittagthisunit', $tagslang);
         $arrowtitle = get_string('arrowtitle', $tagslang);
         $sesskey = sesskey();
@@ -160,7 +160,7 @@ echo $OUTPUT->header();
                     </div>
 EOT;
         if ($coursetabs) {
-            $deletetagshelp = $OUTPUT->help_icon(moodle_help_icon::make('deletetags', 'deleting tags', $tagslang));
+            $deletetagshelp = $OUTPUT->help_icon('deletetags', 'deleting tags', $tagslang);
             $editdeletemytag = get_string('editdeletemytag', $tagslang);
             $outstr .= <<<EOT1
                     <div class="coursetag_edit_row">
index b4f4a204e67e0268ceffb6a7e944bea5489d58e7..9060f6d0303da8d7d734fa8af001cb5d9b3e6ce1 100644 (file)
@@ -187,7 +187,7 @@ if (strlen($tags) < 10000) { $fclass = 'coursetag_more_large'; }
 $outstr = '
     <div class="coursetag_more_title">
         <div style="padding-bottom:5px">'.$welcome.
-            $OUTPUT->help_icon(moodle_help_icon::make('usingtags', 'using tags', $tagslang)).'
+            $OUTPUT->help_icon('usingtags', 'using tags', $tagslang).'
         </div>
         <div class="coursetag_more_link">'.$link1.'</div>
         <div class="coursetag_more_link">'.$link2.'</div>
index c090fe4126be3eb765d055bbc18929c76198c343..b216951bc14bf363cc412d2d66ac8d979dfb76f5 100644 (file)
@@ -100,8 +100,8 @@ echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
 echo '</fieldset>';
 $table = new html_table();
 $table->head  = array (get_string('fullname'),
-    get_string('content', 'notes') . $OUTPUT->help_icon(moodle_help_icon::make('writing', get_string('helpwriting'))),
-    get_string('publishstate', 'notes') . $OUTPUT->help_icon(moodle_help_icon::make('status', get_string('publishstate', 'notes'), 'notes')),
+    get_string('content', 'notes') . $OUTPUT->help_icon('writing', get_string('helpwriting')),
+    get_string('publishstate', 'notes') . $OUTPUT->help_icon('status', get_string('publishstate', 'notes'), 'notes'),
     );
 $table->align = array ('left', 'center', 'center');
 $state_names = note_get_state_names();
index 79fb79890c13934b7fdbb55512d3233eeb5e2a9c..1cc9e55d04d08ef9480e8e42056031fda33227dd 100644 (file)
@@ -138,7 +138,7 @@ if($course->enrollable == 2) {
 }
 
 $title = get_string('extendenrol');
-echo $OUTPUT->heading($title . $OUTPUT->help_icon(moodle_help_icon::make('extendenrol', $title)));
+echo $OUTPUT->heading($title . $OUTPUT->help_icon('extendenrol', $title));
 echo "<form method=\"post\" action=\"extendenrol.php\">\n";
 echo '<input type="hidden" name="id" value="'.$course->id.'" />';
 echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
index 73ba8ece582dd59459d3ef336e9fb78f152304f3..c8487e0392a187eea7d9f31a08bb6808de69426c 100644 (file)
@@ -47,7 +47,7 @@ class user_filter_courserole extends user_filter_type {
         $objs[] =& $mform->createElement('select', $this->_name .'_ct', null, $this->get_course_categories());
         $objs[] =& $mform->createElement('text', $this->_name, null);
         $grp =& $mform->addElement('group', $this->_name.'_grp', $this->_label, $objs, '', false);
-        $grp->setHelpButton(array('courserole', $this->_label, 'filters'));
+        $mform->setHelpButton($this->_name.'_grp', array('courserole', $this->_label, 'filters'));
         if ($this->_advanced) {
             $mform->setAdvanced($this->_name.'_grp');
         }
index 6052d99a63da47241d1adc2905d26369fba840b0..05ec451eda7098aab43b6b70f7db0c7176d82c8b 100755 (executable)
@@ -38,7 +38,7 @@ class user_filter_date extends user_filter_type {
         $objs[] = & $mform->createElement('checkbox', $this->_name.'_never', null, get_string('includenever', 'filters'));
 
         $grp =& $mform->addElement('group', $this->_name.'_grp', $this->_label, $objs, '', false);
-        $grp->setHelpButton(array('date',$this->_label,'filters'));
+        $mform->setHelpButton($this->_name.'_grp', array('date',$this->_label,'filters'));
 
         if ($this->_advanced) {
             $mform->setAdvanced($this->_name.'_grp');
index 60b8bcaf7018e9773f1e07520e1a40257532152d..4667332e14122028ac7ca024019c3c4bd9891b00 100644 (file)
@@ -33,7 +33,7 @@ class user_filter_globalrole extends user_filter_type {
      */
     function setupForm(&$mform) {
         $obj =& $mform->addElement('select', $this->_name, $this->_label, $this->get_roles());
-        $obj->setHelpButton(array('globalrole', $this->_label, 'filters'));
+        $mform->setHelpButton($this->_name, array('globalrole', $this->_label, 'filters'));
         $mform->setDefault($this->_name, 0);
         if ($this->_advanced) {
             $mform->setAdvanced($this->_name);
index 0bf759773b24b53fdeef936c2ce9070e7cd40940..a286c175c27dde97e2941f446a73bdadf9da7486 100644 (file)
@@ -62,7 +62,7 @@ class user_filter_profilefield extends user_filter_type {
         $objs[] =& $mform->createElement('select', $this->_name.'_op', null, $this->get_operators());
         $objs[] =& $mform->createElement('text', $this->_name, null);
         $grp =& $mform->addElement('group', $this->_name.'_grp', $this->_label, $objs, '', false);
-        $grp->setHelpButton(array('profilefield',$this->_label,'filters'));
+        $mform->setHelpButton($this->_name.'_grp', array('profilefield',$this->_label,'filters'));
         if ($this->_advanced) {
             $mform->setAdvanced($this->_name.'_grp');
         }
index f40dd9e46a457e9ffcabd568045d2b565a136173..71827b7c5cc77efad347ca0f13371c3295d677bd 100644 (file)
@@ -50,7 +50,7 @@ class user_filter_select extends user_filter_type {
         $objs[] =& $mform->createElement('select', $this->_name.'_op', null, $this->get_operators());
         $objs[] =& $mform->createElement('select', $this->_name, null, $this->_options);
         $grp =& $mform->addElement('group', $this->_name.'_grp', $this->_label, $objs, '', false);
-        $grp->setHelpButton(array('select', $this->_label, 'filters'));
+        $mform->setHelpButton($this->_name.'_grp', array('select', $this->_label, 'filters'));
         $mform->disabledIf($this->_name, $this->_name.'_op', 'eq', 0);
         if (!is_null($this->_default)) {
             $mform->setDefault($this->_name, $this->_default);
index e35b4d4f9b230f69d9480fe1f2f0a91cfe075e4d..55b5ae32fa86f7471123cb15a1f6493fd17537fb 100644 (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('text2',$this->_label,'filters'));
+        $mform->setHelpButton($this->_name.'_grp', array('text2',$this->_label,'filters'));
         $mform->disabledIf($this->_name, $this->_name.'_op', 'eq', 5);
         if ($this->_advanced) {
             $mform->setAdvanced($this->_name.'_grp');
index cf431038692c2f6aa43511562f3947e23c4fcf32..beb2e50e83bcb5e82cd93c58e1c5bfe1c387411c 100644 (file)
@@ -116,11 +116,11 @@ echo get_string('users'). ': ' . implode(', ', $userlist) . '.';
 echo '</p>';
 
 echo '<p>' . get_string('content', 'notes');
-echo $OUTPUT->help_icon(moodle_help_icon::make('writing', get_string('helpwriting')));
+echo $OUTPUT->help_icon('writing', get_string('helpwriting'));
 echo '<br /><textarea name="content" rows="5" cols="50">' . strip_tags(@$content) . '</textarea></p>';
 
 echo '<p>' . $strpublishstate;
-echo $OUTPUT->help_icon(moodle_help_icon::make('status', $strpublishstate, 'notes'));
+echo $OUTPUT->help_icon('status', $strpublishstate, 'notes');
 echo $OUTPUT->select(html_select::make($state_names, 'state', empty($state) ? NOTES_STATE_PUBLIC : $state, false));
 echo '</p>';
 
index dd11fe4a23d6633328ef90cee8faa47d69e199c2..360526b7b4760f0db3241272cf8ec9ce1c1df08a 100755 (executable)
@@ -134,7 +134,7 @@ if($course->enrollable == 2) {
 }
 
 $title = get_string('groupextendenrol');
-echo $OUTPUT->heading($title . $OUTPUT->help_icon(moodle_help_icon::make('groupextendenrol', $title)));
+echo $OUTPUT->heading($title . $OUTPUT->help_icon('groupextendenrol', $title));
 echo '<form method="post" action="groupextendenrol.php">';
 echo '<input type="hidden" name="id" value="'.$course->id.'" />';
 echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
index e9f5a5557adc2476c2da5222b58164c6d6a2f157..f4f5bd89932964f1b9f7d511bc341e614a3efb7d 100644 (file)
             $displaylist['groupextendenrol.php'] = get_string('groupextendenrol');
         }
 
-        echo $OUTPUT->help_icon(moodle_help_icon::make("participantswithselectedusers", get_string("withselectedusers")));
+        echo $OUTPUT->help_icon("participantswithselectedusers", get_string("withselectedusers"));
         $select = new html_select();
         $select->options = $displaylist;
         $select->name = "formaction";
index 05ac9e5ed6521fa83837eb751758a7475f9a62c8..849a3b4edf3c76ce03a93fcfd3f8e215909d12d3 100644 (file)
 <tr valign="top">
     <td align="right" valign="middle" nowrap="nowrap">
      <?php
-        echo $OUTPUT->help_icon(moodle_help_icon::make("reading", get_string("helpreading"), "moodle", true));
+     //TODO: replace by new editor stuff!
+        echo $OUTPUT->help_icon("reading", get_string("helpreading"), "moodle", true);
         echo "<br />";
-        echo $OUTPUT->help_icon(moodle_help_icon::make("writing", get_string("helpwriting"), "moodle", true));
+        echo $OUTPUT->help_icon("writing", get_string("helpwriting"), "moodle", true);
         echo "<br />";
-        echo $OUTPUT->help_icon(moodle_help_icon::make("questions", get_string("helpquestions"), "moodle", true));
+        echo $OUTPUT->help_icon("questions", get_string("helpquestions"), "moodle", true);
         echo "<br />";
         if ($usehtmleditor) {
-           echo $OUTPUT->help_icon(moodle_help_icon::make("richtext2", get_string("helprichtext"), "moodle", true));
+           echo $OUTPUT->help_icon("richtext2", get_string("helprichtext"), "moodle", true);
         } else {
-           emoticonhelpbutton("theform", "message");
+           //emoticonhelpbutton("theform", "message"); to be replaced by new editor stuff
         }
       ?>
      <br />
@@ -41,7 +42,7 @@
         } else {
             choose_from_menu(format_text_menu(), "format", $format, "");
         }
-        echo $OUTPUT->help_icon(moodle_help_icon::make("textformat", get_string("helpformatting")));
+        echo $OUTPUT->help_icon("textformat", get_string("helpformatting"));
      ?>
     </td>
 </tr>