MDL-21217, MDL-21198 simplified/improved outputlib help icon related apis + several fixed regresions

This commit is contained in:
Petr Skoda 2009-12-30 15:19:55 +00:00
parent 48a67d9f01
commit 4bcc51185c
113 changed files with 442 additions and 970 deletions

View file

@ -380,7 +380,7 @@ if (defined('WARN_DISPLAY_ERRORS_ENABLED')) {
$lastcron = $DB->get_field_sql('SELECT MAX(lastcron) FROM {modules}'); $lastcron = $DB->get_field_sql('SELECT MAX(lastcron) FROM {modules}');
if (time() - $lastcron > 3600 * 24) { if (time() - $lastcron > 3600 * 24) {
$strinstallation = get_string('installation', 'install'); $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').' '.$helpbutton, 'generalbox adminwarning'); echo $OUTPUT->box(get_string('cronwarning', 'admin').' '.$helpbutton, 'generalbox adminwarning');
} }

View file

@ -496,7 +496,7 @@
$select->nothinglabel = $strchoosefiletoedit; $select->nothinglabel = $strchoosefiletoedit;
$select->set_label($selectionlabel); $select->set_label($selectionlabel);
echo $OUTPUT->select($select); echo $OUTPUT->select($select);
echo $OUTPUT->help_icon(moodle_help_icon::make('langswitchstorage', $strfilestoredinhelp)); echo $OUTPUT->help_icon('langswitchstorage', $strfilestoredinhelp);
echo $OUTPUT->box_end(); echo $OUTPUT->box_end();
if ($currentfile <> '') { if ($currentfile <> '') {
@ -763,7 +763,7 @@
$select->nothinglabel = $strchoosefiletoedit; $select->nothinglabel = $strchoosefiletoedit;
$select->set_label($selectionlabel); $select->set_label($selectionlabel);
echo $OUTPUT->select($select); echo $OUTPUT->select($select);
echo $OUTPUT->help_icon(moodle_help_icon::make('langswitchstorage', $strfilestoredinhelp)); echo $OUTPUT->help_icon('langswitchstorage', $strfilestoredinhelp);
echo $OUTPUT->box_end(); echo $OUTPUT->box_end();
if (!empty($currentfile)) { if (!empty($currentfile)) {
@ -812,11 +812,11 @@
echo '<div>'; echo '<div>';
if ($uselocal) { if ($uselocal) {
$strsavetotitle = $strlanglocalpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlanglocalpackage)); $strsavetotitle = $strlanglocalpackage . $OUTPUT->help_icon('langpackages', $strlanglocalpackage);
$straltdirtitle = $strlangmasterpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlangmasterpackage)); $straltdirtitle = $strlangmasterpackage . $OUTPUT->help_icon('langpackages', $strlangmasterpackage);
} else { } else {
$straltdirtitle = $strlanglocalpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlanglocalpackage)); $straltdirtitle = $strlanglocalpackage . $OUTPUT->help_icon('langpackages', $strlanglocalpackage);
$strsavetotitle = $strlangmasterpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlangmasterpackage)); $strsavetotitle = $strlangmasterpackage . $OUTPUT->help_icon('langpackages', $strlangmasterpackage);
} }
@ -876,7 +876,7 @@
} }
if (is_readable($ensrc)) { if (is_readable($ensrc)) {
echo '<fieldset><legend>'.$strlangmasterenglish; echo '<fieldset><legend>'.$strlangmasterenglish;
echo $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlangmasterenglish)); echo $OUTPUT->help_icon('langpackages', $strlangmasterenglish);
echo '</legend>'; echo '</legend>';
echo "<div class='mdl-align'>\n<textarea rows=\"$fileeditorrows\" cols=\"$fileeditorcols\" name=\"\">"; echo "<div class='mdl-align'>\n<textarea rows=\"$fileeditorrows\" cols=\"$fileeditorcols\" name=\"\">";
echo htmlspecialchars(file_get_contents($ensrc)); echo htmlspecialchars(file_get_contents($ensrc));

View file

@ -32,7 +32,7 @@ if (empty($mnet_peer->public_key)) $mnet_peer->public_key = '';
<td align="right" valign="top"><?php <td align="right" valign="top"><?php
print_string('publickey', 'mnet'); print_string('publickey', 'mnet');
echo ': <br />'; 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> ?></td>
<?php <?php
@ -105,7 +105,7 @@ if (isset($mnet_peer->ip_address) && '' != $mnet_peer->ip_address){
<tr> <tr>
<td align="right" valign="top"><?php print_string('ipaddress', 'mnet'); <td align="right" valign="top"><?php print_string('ipaddress', 'mnet');
echo ': <br />'; 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>
<td valign="top"><?php echo $mnet_peer->ip_address; ?></td> <td valign="top"><?php echo $mnet_peer->ip_address; ?></td>
</tr> </tr>

View file

@ -296,10 +296,7 @@
} }
/// Print heading. /// Print heading.
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help($title, 'assignroles');
$helpicon->text = $title;
$helpicon->page = 'assignroles';
echo $OUTPUT->heading_with_help($helpicon);
if ($roleid) { if ($roleid) {
/// Show UI for assigning a particular role to users. /// Show UI for assigning a particular role to users.
@ -330,7 +327,7 @@
if ($hidden) { echo 'checked="checked" '; } ?>/> if ($hidden) { echo 'checked="checked" '; } ?>/>
<label for="hidden" title="<?php print_string('createhiddenassign', 'role'); ?>"> <label for="hidden" title="<?php print_string('createhiddenassign', 'role'); ?>">
<?php print_string('hidden', '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> </label></p>
<p><label for="extendperiod"><?php print_string('enrolperiod') ?></label><br /> <p><label for="extendperiod"><?php print_string('enrolperiod') ?></label><br />

View file

@ -138,10 +138,7 @@
} }
/// Print heading. /// Print heading.
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help($title, 'checkpermissions');
$helpicon->text = $title;
$helpicon->page = 'checkpermissions';
echo $OUTPUT->heading_with_help($helpicon);
/// If a user has been chosen, show all the permissions for this user. /// If a user has been chosen, show all the permissions for this user.
$reportuser = $userselector->get_selected_user(); $reportuser = $userselector->get_selected_user();

View file

@ -120,10 +120,7 @@
} else if ($action == 'edit') { } else if ($action == 'edit') {
$title = get_string('editingrolex', 'role', $rolenames[$roleid]->localname); $title = get_string('editingrolex', 'role', $rolenames[$roleid]->localname);
} }
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help($title, 'roles');
$helpicon->text = $title;
$helpicon->page = 'roles';
echo $OUTPUT->heading_with_help($helpicon);
/// Work out some button labels. /// Work out some button labels.
if ($action == 'add' || $action == 'duplicate') { if ($action == 'add' || $action == 'duplicate') {

View file

@ -380,7 +380,7 @@ abstract class capability_table_with_risks extends capability_table_base {
protected function add_header_cells() { protected function add_header_cells() {
global $OUTPUT; global $OUTPUT;
echo '<th colspan="' . count($this->displaypermissions) . '" scope="col">' . 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>'; echo '<th class="risk" colspan="' . count($this->allrisks) . '" scope="col">' . get_string('risks','role') . '</th>';
} }

View file

@ -206,7 +206,7 @@
$table->wrap = array('nowrap', '', 'nowrap','nowrap'); $table->wrap = array('nowrap', '', 'nowrap','nowrap');
$table->width = '90%'; $table->width = '90%';
$table->head = array( $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('description'),
get_string('shortname'), get_string('shortname'),
get_string('edit') get_string('edit')

View file

@ -175,10 +175,7 @@
include_once('tabs.php'); include_once('tabs.php');
} }
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help($title, 'overrides');
$helpicon->text = $title;
$helpicon->page = 'overrides';
echo $OUTPUT->heading_with_help($helpicon);
if ($roleid) { if ($roleid) {
/// Show UI for overriding roles. /// Show UI for overriding roles.

View file

@ -58,10 +58,7 @@ $overwritepicture = optional_param('overwritepicture', 0, PARAM_BOOL);
/// Print the header /// Print the header
admin_externalpage_print_header(); admin_externalpage_print_header();
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help($struploadpictures, 'uploadpictures');
$helpicon->text = $struploadpictures;
$helpicon->page = 'uploadpictures';
echo $OUTPUT->heading_with_help($helpicon);
$mform = new admin_uploadpicture_form(null, $userfields); $mform = new admin_uploadpicture_form(null, $userfields);
if ($formdata = $mform->get_data()) { if ($formdata = $mform->get_data()) {

View file

@ -107,10 +107,7 @@ if (empty($iid)) {
} else { } else {
admin_externalpage_print_header(); admin_externalpage_print_header();
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help(get_string('uploadusers'), 'uploadusers3');
$helpicon->text = get_string('uploadusers');
$helpicon->page = 'uploadusers3';
echo $OUTPUT->heading_with_help($helpicon);
$mform->display(); $mform->display();
echo $OUTPUT->footer(); echo $OUTPUT->footer();
@ -749,10 +746,7 @@ admin_externalpage_print_header();
/// Print the form /// Print the form
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help(get_string('uploaduserspreview', 'admin'), 'uploadusers2');
$helpicon->text = get_string('uploaduserspreview', 'admin');
$helpicon->page = 'uploadusers2';
echo $OUTPUT->heading_with_help($helpicon);
$ci = 0; $ci = 0;
$ri = 0; $ri = 0;

View file

@ -94,7 +94,7 @@ class user_bulk_form extends moodleform {
$grp =& $mform->addElement('group', 'usersgrp', get_string('users'), $objs, ' ', false); $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'); $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', 'addall', get_string('addall', 'bulkusers'));
$objs[] =& $mform->createElement('submit', 'removeall', get_string('removeall', 'bulkusers')); $objs[] =& $mform->createElement('submit', 'removeall', get_string('removeall', 'bulkusers'));
$grp =& $mform->addElement('group', 'buttonsgrp', get_string('selectedlist', 'bulkusers'), $objs, array(' ', '<br />'), false); $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(); $renderer =& $mform->defaultRenderer();
$template = '<label class="qflabel" style="vertical-align:top">{label}</label> {element}'; $template = '<label class="qflabel" style="vertical-align:top">{label}</label> {element}';

View file

@ -281,7 +281,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
echo "<tr>"; echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>"; echo "<td align=\"right\" colspan=\"2\"><b>";
echo '<label for="menubackup_site_files">'.get_string ("sitefilesused").'</label>'; 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\">"; echo "</b></td><td colspan=\"2\">";
$course_file_options[0] = get_string("no"); $course_file_options[0] = get_string("no");
$course_file_options[1] = get_string("yes"); $course_file_options[1] = get_string("yes");

View file

@ -269,7 +269,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
echo '<label for="shortnamefield">'.get_string ('shortname').'</label>'; echo '<label for="shortnamefield">'.get_string ('shortname').'</label>';
echo "</td>"; echo "</td>";
echo "<td><input type=\"text\" id=\"shortnamefield\" name=\"shortname\" maxlength=\"100\" size=\"20\" value=\"".s($form1->shortname)."\" alt=\"".get_string("shortname")."\" />" ; 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"]); if (isset($err["shortname"])) echo $OUTPUT->error_text($err["shortname"]);
echo "</td>"; echo "</td>";
echo "</tr>"; echo "</tr>";
@ -278,7 +278,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
echo '<label for="fullnamefield">'.get_string ('fullname').'</label>'; echo '<label for="fullnamefield">'.get_string ('fullname').'</label>';
echo "</td>"; echo "</td>";
echo "<td><input type=\"text\" id=\"fullnamefield\" name=\"fullname\" maxlength=\"254\" size=\"50\" value=\"".s($form1->fullname)."\" alt=\" ".get_string("fullname")."\" />" ; 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"]); if (isset($err["fullname"])) echo $OUTPUT->error_text($err["fullname"]);
echo"</td></tr>"; echo"</td></tr>";
} else { } else {
@ -303,7 +303,7 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
$yearselector = html_select::make_time_selector('years', "startyear", $form1->startdate); $yearselector = html_select::make_time_selector('years', "startyear", $form1->startdate);
echo $OUTPUT->select($dayselector) . $OUTPUT->select($monthselector) . $OUTPUT->select($yearselector); 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 { } else {
print_string('notavailable'); print_string('notavailable');
echo '<input type="hidden" name="startyear" value="0" />'; 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) //Now print the Groups tr (assume there is no $info->backup_groups)
echo "<tr>"; echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>"; 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 '<label for="menurestore_groups">'.get_string ("groups").'</label>'.$helplink;
echo "</b></td><td colspan=\"2\">"; echo "</b></td><td colspan=\"2\">";
if (empty($CFG->enablegroupings)) { if (empty($CFG->enablegroupings)) {

View file

@ -36,7 +36,7 @@ class block_search_forums extends block_base {
'<input id="searchform_search" name="search" type="text" size="16" />'; '<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 .= '<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 .= '<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>'; $this->content->text .= '</fieldset></form></div>';
return $this->content; return $this->content;

View file

@ -232,7 +232,7 @@ class block_tags extends block_base {
$tagthisunit = get_string('tagthisunit', $tagslang); $tagthisunit = get_string('tagthisunit', $tagslang);
$buttonadd = get_string('add', $tagslang); $buttonadd = get_string('add', $tagslang);
$arrowtitle = get_string('arrowtitle', $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(); $sesskey = sesskey();
$arrowright = $OUTPUT->pix_url('t/arrow_left'); $arrowright = $OUTPUT->pix_url('t/arrow_left');
$this->content->footer .= <<<EOT $this->content->footer .= <<<EOT

View file

@ -79,10 +79,7 @@ $PAGE->navbar->add($stredit);
$PAGE->set_focuscontrol('theform.summary'); $PAGE->set_focuscontrol('theform.summary');
echo $OUTPUT->header(); echo $OUTPUT->header();
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help($strsummaryof, 'summaries');
$helpicon->text = $strsummaryof;
$helpicon->page = 'summaries';
echo $OUTPUT->heading_with_help($helpicon);
$mform->display(); $mform->display();
echo $OUTPUT->footer(); echo $OUTPUT->footer();

View file

@ -35,10 +35,7 @@ $strusers = get_string("users");
$strusersnew = get_string("usersnew"); $strusersnew = get_string("usersnew");
$strimportgroups = get_string("importgroups"); $strimportgroups = get_string("importgroups");
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help($strimportgroups, 'uploadgroups');
$helpicon->text = $strimportgroups;
$helpicon->page = 'uploadgroups';
echo $OUTPUT->heading_with_help($helpicon);
$maxuploadsize = get_max_upload_file_size(); $maxuploadsize = get_max_upload_file_size();
echo '<p align="center">'; echo '<p align="center">';

View file

@ -3026,7 +3026,7 @@ function print_groupmode_setting($form, $course=NULL) {
$select = html_select::make($choices, 'groupmode', $groupmode, false); $select = html_select::make($choices, 'groupmode', $groupmode, false);
$select->disabled = $course->groupmodeforce; $select->disabled = $course->groupmodeforce;
echo $OUTPUT->select($select); 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>'; echo '</td></tr>';
} }
} }

View file

@ -616,11 +616,7 @@
require($CFG->dirroot.'/'.$CFG->admin.'/roles/tabs.php'); require($CFG->dirroot.'/'.$CFG->admin.'/roles/tabs.php');
} }
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help($pageheading, 'mods', $module->name, 'icon');
$helpicon->page = 'mods';
$helpicon->text = $pageheading;
$helpicon->module = $module->name;
echo $OUTPUT->heading_with_help($helpicon, $OUTPUT->pix_url('icon', $module->name));
$mform->display(); $mform->display();

View file

@ -126,7 +126,7 @@
echo $OUTPUT->select(html_select::make($roleoptions,'roleid',$roleid,false)); echo $OUTPUT->select(html_select::make($roleoptions,'roleid',$roleid,false));
echo '<label for="menuaction">'.get_string('showactions').'</label>'."\n"; echo '<label for="menuaction">'.get_string('showactions').'</label>'."\n";
echo $OUTPUT->select(html_select::make($actionoptions,'action',$action,false)); 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"; 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=' $baseurl = $CFG->wwwroot.'/course/report/participation/index.php?id='.$course->id.'&amp;roleid='
@ -281,7 +281,7 @@
$select->label = get_string("withselectedusers"); $select->label = get_string("withselectedusers");
$select->add_action('change', 'conditionalsubmit', array('formid' => 'studentsform')); $select->add_action('change', 'conditionalsubmit', array('formid' => 'studentsform'));
echo $OUTPUT->select($select); 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 '<input type="submit" value="' . get_string('ok') . '" />'."\n";
echo '</div>'."\n"; echo '</div>'."\n";
echo '</form>'."\n"; echo '</form>'."\n";

View file

@ -131,7 +131,7 @@ if (!isset($frm->acceptechecktypes)) {
<tr valign="top"> <tr valign="top">
<td align="right">an_authcode:</td> <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'); ?> <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> </td>
</tr> </tr>
@ -177,20 +177,20 @@ if (!isset($frm->acceptechecktypes)) {
</tr> </tr>
<tr valign="top"><td colspan="2"><h4><?php print_string("adminauthorizeccapture", "enrol_authorize") ?> <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> </h4></td></tr>
<tr valign="top"> <tr valign="top">
<td align="right">an_review:</td> <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'); ?> <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> </td>
</tr> </tr>
<tr valign="top"> <tr valign="top">
<td align="right">an_capture_day:</td> <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) ?>" /> <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> <?php print_string("reviewday", "enrol_authorize", $frm->an_capture_day) ?></td>
</tr> </tr>

View file

@ -23,11 +23,7 @@
$PAGE->set_button($managebutton); $PAGE->set_button($managebutton);
echo $OUTPUT->header(); echo $OUTPUT->header();
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help($struploadcsv, 'authorize/uploadcsv', 'enrol');
$helpicon->text = $struploadcsv;
$helpicon->page = 'authorize/uploadcsv';
$helpicon->module = 'enrol';
echo $OUTPUT->heading_with_help($helpicon);
/// Handle CSV file /// Handle CSV file
if (($form = data_submitted()) && confirm_sesskey()) { if (($form = data_submitted()) && confirm_sesskey()) {

View file

@ -38,7 +38,7 @@
<input type="checkbox" value="1" name="enrol_createnewusers" <?php if ($frm->enrol_createnewusers) echo "checked=\"checked\"" ?> /> <input type="checkbox" value="1" name="enrol_createnewusers" <?php if ($frm->enrol_createnewusers) echo "checked=\"checked\"" ?> />
</td> </td>
<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> </td>
</tr> </tr>
@ -48,7 +48,7 @@
<input type="checkbox" value="1" name="enrol_imsdeleteusers" <?php if ($frm->enrol_imsdeleteusers) echo "checked=\"checked\"" ?> /> <input type="checkbox" value="1" name="enrol_imsdeleteusers" <?php if ($frm->enrol_imsdeleteusers) echo "checked=\"checked\"" ?> />
</td> </td>
<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> </td>
</tr> </tr>
@ -78,7 +78,7 @@
<input type="checkbox" value="1" name="enrol_imssourcedidfallback" <?php if ($frm->enrol_imssourcedidfallback) echo "checked=\"checked\"" ?> /> <input type="checkbox" value="1" name="enrol_imssourcedidfallback" <?php if ($frm->enrol_imssourcedidfallback) echo "checked=\"checked\"" ?> />
</td> </td>
<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> </td>
</tr> </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" /> <input type="text" <?php echo 'value="'.intval($frm->enrol_truncatecoursecodes).'"' ?> name="enrol_truncatecoursecodes" size="3" maxlength="3" />
</td> </td>
<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> </td>
</tr> </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\"" ?> /> <input type="checkbox" value="1" name="enrol_createnewcourses" <?php if ($frm->enrol_createnewcourses) echo "checked=\"checked\"" ?> />
</td> </td>
<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> </td>
</tr> </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\"" ?> /> <input type="checkbox" value="1" name="enrol_createnewcategories" <?php if ($frm->enrol_createnewcategories) echo "checked=\"checked\"" ?> />
</td> </td>
<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> </td>
</tr> </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\"" ?> /> <input type="checkbox" value="1" name="enrol_imsunenrol" <?php if ($frm->enrol_imsunenrol) echo "checked=\"checked\"" ?> />
</td> </td>
<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> </td>
</tr> </tr>
@ -180,7 +180,7 @@ foreach($this->imsroles as $imsrolenum=>$imsrolename){
<td align="right"><?php print_string('restricttarget', 'enrol_imsenterprise') ?>:</td> <td align="right"><?php print_string('restricttarget', 'enrol_imsenterprise') ?>:</td>
<td colspan="2"> <td colspan="2">
<input type="text" <?php echo 'value="'.htmlspecialchars($frm->enrol_imsrestricttarget).'"' ?> name="enrol_imsrestricttarget" size="20" maxlength="32" /> <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> </td>
</tr> </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\"" ?> /> <input type="checkbox" value="1" name="enrol_imscapitafix" <?php if ($frm->enrol_imscapitafix) echo "checked=\"checked\"" ?> />
</td> </td>
<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> </td>
</tr> </tr>

View file

@ -125,10 +125,7 @@ if ($context->contextlevel == CONTEXT_COURSE and $context->instanceid == SITEID)
} }
/// Print heading. /// Print heading.
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help($title, 'localfiltersettings');
$helpicon->text = $title;
$helpicon->page = 'localfiltersettings';
echo $OUTPUT->heading_with_help($helpicon);
if (empty($availablefilters)) { if (empty($availablefilters)) {
echo '<p class="centerpara">' . get_string('nofiltersenabled', 'filters') . "</p>\n"; echo '<p class="centerpara">' . get_string('nofiltersenabled', 'filters') . "</p>\n";

View file

@ -649,7 +649,7 @@ class grade_edit_tree_column_aggregation extends grade_edit_tree_column_category
public function get_header_cell() { public function get_header_cell() {
global $OUTPUT; global $OUTPUT;
$headercell = clone($this->headercell); $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; return $headercell;
} }
@ -706,7 +706,7 @@ class grade_edit_tree_column_extracredit extends grade_edit_tree_column {
public function get_header_cell() { public function get_header_cell() {
global $OUTPUT; global $OUTPUT;
$headercell = clone($this->headercell); $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; return $headercell;
} }
@ -748,7 +748,7 @@ class grade_edit_tree_column_weight extends grade_edit_tree_column {
public function get_header_cell() { public function get_header_cell() {
global $OUTPUT; global $OUTPUT;
$headercell = clone($this->headercell); $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; return $headercell;
} }
@ -846,7 +846,7 @@ class grade_edit_tree_column_aggregateonlygraded extends grade_edit_tree_column_
$headercell = clone($this->headercell); $headercell = clone($this->headercell);
$headercell->style .= 'width: 40px;'; $headercell->style .= 'width: 40px;';
$headercell->text = get_string('aggregateonlygraded', 'grades') $headercell->text = get_string('aggregateonlygraded', 'grades')
. $OUTPUT->help_icon(moodle_help_icon::make('aggregateonlygraded', 'aggregateonlygraded', 'grade')); . $OUTPUT->help_icon('aggregateonlygraded', 'aggregateonlygraded', 'grade');
return $headercell; return $headercell;
} }
@ -892,7 +892,7 @@ class grade_edit_tree_column_aggregatesubcats extends grade_edit_tree_column_cat
$headercell = clone($this->headercell); $headercell = clone($this->headercell);
$headercell->style .= 'width: 40px;'; $headercell->style .= 'width: 40px;';
$headercell->text = get_string('aggregatesubcats', 'grades') $headercell->text = get_string('aggregatesubcats', 'grades')
.$OUTPUT->help_icon(moodle_help_icon::make('aggregatesubcats', 'aggregatesubcats', 'grade')); .$OUTPUT->help_icon('aggregatesubcats', 'aggregatesubcats', 'grade');
return $headercell; return $headercell;
} }
@ -938,7 +938,7 @@ class grade_edit_tree_column_aggregateoutcomes extends grade_edit_tree_column_ca
$headercell = clone($this->headercell); $headercell = clone($this->headercell);
$headercell->style .= 'width: 40px;'; $headercell->style .= 'width: 40px;';
$headercell->text = get_string('aggregateoutcomes', 'grades') $headercell->text = get_string('aggregateoutcomes', 'grades')
.$OUTPUT->help_icon(moodle_help_icon::make('aggregateoutcomes', 'aggregateoutcomes', 'grade')); .$OUTPUT->help_icon('aggregateoutcomes', 'aggregateoutcomes', 'grade');
return $headercell; return $headercell;
} }
@ -990,7 +990,7 @@ class grade_edit_tree_column_droplow extends grade_edit_tree_column_category {
public function get_header_cell() { public function get_header_cell() {
global $OUTPUT; global $OUTPUT;
$headercell = clone($this->headercell); $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; return $headercell;
} }
@ -1026,7 +1026,7 @@ class grade_edit_tree_column_keephigh extends grade_edit_tree_column_category {
public function get_header_cell() { public function get_header_cell() {
global $OUTPUT; global $OUTPUT;
$headercell = clone($this->headercell); $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; return $headercell;
} }
@ -1062,7 +1062,7 @@ class grade_edit_tree_column_multfactor extends grade_edit_tree_column {
public function get_header_cell() { public function get_header_cell() {
global $OUTPUT; global $OUTPUT;
$headercell = clone($this->headercell); $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; return $headercell;
} }
@ -1104,7 +1104,7 @@ class grade_edit_tree_column_plusfactor extends grade_edit_tree_column {
public function get_header_cell() { public function get_header_cell() {
global $OUTPUT; global $OUTPUT;
$headercell = clone($this->headercell); $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; return $headercell;
} }

View file

@ -169,7 +169,7 @@ class completion_info {
global $PAGE, $OUTPUT; global $PAGE, $OUTPUT;
if ($this->is_enabled() && !$PAGE->user_is_editing() && isloggedin() && !isguestuser()) { if ($this->is_enabled() && !$PAGE->user_is_editing() && isloggedin() && !isguestuser()) {
echo '<span id = "completionprogressid" class="completionprogress">'.get_string('yourprogress','completion').' '; 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>'; echo '</span>';
} }
} }

View file

@ -2443,54 +2443,10 @@ function print_table($table, $return=false) {
* @param string $class class added to the element * @param string $class class added to the element
* @return string html code to display a link to a popup window. * @return string html code to display a link to a popup window.
*/ */
function link_to_popup_window ($url, $name=null, $linkname=null, function link_to_popup_window ($url, $name=null, $linkname=null, $height=400, $width=500, $title=null, $options=null, $return=false) {
$height=400, $width=500, $title=null, debugging('link_to_popup_window() has been removed. Please change your code to use $OUTPUT->link(). Please note popups are discouraged for accessibility reasons');
$options=null, $return=false) {
global $OUTPUT;
debugging('link_to_popup_window() has been deprecated. Please change your code to use $OUTPUT->link().'); return $OUTPUT->link($url, $name);
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);
if ($return) {
return $output;
} else {
echo $output;
}
} }
/** /**
@ -2523,7 +2479,7 @@ function button_to_popup_window ($url, $name=null, $linkname=null,
} }
if (empty($linkname)) { 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 // Create a html_button object
@ -2796,36 +2752,132 @@ function helpbutton($page, $title, $module='moodle', $image=true, $linktext=fals
global $OUTPUT; global $OUTPUT;
if (!empty($text)) { $output = $OUTPUT->help_icon($page, $title, $module, $linktext);
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)) { // hide image with CSS if needed
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;
// If image is true, the defaults are handled by the helpicon's prepare method
if (!$image) {
$helpicon->image = false;
}
$output = $OUTPUT->help_icon($helpicon);
if ($return) { if ($return) {
return $output; return $output;
} else { } else {
echo $output; 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 * 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. * 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 * @return string|bool Depending on value of $return
*/ */
function print_scale_menu_helpbutton($courseid, $scale, $return=false) { 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; global $OUTPUT;
$output = $OUTPUT->help_button(help_button::make_scale_menu($courseid, $scale)); $output = $OUTPUT->help_icon_scale($courseid, $scale);
if ($return) { if ($return) {
return $output; return $output;
@ -3451,17 +3503,15 @@ function print_heading_with_help($text, $helppage, $module='moodle', $icon=false
global $OUTPUT; global $OUTPUT;
$helpicon = new moodle_help_icon();
$helpicon->page = $helppage;
$helpicon->text = $text;
$helpicon->module = $module;
// Extract the src from $icon if it exists // Extract the src from $icon if it exists
if (preg_match('/src="([^"]*)"/', $icon, $matches)) { if (preg_match('/src="([^"]*)"/', $icon, $matches)) {
$icon = $matches[1]; $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) { if ($return) {
return $output; return $output;

View file

@ -76,18 +76,7 @@ class MoodleQuickForm_advcheckbox extends HTML_QuickForm_advcheckbox{
* @param string $function function name to call to get html * @param string $function function name to call to get html
*/ */
function setHelpButton($helpbuttonargs, $function='helpbutton'){ function setHelpButton($helpbuttonargs, $function='helpbutton'){
if (!is_array($helpbuttonargs)){ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
$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);
} }
/** /**
* get html for help button * get html for help button

View file

@ -47,18 +47,7 @@ class MoodleQuickForm_button extends HTML_QuickForm_button
* @param string $function function name to call to get html * @param string $function function name to call to get html
*/ */
function setHelpButton($helpbuttonargs, $function='helpbutton'){ function setHelpButton($helpbuttonargs, $function='helpbutton'){
if (!is_array($helpbuttonargs)){ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
$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);
} }
/** /**
* get html for help button * get html for help button

View file

@ -25,18 +25,7 @@ class MoodleQuickForm_checkbox extends HTML_QuickForm_checkbox{
* @param string $function function name to call to get html * @param string $function function name to call to get html
*/ */
function setHelpButton($helpbuttonargs, $function='helpbutton'){ function setHelpButton($helpbuttonargs, $function='helpbutton'){
if (!is_array($helpbuttonargs)){ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
$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);
} }
/** /**
* get html for help button * get html for help button

View file

@ -25,18 +25,7 @@ class MoodleQuickForm_file extends HTML_QuickForm_file{
* @param string $function function name to call to get html * @param string $function function name to call to get html
*/ */
function setHelpButton($helpbuttonargs, $function='helpbutton'){ function setHelpButton($helpbuttonargs, $function='helpbutton'){
if (!is_array($helpbuttonargs)){ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
$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);
} }
/** /**
* set html for help button * set html for help button

View file

@ -97,18 +97,7 @@ class MoodleQuickForm_filemanager extends HTML_QuickForm_element {
} }
function setHelpButton($helpbuttonargs, $function='helpbutton'){ function setHelpButton($helpbuttonargs, $function='helpbutton'){
if (!is_array($helpbuttonargs)){ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
$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);
} }
function getHelpButton() { function getHelpButton() {

View file

@ -36,18 +36,7 @@ class MoodleQuickForm_filepicker extends HTML_QuickForm_input {
} }
function setHelpButton($helpbuttonargs, $function='helpbutton') { function setHelpButton($helpbuttonargs, $function='helpbutton') {
if (!is_array($helpbuttonargs)) { debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
$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);
} }
function getHelpButton() { function getHelpButton() {

View file

@ -51,34 +51,6 @@ class MoodleQuickForm_format extends MoodleQuickForm_select{
} }
} //end constructor } //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 * Called by HTML_QuickForm whenever form event is made on this element
* *
@ -95,7 +67,7 @@ class MoodleQuickForm_format extends MoodleQuickForm_select{
case 'createElement': case 'createElement':
$menu = format_text_menu(); $menu = format_text_menu();
$this->load($menu); $this->load($menu);
$this->setHelpButton(array('textformat', get_string('helpformatting'))); //$this->setHelpButton(array('textformat', get_string('helpformatting')));
break; break;
case 'updateValue' : case 'updateValue' :
$value = $this->_findValue($caller->_constantValues); $value = $this->_findValue($caller->_constantValues);

View file

@ -30,21 +30,7 @@ class MoodleQuickForm_group extends HTML_QuickForm_group{
* @param string $function function name to call to get html * @param string $function function name to call to get html
*/ */
function setHelpButton($helpbuttonargs, $function='helpbutton'){ function setHelpButton($helpbuttonargs, $function='helpbutton'){
global $OUTPUT; debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
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);
}
} }
/** /**
* set html for help button * set html for help button

View file

@ -43,18 +43,7 @@ class MoodleQuickForm_header extends HTML_QuickForm_header
* @param string $function function name to call to get html * @param string $function function name to call to get html
*/ */
function setHelpButton($helpbuttonargs, $function='helpbutton'){ function setHelpButton($helpbuttonargs, $function='helpbutton'){
if (!is_array($helpbuttonargs)){ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
$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);
} }
/** /**
* get html for help button * get html for help button

View file

@ -47,18 +47,7 @@ class MoodleQuickForm_htmleditor extends MoodleQuickForm_textarea{
* @param string $function function name to call to get html * @param string $function function name to call to get html
*/ */
function setHelpButton($helpbuttonargs, $function='helpbutton'){ function setHelpButton($helpbuttonargs, $function='helpbutton'){
if (!$this->_canUseHtmlEditor){ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
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);
} }
function toHtml(){ function toHtml(){

View file

@ -62,7 +62,8 @@ class MoodleQuickForm_modgrade extends MoodleQuickForm_select{
$grades[$i] = $i; $grades[$i] = $i;
} }
$this->load($grades); $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 $result;
} }
return parent::onQuickFormEvent($event, $arg, $caller); return parent::onQuickFormEvent($event, $arg, $caller);

View file

@ -25,18 +25,7 @@ class MoodleQuickForm_password extends HTML_QuickForm_password{
* @param string $function function name to call to get html * @param string $function function name to call to get html
*/ */
function setHelpButton($helpbuttonargs, $function='helpbutton'){ function setHelpButton($helpbuttonargs, $function='helpbutton'){
if (!is_array($helpbuttonargs)){ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
$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);
} }
/** /**
* get html for help button * get html for help button

View file

@ -25,18 +25,7 @@ class MoodleQuickForm_radio extends HTML_QuickForm_radio{
* @param string $function function name to call to get html * @param string $function function name to call to get html
*/ */
function setHelpButton($helpbuttonargs, $function='helpbutton'){ function setHelpButton($helpbuttonargs, $function='helpbutton'){
if (!is_array($helpbuttonargs)){ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
$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);
} }
/** /**
* get html for help button * get html for help button

View file

@ -7,7 +7,6 @@
* @category Admin * @category Admin
* @package admin * @package admin
* @author Nicolas Connault <nicolasconnault@gmail.com> * @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 * @param string $function function name to call to get html
*/ */
function setHelpButton($helpbuttonargs, $function='helpbutton'){ function setHelpButton($helpbuttonargs, $function='helpbutton'){
if (!is_array($helpbuttonargs)){ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
$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);
} }
/** /**

View file

@ -57,21 +57,7 @@ class MoodleQuickForm_select extends HTML_QuickForm_select{
* @param string $function function name to call to get html * @param string $function function name to call to get html
*/ */
function setHelpButton($helpbuttonargs, $function='helpbutton'){ function setHelpButton($helpbuttonargs, $function='helpbutton'){
global $OUTPUT; debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
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);
}
} }
/** /**
* get html for help button * get html for help button

View file

@ -570,18 +570,7 @@ class MoodleQuickForm_selectgroups extends HTML_QuickForm_element {
* @param string $function function name to call to get html * @param string $function function name to call to get html
*/ */
function setHelpButton($helpbuttonargs, $function='helpbutton'){ function setHelpButton($helpbuttonargs, $function='helpbutton'){
if (!is_array($helpbuttonargs)){ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
$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);
} }
/** /**
* get html for help button * get html for help button

View file

@ -90,18 +90,7 @@ class MoodleQuickForm_selectwithlink extends HTML_QuickForm_select{
* @param string $function function name to call to get html * @param string $function function name to call to get html
*/ */
function setHelpButton($helpbuttonargs, $function='helpbutton'){ function setHelpButton($helpbuttonargs, $function='helpbutton'){
if (!is_array($helpbuttonargs)){ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
$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);
} }
/** /**
* get html for help button * get html for help button

View file

@ -26,18 +26,7 @@ class MoodleQuickForm_static extends HTML_QuickForm_static{
* @param string $function function name to call to get html * @param string $function function name to call to get html
*/ */
function setHelpButton($helpbuttonargs, $function='helpbutton'){ function setHelpButton($helpbuttonargs, $function='helpbutton'){
if (!is_array($helpbuttonargs)){ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
$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);
} }
/** /**
* get html for help button * get html for help button

View file

@ -58,18 +58,7 @@ class MoodleQuickForm_text extends HTML_QuickForm_text{
* @param string $function function name to call to get html * @param string $function function name to call to get html
*/ */
function setHelpButton($helpbuttonargs, $function='helpbutton'){ function setHelpButton($helpbuttonargs, $function='helpbutton'){
if (!is_array($helpbuttonargs)){ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
$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);
} }
/** /**
* get html for help button * get html for help button

View file

@ -34,29 +34,7 @@ class MoodleQuickForm_textarea extends HTML_QuickForm_textarea{
* @param string $function function name to call to get html * @param string $function function name to call to get html
*/ */
function setHelpButton($helpbuttonargs, $function='helpbutton'){ function setHelpButton($helpbuttonargs, $function='helpbutton'){
global $SESSION; debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
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);
} }
/** /**
* get html for help button * get html for help button

View file

@ -95,18 +95,7 @@ EOD;
* @param string $function function name to call to get html * @param string $function function name to call to get html
*/ */
function setHelpButton($helpbuttonargs, $function='helpbutton'){ function setHelpButton($helpbuttonargs, $function='helpbutton'){
if (!is_array($helpbuttonargs)){ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
$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);
} }
/** /**
* get html for help button * get html for help button

View file

@ -34,18 +34,7 @@ class MoodleQuickForm_warning extends HTML_QuickForm_static{
* @param string $function function name to call to get html * @param string $function function name to call to get html
*/ */
function setHelpButton($helpbuttonargs, $function='helpbutton'){ function setHelpButton($helpbuttonargs, $function='helpbutton'){
if (!is_array($helpbuttonargs)){ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
$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);
} }
function toHtml() { function toHtml() {

View 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 to generate html from the arguments in $button
* @param string $function * @param string $function
*/ */
function setHelpButton($elementname, $button, $suppresscheck=false, $function='helpbutton'){ function setHelpButton($elementname, $buttonargs, $suppresscheck=false, $function='helpbutton'){
global $OUTPUT; 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 //_elements has a numeric index, this code accesses the elements by name
$element=&$this->_elements[$this->_elementIndex[$elementname]]; $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);
foreach ($button as $key => $val) { $page = isset($buttonargs[0]) ? $buttonargs[0] : null;
if (isset($button[$key])) { $text = isset($buttonargs[1]) ? $buttonargs[1] : null;
$helpiconoptions[$buttonparams[$key]] = $val; $module = isset($buttonargs[2]) ? $buttonargs[2] : 'moodle';
} $linktext = isset($buttonargs[3]) ? $buttonargs[3] : false;
}
$helpicon = moodle_help_icon::make($helpiconoptions['page'], $helpiconoptions['text'], $helpiconoptions['module'], $helpiconoptions['linktext']);
if (!$helpiconoptions['image']) {
$helpicon->image = false;
}
$element->_helpbutton = $OUTPUT->help_icon($helpicon); $element->_helpbutton = $OUTPUT->help_icon($page, $text, $module, $linktext);
}elseif (!$suppresscheck){
} else if (!$suppresscheck) {
print_error('nonexistentformelements', 'form', '', $elementname); print_error('nonexistentformelements', 'form', '', $elementname);
} }
} }

View file

@ -385,7 +385,7 @@ class html_select extends labelled_html_component {
*/ */
public $form; public $form;
/** /**
* @var moodle_help_icon $form An optional moodle_help_icon component * @var help_icon $array help icon params
*/ */
public $helpicon; public $helpicon;
/** /**
@ -621,34 +621,21 @@ class html_select extends labelled_html_component {
/** /**
* Adds a help icon next to the select menu. * Adds a help icon next to the select menu.
* *
* This can be used in two ways:
*
* <pre> * <pre>
* $select->set_help_icon($page, $text, $linktext); * $select->set_help_icon($page, $text, $component);
* // OR
* $helpicon = new moodle_help_icon();
* $helpicon->page = $page;
* $helpicon->text = $text;
* $helpicon->linktext = $linktext;
* $select->set_help_icon($helpicon);
* </pre> * </pre>
* *
* Use the second form when you need to add additional HTML attributes * @param string $helppage Either the keyword that defines a help page or a help_icon object
* 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 text $text The text of the help icon * @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 * @param boolean $linktext Whether or not to show text next to the icon
* @return void * @return void
*/ */
public function set_help_icon($page, $text, $linktext=false) { public function set_help_icon($helppage='', $text='', $component='moodle') {
if ($page instanceof moodle_help_icon) { if ($helppage) {
$this->helpicon = $page; $this->helpicon = array('helppage'=>$helppage, 'text'=>$text, 'component'=>$component);
} else if (!empty($page)) { } else {
$this->helpicon = new moodle_help_icon(); $this->helpicon = null;
$this->helpicon->page = $page;
$this->helpicon->text = $text;
$this->helpicon->linktext = $linktext;
} }
} }
@ -1292,10 +1279,10 @@ class html_link extends html_component {
// to be filled later // to be filled later
} else if ($url instanceof moodle_url) { } else if ($url instanceof moodle_url) {
$this->src = clone($url); $this->url = clone($url);
} else if (is_string($url)) { } else if (is_string($url)) {
$this->src = new moodle_url($url); $this->url = new moodle_url($url);
} else { } else {
throw new coding_style_exception('Image can be constructed only from moodle_url or string url.'); 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 moodle_url|string $url url of the image
* @param array $options image attributes such as title, id, alt, widht, height * @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); parent::__construct($options);
if (is_null($url)) { if (is_null($src)) {
// to be filled later // to be filled later
} else if ($url instanceof moodle_url) { } else if ($src instanceof moodle_url) {
$this->src = clone($url); $this->src = clone($src);
} else if (is_string($url)) { } else if (is_string($src)) {
$this->src = new moodle_url($url); $this->src = new moodle_url($src);
} else { } else {
throw new coding_style_exception('Image can be constructed only from moodle_url or string url.'); 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) * @param mixed $url The URL to the image (string or moodle_url)
*/ */
public static function make($url) { public static function make($src) {
return new html_image($url); 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 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @since Moodle 2.0 * @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 * @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 * @var string $page The keyword that defines a help page
*/ */
public $page; public $component = 'moodle';
/**
* @var string $module Which module is the page defined in
*/
public $module = 'moodle';
/** /**
* @var boolean $linktext Whether or not to show text next to the icon * @var boolean $linktext Whether or not to show text next to the icon
*/ */
public $linktext = false; public $linktext = false;
/** /**
* @var mixed $image The help icon. Can be set to true (will use default help icon), * @var html_link $link A html_link object that will hold the URL info
* false (will not use any icon), the URL to an image, or a full
* html_image object.
*/ */
public $image; public $link;
/** /**
* Constructor: sets up the other components in case they are needed * 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 * @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->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,98 +2075,25 @@ class moodle_help_icon extends labelled_html_component {
public function prepare(renderer_base $output, moodle_page $page, $target) { public function prepare(renderer_base $output, moodle_page $page, $target) {
global $CFG; global $CFG;
if (empty($this->page)) { if (empty($this->link->title)) {
throw new coding_exception('A moodle_help_icon object requires a $page parameter'); $this->link->title = get_string('helpprefix2', '', trim($this->text, ". \t")) .' ('.get_string('newwindow').')';
} }
if (empty($this->text) && empty($this->link->text)) { if (empty($this->src)) {
throw new coding_exception('A moodle_help_icon object (or its $link attribute) requires a $text parameter'); $this->src = $output->pix_url('help');
} else if (!empty($this->text) && empty($this->link->text)) {
$this->link->text = $this->text;
} }
// fix for MDL-7734 if ($this->linktext) {
$this->link->url = new moodle_url($CFG->wwwroot.'/help.php', array('module' => $this->module, 'file' => $this->page .'.html')); $this->image->alt = get_string('helpwiththis');
} else {
// 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';
}
// 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;
}
$this->image->alt = $this->text; $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');
} }
$popup = new popup_action('click', $this->link->url);
$this->link->add_action($popup);
parent::prepare($output, $page, $target); 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;
}
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;
}
} }

View file

@ -1145,89 +1145,70 @@ class core_renderer extends renderer_base {
/* /*
* Centered heading with attached help button (same title text) * Centered heading with attached help button (same title text)
* and optional icon attached * and optional icon attached
* @param moodle_help_icon $helpicon A moodle_help_icon object * @param string $text A heading text
* @param mixed $image An image URL or a html_image object * @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 * @return string HTML fragment
*/ */
public function heading_with_help($helpicon, $image=false) { public function heading_with_help($text, $helppage, $component='moodle', $icon='', $iconalt='') {
if (!($image instanceof html_image) && !empty($image)) { $image = '';
$htmlimage = new html_image(); if ($icon) {
$htmlimage->src = $image; if ($icon instanceof moodle_url) {
$image = $htmlimage; $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. * 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 * @return string HTML fragment
*/ */
public function help_icon($icon) { public function help_icon($helppage, $text=null, $component='moodle', $linktext=false) {
global $COURSE; $icon = new help_icon($helppage, $text, $component, $linktext);
$icon = clone($icon);
$icon->prepare($this, $this->page, $this->target); $icon->prepare($this, $this->page, $this->target);
$popup = new popup_action('click', $icon->link->url); $icon->link->text = $this->image($icon);
$icon->link->add_action($popup); if ($icon->linktext) {
$icon->link->text .= $icon->text;
$image = null;
if (!empty($icon->image)) {
$image = $icon->image;
$image->add_class('iconhelp');
} }
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 int $courseid
* @param moodle_popup $popup A moodle_popup object * @param object $scale instance
* @param html_image $image An optional image replacing the link text * @return string HTML fragment
*
* @return string HTML fragment
*/ */
public function link_to_popup($link, $image=null) { public function help_icon_scale($courseid, stdClass $scale) {
//TODO: decide if this should be removed completely, because link() already handles this global $CFG;
// we could also add html_link::make_popup() factory method
$link = clone($link);
// Use image if one is given $title = get_string('helpprefix2', '', $scale->name) .' ('.get_string('newwindow').')';
if (!empty($image) && $image instanceof html_image) {
if (empty($image->alt) || $image->alt == HTML_ATTR_EMPTY) { $icon = $this->image($this->pix_url('help'), array('class'=>'iconhelp', 'alt'=>get_string('scales')));
$image->alt = $link->text;
$image->title = $link->text;
}
$link->text = $this->image($image); $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);
if (!empty($link->linktext)) { // TODO: this is weird! return $this->output_tag('span', array('class' => 'helplink'), $this->link($link));
$link->text = "$link->title &#160; $link->text";
}
}
$link->prepare($this, $this->page, $this->target);
$this->prepare_event_handlers($link);
if (empty($link->url)) {
throw new coding_exception('Called $OUTPUT->link_to_popup($link) method without $link->url set.');
}
$linkurl = prepare_url($link->url);
$tagoptions = array(
'title' => $link->title,
'id' => $link->id,
'href' => ($linkurl) ? $linkurl : prepare_url($popup->url),
'class' => $link->get_classes_string());
return $this->output_tag('a', $tagoptions, $link->text);
} }
/** /**
@ -1499,7 +1480,7 @@ class core_renderer extends renderer_base {
* html_select::set_label($label) passing a html_label object * html_select::set_label($label) passing a html_label object
* *
* To add a help icon, use html_select::set_help($page, $text, $linktext) or * 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 * 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 * 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); $html .= $this->label($select->label);
} }
if (!empty($select->helpicon) && $select->helpicon instanceof moodle_help_icon) { if ($select->helpicon) {
$html .= $this->help_icon($select->helpicon); $html .= $this->help_icon($select->helpicon['helppage'], $select->helpicon['text'], $select->helpicon['component']);
} }
if ($select->rendertype == 'menu') { if ($select->rendertype == 'menu') {

View file

@ -890,7 +890,7 @@ class core_renderer_test extends UnitTestCase {
} }
public function test_heading_with_help() { public function test_heading_with_help() {
$originalicon = new moodle_help_icon(); $originalicon = new help_icon();
$originalicon->page = 'myhelppage'; $originalicon->page = 'myhelppage';
$originalicon->text = 'Cool help text'; $originalicon->text = 'Cool help text';

View file

@ -920,7 +920,7 @@ class flexible_table {
$select = html_select::make($downloadoptions, 'download', $this->defaultdownloadformat, false); $select = html_select::make($downloadoptions, 'download', $this->defaultdownloadformat, false);
$select->nothingvalue = ''; $select->nothingvalue = '';
$html .= $OUTPUT->select($select); $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>'; $html .= '</div></form>';
return $html; return $html;

View file

@ -2401,127 +2401,6 @@ function mdie($msg='', $errorcode=1) {
exit($errorcode); 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 * Returns html code to be used as help icon of modgrade form element
* *

View file

@ -15,7 +15,7 @@ if ($show_instructions) {
if (empty($CFG->usesid)) { if (empty($CFG->usesid)) {
echo '<br/>'; echo '<br/>';
echo '('.get_string("cookiesenabled").')'; 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> </div>

View 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 /// TODO XXX: This is only a quick hack ... helpfile locations should be provided as part of the provider definition
if ($provider->component == 'moodle') { 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 { } 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"; echo '<tr><th align="right">'.$providername.$helpbtn.'</th><td colspan="'.$number_procs.'"></td></tr>'."\n";

View file

@ -1009,7 +1009,7 @@ class assignment_base {
} else { } else {
echo '<div class="format">'; echo '<div class="format">';
echo $OUTPUT->select(html_select::make(format_text_menu(), "format", $submission->format, false)); 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>'; echo '</div>';
} }
} }
@ -1418,7 +1418,7 @@ class assignment_base {
echo '<label for="mailinfo">'.get_string('enableemailnotification','assignment').'</label>'; echo '<label for="mailinfo">'.get_string('enableemailnotification','assignment').'</label>';
echo '<input type="hidden" name="mailinfo" value="0" />'; echo '<input type="hidden" name="mailinfo" value="0" />';
echo '<input type="checkbox" id="mailinfo" name="mailinfo" value="1" '.$lastmailinfo.' />'; 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>';
echo '<div class="fastgbutton"><input type="submit" name="fastg" value="'.get_string('saveallfeedback', 'assignment').'" /></div>'; echo '<div class="fastgbutton"><input type="submit" name="fastg" value="'.get_string('saveallfeedback', 'assignment').'" /></div>';
echo '</div>'; echo '</div>';
@ -1436,7 +1436,7 @@ class assignment_base {
echo '</td>'; echo '</td>';
echo '<td>'; echo '<td>';
echo '<input type="text" id="perpage" name="perpage" size="1" value="'.$perpage.'" />'; 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 '</td></tr>';
echo '<tr><td>'; echo '<tr><td>';
echo '<label for="quickgrade">'.get_string('quickgrade','assignment').'</label>'; echo '<label for="quickgrade">'.get_string('quickgrade','assignment').'</label>';
@ -1444,7 +1444,7 @@ class assignment_base {
echo '<td>'; echo '<td>';
$checked = $quickgrade ? 'checked="checked"' : ''; $checked = $quickgrade ? 'checked="checked"' : '';
echo '<input type="checkbox" id="quickgrade" name="quickgrade" value="1" '.$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 '</td></tr>';
echo '<tr><td colspan="2">'; echo '<tr><td colspan="2">';
echo '<input type="submit" value="'.get_string('savepreferences').'" />'; echo '<input type="submit" value="'.get_string('savepreferences').'" />';

View file

@ -42,8 +42,8 @@ echo $OUTPUT->header();
<form action="../empty.php" method="post" target="empty" id="inputForm" <form action="../empty.php" method="post" target="empty" id="inputForm"
onsubmit="return empty_field_and_submit()" style="margin:0"> onsubmit="return empty_field_and_submit()" style="margin:0">
<input type="text" id="input_chat_message" name="chat_message" size="50" value="" /> <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 /> <?php echo $OUTPUT->help_icon('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> <input type="checkbox" id="auto" size="50" value="" checked="checked" /><label for="auto"><?php echo get_string('autoscroll', 'chat');?></label>
</form> </form>
<form action="insert.php" method="post" target="empty" id="sendForm"> <form action="insert.php" method="post" target="empty" id="sendForm">

View file

@ -29,7 +29,7 @@ echo $OUTPUT->header();
<form action="../empty.php" method="get" target="empty" id="inputform" <form action="../empty.php" method="get" target="empty" id="inputform"
onsubmit="return empty_field_and_submit();"> onsubmit="return empty_field_and_submit();">
<input type="text" name="chat_message" id="chat_message" size="60" value="" /> <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>
<form action="<?php echo "http://$CFG->chat_serverhost:$CFG->chat_serverport/"; ?>" method="get" target="empty" id="sendform"> <form action="<?php echo "http://$CFG->chat_serverhost:$CFG->chat_serverport/"; ?>" method="get" target="empty" id="sendform">

View file

@ -333,7 +333,7 @@ if (has_capability('mod/data:manageentries',$context)) {
echo '<tr>'; echo '<tr>';
echo '<td align="right">'.get_string('csvfile', 'data').':</td>'; echo '<td align="right">'.get_string('csvfile', 'data').':</td>';
echo '<td><input type="file" name="recordsfile" size="30" />'; 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><tr>';
echo '<td align="right">'.get_string('fielddelimiter', 'data').':</td>'; echo '<td align="right">'.get_string('fielddelimiter', 'data').':</td>';
echo '<td><input type="text" name="fielddelimiter" size="6" />'; echo '<td><input type="text" name="fielddelimiter" size="6" />';

View file

@ -306,7 +306,7 @@ if (($mode == 'new') && (!empty($newtype)) && confirm_sesskey()) { ///
echo '<label for="fieldform_jump">'.get_string('newfield','data').'</label>'; echo '<label for="fieldform_jump">'.get_string('newfield','data').'</label>';
$popupurl = $CFG->wwwroot.'/mod/data/field.php?d='.$data->id.'&mode=new&sesskey='. sesskey(); $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->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>';
echo '<div class="sortdefault">'; echo '<div class="sortdefault">';

View file

@ -73,7 +73,7 @@ class data_field_textarea extends data_field_base {
$str .= '<option value="'.s($key).'" '.$selected.'>'.$desc.'</option>'; $str .= '<option value="'.s($key).'" '.$selected.'>'.$desc.'</option>';
} }
$str .= '</select>'; $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>';
$str .= '</div>'; $str .= '</div>';

View file

@ -1549,7 +1549,7 @@ function data_print_ratings($data, $record) {
if ($data->scale < 0) { if ($data->scale < 0) {
if ($scale = $DB->get_record('scale', array('id'=>abs($data->scale)))) { 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)) { if (!empty($currentfields) && !empty($newfields)) {
echo "<h3>$strfieldmappings "; echo "<h3>$strfieldmappings ";
echo $OUTPUT->help_icon(moodle_help_icon::make('fieldmappings', $strfieldmappings, 'data')); echo $OUTPUT->help_icon('fieldmappings', $strfieldmappings, 'data');
echo '</h3><table>'; echo '</h3><table>';
foreach ($newfields as $nid => $newfield) { foreach ($newfields as $nid => $newfield) {

View 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 valign="top" colspan="2" align="center"><h3>'.$strexport.'</h3></td></tr>';
echo '<tr><td><label>'.$strexportaszip.'</label>'; 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>'; echo '</td><td>';
$options = array(); $options = array();
$options['sesskey'] = sesskey(); $options['sesskey'] = sesskey();
@ -343,7 +343,7 @@ echo $OUTPUT->button(html_form::make_button('preset.php', $options, $strexport))
echo '</td></tr>'; echo '</td></tr>';
echo '<tr><td><label>'.$strsaveaspreset.'</label>'; 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>'; echo '</td><td>';
$options = array(); $options = array();
$options['sesskey'] = sesskey(); $options['sesskey'] = sesskey();
@ -353,7 +353,7 @@ echo $OUTPUT->button(html_form::make_button('preset.php', $options, $strsave));
echo '</td></tr>'; echo '</td></tr>';
echo '<tr><td valign="top" colspan="2" align="center"><h3>'.$strimport.'</h3></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 '<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 '</td><td>';
echo '<form id="uploadpreset" method="post" action="preset.php">'; echo '<form id="uploadpreset" method="post" action="preset.php">';
echo '<fieldset class="invisiblefieldset">'; echo '<fieldset class="invisiblefieldset">';
@ -366,7 +366,7 @@ echo '</fieldset></form>';
echo '</td></tr>'; echo '</td></tr>';
echo '<tr valign="top"><td><label>'.$strusestandard.'</label>'; 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 '</td><td>';
echo '<form id="presets" method="post" action="preset.php" >'; echo '<form id="presets" method="post" action="preset.php" >';

View file

@ -203,7 +203,7 @@ echo '<tr><td valign="top">';
if ($mode != 'csstemplate' and $mode != 'jstemplate') { if ($mode != 'csstemplate' and $mode != 'jstemplate') {
// Add all the available fields for this data. // Add all the available fields for this data.
echo '<label for="availabletags">'.get_string('availabletags','data').'</label>'; 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 />'; echo '<br />';

View file

@ -142,11 +142,7 @@ if($check_anonymously) {
echo '</table>'; echo '</table>';
} }
}else { }else {
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help(get_string('insufficient_responses_for_this_group', 'feedback'), 'insufficient_responses', 'feedback');
$helpicon->text = get_string('insufficient_responses_for_this_group', 'feedback');
$helpicon->page = 'insufficient_responses';
$helpicon->module = 'feedback';
echo $OUTPUT->heading_with_help($helpicon);
} }
echo '</td></tr></table></div>'; echo '</td></tr></table></div>';
echo $OUTPUT->box_end(); echo $OUTPUT->box_end();

View file

@ -211,7 +211,7 @@ if($do_show == 'edit') {
if(is_array($feedbackitems)){ if(is_array($feedbackitems)){
$itemnr = 0; $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')); echo $OUTPUT->heading($helpbutton . get_string('preview', 'feedback'));
if(isset($SESSION->feedback->moving) AND $SESSION->feedback->moving->shouldmoving == 1) { if(isset($SESSION->feedback->moving) AND $SESSION->feedback->moving->shouldmoving == 1) {

View file

@ -97,14 +97,14 @@ if (($courses = $DB->get_records_sql_menu($sql, $params)) && !empty($searchcours
echo ' ' . get_string('courses') . ': '; echo ' ' . get_string('courses') . ': ';
echo $OUTPUT->select(html_select::make ($courses, 'coursefilter', $coursefilter)); echo $OUTPUT->select(html_select::make ($courses, 'coursefilter', $coursefilter));
echo '<input type="submit" value="'.get_string('mapcourse', 'feedback').'"/>'; 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="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="searchcourse" value="'.$searchcourse.'"/>';
echo '<input type="hidden" name="feedbackid" value="'.$feedback->id.'"/>'; 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 { } else {
echo '<input type="text" name="searchcourse" value="'.$searchcourse.'"/> <input type="submit" value="'.get_string('searchcourses').'"/>'; 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>'; echo '</form>';

View file

@ -112,7 +112,7 @@ if($do_show == 'showentries'){
if($feedback->course == SITEID){ if($feedback->course == SITEID){
echo '<div class="mdl-align"><a href="'.htmlspecialchars('analysis_course.php?id=' . $id . '&courseid='.$courseid).'">'; 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 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>'; echo '</div>';
}else { }else {
echo '<div class="mdl-align"><a href="'.htmlspecialchars('analysis.php?id=' . $id . '&courseid='.$courseid).'">'; echo '<div class="mdl-align"><a href="'.htmlspecialchars('analysis.php?id=' . $id . '&courseid='.$courseid).'">';

View file

@ -136,7 +136,7 @@ if($capabilities->mapcourse) {
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />'; echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="id" value="'.$id.'" />'; echo '<input type="hidden" name="id" value="'.$id.'" />';
echo '<button type="submit">'.get_string('mapcourses', 'feedback').'</button>'; 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 '</form>';
echo '<br />'; echo '<br />';
echo '</div>'; echo '</div>';

View file

@ -4212,7 +4212,7 @@ function forum_search_form($course, $search='') {
$output = '<div class="forumsearch">'; $output = '<div class="forumsearch">';
$output .= '<form action="'.$CFG->wwwroot.'/mod/forum/search.php" style="display:inline">'; $output .= '<form action="'.$CFG->wwwroot.'/mod/forum/search.php" style="display:inline">';
$output .= '<fieldset class="invisiblefieldset">'; $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 name="search" type="text" size="18" value="'.s($search, true).'" alt="search" />';
$output .= '<input value="'.get_string('searchforums', 'forum').'" type="submit" />'; $output .= '<input value="'.get_string('searchforums', 'forum').'" type="submit" />';
$output .= '<input name="id" type="hidden" value="'.$course->id.'" />'; $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 ($forum->scale < 0) {
if ($scale = $DB->get_record("scale", array("id" => abs($forum->scale)))) { 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>'; echo '</div>';
@ -8051,10 +8051,7 @@ function forum_extend_settings_navigation($settingsnav, $module=null) {
if (forum_is_forcesubscribed($forumobject)) { if (forum_is_forcesubscribed($forumobject)) {
$notekey = $forum->add(get_string("forcessubscribe", 'forum')); $notekey = $forum->add(get_string("forcessubscribe", 'forum'));
$string = get_string('allowchoice', 'forum'); $string = get_string('allowchoice', 'forum');
$helpbutton = new moodle_help_icon(); $helpbutton = $OUTPUT->help_icon("subscription", $string, "forum");
$helpbutton->page = "subscription";
$helpbutton->text = $string;
$helpbutton->module = "forum";
if (has_capability('mod/forum:managesubscriptions', $PAGE->cm->context)) { 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')); $url = new moodle_url($CFG->wwwroot.'/mod/forum/subscribe.php', array('id'=>$forumobject->id, 'force'=>'no'));
$forum->add($string, $url, navigation_node::TYPE_SETTING); $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) { } else if ($forumobject->forcesubscribe == FORUM_DISALLOWSUBSCRIBE) {
$string = get_string('disallowsubscribe', 'forum'); $string = get_string('disallowsubscribe', 'forum');
$notekey = $forum->add($string); $notekey = $forum->add($string);
$helpbutton = new moodle_help_icon(); $helpbutton = $OUTPUT->help_icon("subscription", $string, "forum");
$helpbutton->page = "subscription";
$helpbutton->text = $string;
$helpbutton->module = "forum";
} else { } else {
$string = get_string("forcesubscribe", "forum"); $string = get_string("forcesubscribe", "forum");
$notekey = $forum->add(get_string("allowsallsubscribe", 'forum')); $notekey = $forum->add(get_string("allowsallsubscribe", 'forum'));
$helpbutton = $OUTPUT->help_icon("subscription", $string, "forum");
$helpbutton = new moodle_help_icon();
$helpbutton->page = "subscription";
$helpbutton->text = $string;
$helpbutton->module = "forum";
if (has_capability('mod/forum:managesubscriptions', $PAGE->cm->context)) { 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')); $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) { if ($notekey!==false) {
$forum->get($notekey)->add_class('note'); $forum->get($notekey)->add_class('note');
if ($helpbutton!==false) { 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)) { if (has_capability('moodle/course:manageactivities', $PAGE->cm->context)) {

View file

@ -175,7 +175,7 @@ class mod_forum_mod_form extends moodleform_mod {
//we want the form to display them if they are set. //we want the form to display them if they are set.
if ($typevalue[0]=='news') { if ($typevalue[0]=='news') {
$type->addOption(get_string('namenews', 'forum'), '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->freeze();
$type->setPersistantFreeze(true); $type->setPersistantFreeze(true);
} }

View file

@ -27,7 +27,7 @@
} }
?>><?php echo get_string("no") ?> ?>><?php echo get_string("no") ?>
</option> </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> </td>
</tr> </tr>
<tr> <tr>

View file

@ -6,7 +6,7 @@
echo '('; echo '(';
print_string("maxsize", "", display_size(get_max_upload_file_size($CFG->maxbytes, $course->maxbytes))); print_string("maxsize", "", display_size(get_max_upload_file_size($CFG->maxbytes, $course->maxbytes)));
echo ') '; 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> </b></td>
<td style="width:70%"> <td style="width:70%">
@ -24,10 +24,10 @@
<td style="width:25%"><select size="1" name="dest"> <td style="width:25%"><select size="1" name="dest">
<option selected="selected" value="current"><?php print_string("currentglossary","glossary") ?></option> <option selected="selected" value="current"><?php print_string("currentglossary","glossary") ?></option>
<option value="new"><?php print_string("newglossary","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%" 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") ?>" /> <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> </td>
</tr> </tr>
</table> </table>

View file

@ -500,7 +500,7 @@ if ($ratingsmenuused) {
echo "<div class=\"boxaligncenter\"><input type=\"submit\" value=\"".get_string("sendinratings", "glossary")."\" />"; echo "<div class=\"boxaligncenter\"><input type=\"submit\" value=\"".get_string("sendinratings", "glossary")."\" />";
if ($glossary->scale < 0) { if ($glossary->scale < 0) {
if ($scale = $DB->get_record("scale", array("id"=>abs($glossary->scale)))) { 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>"; echo "</div>";

View file

@ -548,7 +548,7 @@ function hotpot_print_report_selector(&$course, &$hotpot, &$formdata) {
); );
print '<tr><td>'; 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">'; print '</td><th align="right" scope="col">'.get_string('reportcontent', 'hotpot').':</th><td colspan="7">';
foreach ($menus as $name => $options) { foreach ($menus as $name => $options) {
$value = $formdata[$name]; $value = $formdata[$name];
@ -587,7 +587,7 @@ function hotpot_print_report_selector(&$course, &$hotpot, &$formdata) {
); );
print '<tr><td>'; 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>'; print '</td>';
foreach ($menus as $name => $options) { foreach ($menus as $name => $options) {
$value = $formdata[$name]; $value = $formdata[$name];

View file

@ -136,7 +136,7 @@ class hotpot_report extends hotpot_default_report {
if (empty($table->caption)) { if (empty($table->caption)) {
$table->caption = get_string('indivresp', 'quiz'); $table->caption = get_string('indivresp', 'quiz');
if ($is_html) { 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; $hints = empty($response->hints) ? 0 : $response->hints;
@ -260,14 +260,14 @@ class hotpot_report extends hotpot_default_report {
$br = $is_html ? '<br />' : "\n"; $br = $is_html ? '<br />' : "\n";
$space = $is_html ? '&nbsp;' : ""; $space = $is_html ? '&nbsp;' : "";
$no_value = $is_html ? '--' : ""; $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 // table properties
unset($table); unset($table);
$table->border = 1; $table->border = 1;
$table->width = '100%'; $table->width = '100%';
$table->caption = get_string('itemanal', 'quiz'); $table->caption = get_string('itemanal', 'quiz');
if ($is_html) { 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 // initialize legend, if necessary
if (!empty($options['reportshowlegend'])) { if (!empty($options['reportshowlegend'])) {

View file

@ -62,11 +62,7 @@ $mform->set_data($data);
$PAGE->set_heading($strimportquestions); $PAGE->set_heading($strimportquestions);
echo $OUTPUT->header(); echo $OUTPUT->header();
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help($strimportquestions, 'import', 'lesson' );
$helpicon->text = $strimportquestions;
$helpicon->page = "import";
$helpicon->module = "lesson";
echo $OUTPUT->heading_with_help($helpicon);
if ($data = $mform->get_data()) { if ($data = $mform->get_data()) {

View file

@ -205,12 +205,7 @@ $PAGE->set_heading($strimportppt);
echo $OUTPUT->header(); echo $OUTPUT->header();
/// Print upload form /// Print upload form
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help($strimportppt, 'importppt', 'lesson');
$helpicon->text = $strimportppt;
$helpicon->page = "importppt";
$helpicon->module = "lesson";
echo $OUTPUT->heading_with_help($helpicon);
echo $OUTPUT->box_start('generalbox boxaligncenter'); echo $OUTPUT->box_start('generalbox boxaligncenter');
$mform->display(); $mform->display();
echo $OUTPUT->box_end(); echo $OUTPUT->box_end();

View file

@ -455,7 +455,7 @@ function lesson_mediafile_block_contents($cmid, $lesson) {
$link->title = get_string('mediafilepopup', 'lesson'); $link->title = get_string('mediafilepopup', 'lesson');
$content = $OUTPUT->link($link); $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 = new block_contents();
$bc->title = get_string('linkedmedia', 'lesson'); $bc->title = get_string('linkedmedia', 'lesson');

View file

@ -49,13 +49,7 @@ class mod_lesson_renderer extends plugin_renderer_base {
$output = $this->output->header(); $output = $this->output->header();
if (has_capability('mod/lesson:manage', $context)) { if (has_capability('mod/lesson:manage', $context)) {
$output .= $this->output->heading_with_help($activityname, 'overview', 'lesson');
$helpicon = new moodle_help_icon();
$helpicon->text = $activityname;
$helpicon->page = "overview";
$helpicon->module = "lesson";
$output .= $this->output->heading_with_help($helpicon);
if (!empty($currenttab)) { if (!empty($currenttab)) {
ob_start(); ob_start();

View 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="hidden" name="categoryid" value="' . $category->id . '" />';
$out .= ' <input type="submit" name="addrandom" value="'. $out .= ' <input type="submit" name="addrandom" value="'.
$straddtoquiz.'" '.$disabled.' />'; $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; return $out;
@ -516,7 +516,7 @@ if ($quiz_reordertool) {
echo '</div>'; echo '</div>';
} }
echo $OUTPUT->heading($pagetitle.": ".$quiz->name, 2); 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); quiz_print_status_bar($quiz);
$tabindex = 0; $tabindex = 0;

View file

@ -676,7 +676,7 @@ function quiz_print_pagecontrols($quiz, $pageurl, $page, $hasattempts) {
</div> </div>
</form> </form>
</div> </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 <?php
echo "\n</div>"; 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 '<label for="inputmaxgrade">' . get_string('maximumgradex', '', $a) . "</label>";
echo '<input type="hidden" name="savechanges" value="save" />'; echo '<input type="hidden" name="savechanges" value="save" />';
echo '<input type="submit" value="' . $strsave . '" />'; 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 '</fieldset>';
echo "</div></form>\n"; echo "</div></form>\n";
return $tabindex + 1; return $tabindex + 1;

View file

@ -823,16 +823,13 @@ function quiz_question_preview_button($quiz, $question, $label = false) {
} }
// Build the icon. // Build the icon.
$image = new html_image(); $image = $OUTPUT->image($OUTPUT->pix_url('t/preview'), array('class'=>'iconsmall', 'alt'=>$strpreviewquestion));
$image->src = $OUTPUT->pix_url('t/preview');
$image->add_class('iconsmall');
$image->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); parse_str(QUESTION_PREVIEW_POPUP_OPTIONS, $options);
$link->add_action(new popup_action('click', $link->url, 'questionpreview', $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);
} }
/** /**

View file

@ -2,7 +2,6 @@
/** /**
* This script calculates various statistics about student attempts * This script calculates various statistics about student attempts
* *
* @version $Id$
* @author Martin Dougiamas, Jamie Pratt, Tim Hunt and others. * @author Martin Dougiamas, Jamie Pratt, Tim Hunt and others.
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package quiz * @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 = html_select::make($downloadoptions, 'download', $this->table->defaultdownloadformat, false);
$select->nothingvalue = ''; $select->nothingvalue = '';
$quizinformationtablehtml .= $OUTPUT->select($select);; $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 .= '</div></form>';
} }
$quizinformationtablehtml .= $OUTPUT->table($quizinformationtable); $quizinformationtablehtml .= $OUTPUT->table($quizinformationtable);

View file

@ -146,7 +146,7 @@ class quiz_report_statistics_table extends flexible_table {
if ($question->_stats->negcovar){ if ($question->_stats->negcovar){
$negcovar = get_string('negcovar', 'quiz_statistics'); $negcovar = get_string('negcovar', 'quiz_statistics');
if (!$this->is_downloading()){ 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>'; return '<div class="negcovar">'.$negcovar.'</div>';
} else { } else {
return $negcovar; return $negcovar;

View file

@ -357,11 +357,7 @@
// Do the Action // Do the Action
# "setpageflags", "removepages", "strippages", "checklinks", "revertpages" # "setpageflags", "removepages", "strippages", "checklinks", "revertpages"
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help(get_string($action,"wiki"), $action, 'wiki');
$helpicon->text = get_string($action,"wiki");
$helpicon->page = $action;
$helpicon->module = "wiki";
echo $OUTPUT->heading_with_help($helpicon);
include $action.".html"; include $action.".html";
echo $OUTPUT->box_end(); echo $OUTPUT->box_end();

View file

@ -28,7 +28,7 @@ if($err->remark) {
<td> <td>
<input type="text" name="authorfieldpattern" size="30" value="<?php p($form->authorfieldpattern) ?>" /> <input type="text" name="authorfieldpattern" size="30" value="<?php p($form->authorfieldpattern) ?>" />
<?php <?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); } if (!empty($err->authorfieldpattern)) { echo $OUTPUT->error_text($err->authorfieldpattern); }
?> ?>
</td> </td>

View file

@ -365,7 +365,7 @@
/// Formatting Rules /// Formatting Rules
echo '<td class="howtowiki">'; 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 '</td>';
echo '</tr></table>'; echo '</tr></table>';

View file

@ -257,11 +257,7 @@ class question_category_object {
public function output_edit_lists() { public function output_edit_lists() {
global $OUTPUT; global $OUTPUT;
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help(get_string('editcategories', 'quiz'), 'categories', 'question');
$helpicon->text = get_string('editcategories', 'quiz');
$helpicon->page = 'categories';
$helpicon->module = 'question';
echo $OUTPUT->heading_with_help($helpicon);
foreach ($this->editlists as $context => $list){ foreach ($this->editlists as $context => $list){
$listhtml = $list->to_html(0, array('str'=>$this->str)); $listhtml = $list->to_html(0, array('str'=>$this->str));

View file

@ -625,16 +625,14 @@ class question_bank_preview_action_column extends question_bank_action_column_ba
protected function display_content($question, $rowclasses) { protected function display_content($question, $rowclasses) {
global $OUTPUT; global $OUTPUT;
if (question_has_capability_on($question, 'use')) { if (question_has_capability_on($question, 'use')) {
parse_str(QUESTION_PREVIEW_POPUP_OPTIONS, $options); // Build the icon.
$image = new html_image(); $image = $OUTPUT->image($OUTPUT->pix_url('t/preview'), array('class'=>'iconsmall', 'alt'=>$this->strpreview));
$image->src = $OUTPUT->pix_url('t/preview');
$image->add_class('iconsmall');
$image->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->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; $form->button->disabled = $disabled;
echo $OUTPUT->button($form); 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('dragdrop');
$PAGE->requires->yui2_lib('container'); $PAGE->requires->yui2_lib('container');
if (!$choiceformprinted) { if (!$choiceformprinted) {

View file

@ -119,11 +119,7 @@
} }
/// Display export form /// Display export form
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help($strexportquestions, 'export', 'quiz');
$helpicon->text = $strexportquestions;
$helpicon->page = 'export';
$helpicon->module = 'quiz';
echo $OUTPUT->heading_with_help($helpicon);
$export_form->display(); $export_form->display();

View file

@ -16,7 +16,7 @@ class question_export_form extends moodleform {
$radioarray = array(); $radioarray = array();
foreach ($fileformatnames as $shortname => $fileformatname) { foreach ($fileformatnames as $shortname => $fileformatname) {
$radioelement = &MoodleQuickForm::createElement('radio','format','',$fileformatname,$shortname); $radioelement = &MoodleQuickForm::createElement('radio','format','',$fileformatname,$shortname);
$radioelement->setHelpButton(array("$shortname",$fileformatname,"qformat_$shortname")); $mform->setHelpButton('format', array("$shortname",$fileformatname,"qformat_$shortname"));
$radioarray[] = $radioelement; $radioarray[] = $radioelement;
} }
$mform->addGroup($radioarray,'format','',array('<br />'),false); $mform->addGroup($radioarray,'format','',array('<br />'),false);

View file

@ -151,11 +151,7 @@
} }
} }
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help($txt->importquestions, 'import', 'quiz');
$helpicon->text = $txt->importquestions;
$helpicon->page = 'import';
$helpicon->module = 'quiz';
echo $OUTPUT->heading_with_help($helpicon);
/// Print upload form /// Print upload form
$import_form->display(); $import_form->display();

View file

@ -573,18 +573,10 @@ class question_calculated_qtype extends default_questiontype {
return; return;
break; break;
case 'datasetdefinitions': case 'datasetdefinitions':
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help(get_string("choosedatasetproperties", "quiz"), 'questiondatasets', 'quiz');
$helpicon->text = get_string("choosedatasetproperties", "quiz");
$helpicon->page = 'questiondatasets';
$helpicon->module = 'quiz';
echo $OUTPUT->heading_with_help($helpicon);
break; break;
case 'datasetitems': case 'datasetitems':
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help(get_string("editdatasets", "quiz"), 'questiondatasets', 'quiz');
$helpicon->text = get_string("editdatasets", "quiz");
$helpicon->page = 'questiondatasets';
$helpicon->module = 'quiz';
echo $OUTPUT->heading_with_help($helpicon);
break; break;
} }

View file

@ -228,11 +228,7 @@ class default_questiontype {
global $OUTPUT; global $OUTPUT;
$heading = $this->get_heading(empty($question->id)); $heading = $this->get_heading(empty($question->id));
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help($heading, $this->name(), $this->plugin_name());
$helpicon->text = $heading;
$helpicon->page = $this->name();
$helpicon->module = $this->plugin_name();
echo $OUTPUT->heading_with_help($helpicon);
$permissionstrs = array(); $permissionstrs = array();
if (!empty($question->id)){ if (!empty($question->id)){

View file

@ -89,11 +89,7 @@ class random_qtype extends default_questiontype {
function display_question_editing_page(&$mform, $question, $wizardnow){ function display_question_editing_page(&$mform, $question, $wizardnow){
$heading = $this->get_heading(empty($question->id)); $heading = $this->get_heading(empty($question->id));
$helpicon = new moodle_help_icon(); echo $OUTPUT->heading_with_help($heading, $this->name(), $this->plugin_name());
$helpicon->text = $heading;
$helpicon->page = $this->name();
$helpicon->module = $this->plugin_name();
echo $OUTPUT->heading_with_help($helpicon);
$mform->display(); $mform->display();
} }

View file

@ -127,7 +127,7 @@ echo $OUTPUT->header();
// Print the add and delete form // Print the add and delete form
coursetag_get_jscript(); 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); $edittagthisunit = get_string('edittagthisunit', $tagslang);
$arrowtitle = get_string('arrowtitle', $tagslang); $arrowtitle = get_string('arrowtitle', $tagslang);
$sesskey = sesskey(); $sesskey = sesskey();
@ -160,7 +160,7 @@ echo $OUTPUT->header();
</div> </div>
EOT; EOT;
if ($coursetabs) { 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); $editdeletemytag = get_string('editdeletemytag', $tagslang);
$outstr .= <<<EOT1 $outstr .= <<<EOT1
<div class="coursetag_edit_row"> <div class="coursetag_edit_row">

Some files were not shown because too many files have changed in this diff Show more