$lastcron = $DB->get_field_sql('SELECT MAX(lastcron) FROM {modules}');
if (time() - $lastcron > 3600 * 24) {
$strinstallation = get_string('installation', 'install');
- $helpbutton = $OUTPUT->help_icon(moodle_help_icon::make('install', $strinstallation));
+ $helpbutton = $OUTPUT->help_icon('install', $strinstallation);
echo $OUTPUT->box(get_string('cronwarning', 'admin').' '.$helpbutton, 'generalbox adminwarning');
}
$select->nothinglabel = $strchoosefiletoedit;
$select->set_label($selectionlabel);
echo $OUTPUT->select($select);
- echo $OUTPUT->help_icon(moodle_help_icon::make('langswitchstorage', $strfilestoredinhelp));
+ echo $OUTPUT->help_icon('langswitchstorage', $strfilestoredinhelp);
echo $OUTPUT->box_end();
if ($currentfile <> '') {
$select->nothinglabel = $strchoosefiletoedit;
$select->set_label($selectionlabel);
echo $OUTPUT->select($select);
- echo $OUTPUT->help_icon(moodle_help_icon::make('langswitchstorage', $strfilestoredinhelp));
+ echo $OUTPUT->help_icon('langswitchstorage', $strfilestoredinhelp);
echo $OUTPUT->box_end();
if (!empty($currentfile)) {
echo '<div>';
if ($uselocal) {
- $strsavetotitle = $strlanglocalpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlanglocalpackage));
- $straltdirtitle = $strlangmasterpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlangmasterpackage));
+ $strsavetotitle = $strlanglocalpackage . $OUTPUT->help_icon('langpackages', $strlanglocalpackage);
+ $straltdirtitle = $strlangmasterpackage . $OUTPUT->help_icon('langpackages', $strlangmasterpackage);
} else {
- $straltdirtitle = $strlanglocalpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlanglocalpackage));
- $strsavetotitle = $strlangmasterpackage . $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlangmasterpackage));
+ $straltdirtitle = $strlanglocalpackage . $OUTPUT->help_icon('langpackages', $strlanglocalpackage);
+ $strsavetotitle = $strlangmasterpackage . $OUTPUT->help_icon('langpackages', $strlangmasterpackage);
}
}
if (is_readable($ensrc)) {
echo '<fieldset><legend>'.$strlangmasterenglish;
- echo $OUTPUT->help_icon(moodle_help_icon::make('langpackages', $strlangmasterenglish));
+ echo $OUTPUT->help_icon('langpackages', $strlangmasterenglish);
echo '</legend>';
echo "<div class='mdl-align'>\n<textarea rows=\"$fileeditorrows\" cols=\"$fileeditorcols\" name=\"\">";
echo htmlspecialchars(file_get_contents($ensrc));
<td align="right" valign="top"><?php
print_string('publickey', 'mnet');
echo ': <br />';
- echo $OUTPUT->help_icon(moodle_help_icon::make("publickey", get_string('publickey', 'mnet'), "mnet", true));
+ echo $OUTPUT->help_icon("publickey", get_string('publickey', 'mnet'), "mnet", true);
?></td>
<?php
<tr>
<td align="right" valign="top"><?php print_string('ipaddress', 'mnet');
echo ': <br />';
- echo $OUTPUT->help_icon(moodle_help_icon::make("ipaddress", get_string('ipaddress', 'mnet'), "mnet", true));
+ echo $OUTPUT->help_icon("ipaddress", get_string('ipaddress', 'mnet'), "mnet", true);
?>:</td>
<td valign="top"><?php echo $mnet_peer->ip_address; ?></td>
</tr>
}
/// Print heading.
- $helpicon = new moodle_help_icon();
- $helpicon->text = $title;
- $helpicon->page = 'assignroles';
- echo $OUTPUT->heading_with_help($helpicon);
+ echo $OUTPUT->heading_with_help($title, 'assignroles');
if ($roleid) {
/// Show UI for assigning a particular role to users.
if ($hidden) { echo 'checked="checked" '; } ?>/>
<label for="hidden" title="<?php print_string('createhiddenassign', 'role'); ?>">
<?php print_string('hidden', 'role'); ?>
- <?php echo $OUTPUT->help_icon(moodle_help_icon::make('hiddenassign', get_string('createhiddenassign', 'role'))); ?>
+ <?php echo $OUTPUT->help_icon('hiddenassign', get_string('createhiddenassign', 'role')); ?>
</label></p>
<p><label for="extendperiod"><?php print_string('enrolperiod') ?></label><br />
}
/// Print heading.
- $helpicon = new moodle_help_icon();
- $helpicon->text = $title;
- $helpicon->page = 'checkpermissions';
- echo $OUTPUT->heading_with_help($helpicon);
+ echo $OUTPUT->heading_with_help($title, 'checkpermissions');
/// If a user has been chosen, show all the permissions for this user.
$reportuser = $userselector->get_selected_user();
} else if ($action == 'edit') {
$title = get_string('editingrolex', 'role', $rolenames[$roleid]->localname);
}
- $helpicon = new moodle_help_icon();
- $helpicon->text = $title;
- $helpicon->page = 'roles';
- echo $OUTPUT->heading_with_help($helpicon);
+ echo $OUTPUT->heading_with_help($title, 'roles');
/// Work out some button labels.
if ($action == 'add' || $action == 'duplicate') {
protected function add_header_cells() {
global $OUTPUT;
echo '<th colspan="' . count($this->displaypermissions) . '" scope="col">' .
- get_string('permission', 'role') . ' ' . $OUTPUT->help_icon(moodle_help_icon::make('permissions', get_string('permissions', 'role'))) . '</th>';
+ get_string('permission', 'role') . ' ' . $OUTPUT->help_icon('permissions', get_string('permissions', 'role')) . '</th>';
echo '<th class="risk" colspan="' . count($this->allrisks) . '" scope="col">' . get_string('risks','role') . '</th>';
}
$table->wrap = array('nowrap', '', 'nowrap','nowrap');
$table->width = '90%';
$table->head = array(
- get_string('role') . ' ' . $OUTPUT->help_icon(moodle_help_icon::make('roles', get_string('roles'))),
+ get_string('role') . ' ' . $OUTPUT->help_icon('roles', get_string('roles')),
get_string('description'),
get_string('shortname'),
get_string('edit')
include_once('tabs.php');
}
- $helpicon = new moodle_help_icon();
- $helpicon->text = $title;
- $helpicon->page = 'overrides';
- echo $OUTPUT->heading_with_help($helpicon);
+ echo $OUTPUT->heading_with_help($title, 'overrides');
if ($roleid) {
/// Show UI for overriding roles.
/// Print the header
admin_externalpage_print_header();
-$helpicon = new moodle_help_icon();
-$helpicon->text = $struploadpictures;
-$helpicon->page = 'uploadpictures';
-echo $OUTPUT->heading_with_help($helpicon);
+echo $OUTPUT->heading_with_help($struploadpictures, 'uploadpictures');
$mform = new admin_uploadpicture_form(null, $userfields);
if ($formdata = $mform->get_data()) {
} else {
admin_externalpage_print_header();
- $helpicon = new moodle_help_icon();
- $helpicon->text = get_string('uploadusers');
- $helpicon->page = 'uploadusers3';
- echo $OUTPUT->heading_with_help($helpicon);
+ echo $OUTPUT->heading_with_help(get_string('uploadusers'), 'uploadusers3');
$mform->display();
echo $OUTPUT->footer();
/// Print the form
-$helpicon = new moodle_help_icon();
-$helpicon->text = get_string('uploaduserspreview', 'admin');
-$helpicon->page = 'uploadusers2';
-echo $OUTPUT->heading_with_help($helpicon);
+echo $OUTPUT->heading_with_help(get_string('uploaduserspreview', 'admin'), 'uploadusers2');
$ci = 0;
$ri = 0;
$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');
$objs[] =& $mform->createElement('submit', 'addall', get_string('addall', 'bulkusers'));
$objs[] =& $mform->createElement('submit', 'removeall', get_string('removeall', 'bulkusers'));
$grp =& $mform->addElement('group', 'buttonsgrp', get_string('selectedlist', 'bulkusers'), $objs, array(' ', '<br />'), false);
- $grp->setHelpButton(array('selectedlist', get_string('selectedlist', 'bulkusers'), 'bulkusers'));
+ $mform->setHelpButton('buttonsgrp', array('selectedlist', get_string('selectedlist', 'bulkusers'), 'bulkusers'));
$renderer =& $mform->defaultRenderer();
$template = '<label class="qflabel" style="vertical-align:top">{label}</label> {element}';
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
echo '<label for="menubackup_site_files">'.get_string ("sitefilesused").'</label>';
- echo $OUTPUT->help_icon(moodle_help_icon::make('sitefilesused', get_string('sitefilesused')));
+ echo $OUTPUT->help_icon('sitefilesused', get_string('sitefilesused'));
echo "</b></td><td colspan=\"2\">";
$course_file_options[0] = get_string("no");
$course_file_options[1] = get_string("yes");
echo '<label for="shortnamefield">'.get_string ('shortname').'</label>';
echo "</td>";
echo "<td><input type=\"text\" id=\"shortnamefield\" name=\"shortname\" maxlength=\"100\" size=\"20\" value=\"".s($form1->shortname)."\" alt=\"".get_string("shortname")."\" />" ;
- echo $OUTPUT->help_icon(moodle_help_icon::make("courseshortname", get_string("shortname"))) ;
+ echo $OUTPUT->help_icon("courseshortname", get_string("shortname"));
if (isset($err["shortname"])) echo $OUTPUT->error_text($err["shortname"]);
echo "</td>";
echo "</tr>";
echo '<label for="fullnamefield">'.get_string ('fullname').'</label>';
echo "</td>";
echo "<td><input type=\"text\" id=\"fullnamefield\" name=\"fullname\" maxlength=\"254\" size=\"50\" value=\"".s($form1->fullname)."\" alt=\" ".get_string("fullname")."\" />" ;
- echo $OUTPUT->help_icon(moodle_help_icon::make("coursefullname", get_string("fullname"))) ;
+ echo $OUTPUT->help_icon("coursefullname", get_string("fullname"));
if (isset($err["fullname"])) echo $OUTPUT->error_text($err["fullname"]);
echo"</td></tr>";
} else {
$yearselector = html_select::make_time_selector('years', "startyear", $form1->startdate);
echo $OUTPUT->select($dayselector) . $OUTPUT->select($monthselector) . $OUTPUT->select($yearselector);
- echo $OUTPUT->help_icon(moodle_help_icon::make("coursestartdate", get_string("startdate")));
+ echo $OUTPUT->help_icon("coursestartdate", get_string("startdate"));
} else {
print_string('notavailable');
echo '<input type="hidden" name="startyear" value="0" />';
//Now print the Groups tr (assume there is no $info->backup_groups)
echo "<tr>";
echo "<td align=\"right\" colspan=\"2\"><b>";
- $helplink = $OUTPUT->help_icon(moodle_help_icon::make('grouprestore', get_string('groups')));
+ $helplink = $OUTPUT->help_icon('grouprestore', get_string('groups'));
echo '<label for="menurestore_groups">'.get_string ("groups").'</label>'.$helplink;
echo "</b></td><td colspan=\"2\">";
if (empty($CFG->enablegroupings)) {
'<input id="searchform_search" name="search" type="text" size="16" />';
$this->content->text .= '<button id="searchform_button" type="submit" title="'.$search.'">'.$button.'</button><br />';
$this->content->text .= '<a href="'.$CFG->wwwroot.'/mod/forum/search.php?id='.$this->page->course->id.'">'.$advancedsearch.'</a>';
- $this->content->text .= $OUTPUT->help_icon(moodle_help_icon::make('search', $advancedsearch));
+ $this->content->text .= $OUTPUT->help_icon('search', $advancedsearch);
$this->content->text .= '</fieldset></form></div>';
return $this->content;
$tagthisunit = get_string('tagthisunit', $tagslang);
$buttonadd = get_string('add', $tagslang);
$arrowtitle = get_string('arrowtitle', $tagslang);
- $coursetaghelpbutton = $OUTPUT->help_icon(moodle_help_icon::make('addtags', 'adding tags', $tagslang));
+ $coursetaghelpbutton = $OUTPUT->help_icon('addtags', 'adding tags', $tagslang);
$sesskey = sesskey();
$arrowright = $OUTPUT->pix_url('t/arrow_left');
$this->content->footer .= <<<EOT
$PAGE->set_focuscontrol('theform.summary');
echo $OUTPUT->header();
-$helpicon = new moodle_help_icon();
-$helpicon->text = $strsummaryof;
-$helpicon->page = 'summaries';
-echo $OUTPUT->heading_with_help($helpicon);
+echo $OUTPUT->heading_with_help($strsummaryof, 'summaries');
$mform->display();
echo $OUTPUT->footer();
\ No newline at end of file
$strusersnew = get_string("usersnew");
$strimportgroups = get_string("importgroups");
-$helpicon = new moodle_help_icon();
-$helpicon->text = $strimportgroups;
-$helpicon->page = 'uploadgroups';
-echo $OUTPUT->heading_with_help($helpicon);
+echo $OUTPUT->heading_with_help($strimportgroups, 'uploadgroups');
$maxuploadsize = get_max_upload_file_size();
echo '<p align="center">';
$select = html_select::make($choices, 'groupmode', $groupmode, false);
$select->disabled = $course->groupmodeforce;
echo $OUTPUT->select($select);
- echo $OUTPUT->help_icon(moodle_help_icon::make('groupmode', get_string('groupmode')));
+ echo $OUTPUT->help_icon('groupmode', get_string('groupmode'));
echo '</td></tr>';
}
}
require($CFG->dirroot.'/'.$CFG->admin.'/roles/tabs.php');
}
- $helpicon = new moodle_help_icon();
- $helpicon->page = 'mods';
- $helpicon->text = $pageheading;
- $helpicon->module = $module->name;
- echo $OUTPUT->heading_with_help($helpicon, $OUTPUT->pix_url('icon', $module->name));
+ echo $OUTPUT->heading_with_help($pageheading, 'mods', $module->name, 'icon');
$mform->display();
echo $OUTPUT->select(html_select::make($roleoptions,'roleid',$roleid,false));
echo '<label for="menuaction">'.get_string('showactions').'</label>'."\n";
echo $OUTPUT->select(html_select::make($actionoptions,'action',$action,false));
- echo $OUTPUT->help_icon(moodle_help_icon::make('participationreport',get_string('participationreport')));
+ echo $OUTPUT->help_icon('participationreport', get_string('participationreport'));
echo '<input type="submit" value="'.get_string('go').'" />'."\n</div></form>\n";
$baseurl = $CFG->wwwroot.'/course/report/participation/index.php?id='.$course->id.'&roleid='
$select->label = get_string("withselectedusers");
$select->add_action('change', 'conditionalsubmit', array('formid' => 'studentsform'));
echo $OUTPUT->select($select);
- echo $OUTPUT->help_icon(moodle_help_icon::make("participantswithselectedusers", get_string("withselectedusers")));
+ echo $OUTPUT->help_icon("participantswithselectedusers", get_string("withselectedusers"));
echo '<input type="submit" value="' . get_string('ok') . '" />'."\n";
echo '</div>'."\n";
echo '</form>'."\n";
<tr valign="top">
<td align="right">an_authcode:</td>
<td><?php echo $OUTPUT->checkbox(html_select_option::make_checkbox('1', !empty($frm->an_authcode), get_string("adminauthcode", "enrol_authorize")), 'an_authcode'); ?>
- <?php echo $OUTPUT->help_icon(moodle_help_icon::make('authorize/authcode', 'authcode', 'enrol')); ?><br />
+ <?php echo $OUTPUT->help_icon('authorize/authcode', 'authcode', 'enrol'); ?><br />
</td>
</tr>
</tr>
<tr valign="top"><td colspan="2"><h4><?php print_string("adminauthorizeccapture", "enrol_authorize") ?>
- <?php echo $OUTPUT->help_icon(moodle_help_icon::make('authorize/orderreview', 'orderreview', 'enrol')); ?>
+ <?php echo $OUTPUT->help_icon('authorize/orderreview', 'orderreview', 'enrol'); ?>
</h4></td></tr>
<tr valign="top">
<td align="right">an_review:</td>
<td><?php echo $OUTPUT->checkbox(html_select_option::make_checkbox('1', !empty($frm->an_review), get_string("adminreview", "enrol_authorize")), 'an_review'); ?>
- <?php echo $OUTPUT->help_icon(moodle_help_icon::make('authorize/review', get_string('adminhelpreviewtitle', 'enrol_authorize'), 'enrol')); ?><br />
+ <?php echo $OUTPUT->help_icon('authorize/review', get_string('adminhelpreviewtitle', 'enrol_authorize'), 'enrol'); ?><br />
</td>
</tr>
<tr valign="top">
<td align="right">an_capture_day:</td>
<td><input type="text" name="an_capture_day" size="2" maxlength="2" value="<?php p($frm->an_capture_day) ?>" />
- <?php echo $OUTPUT->help_icon(moodle_help_icon::make('authorize/captureday', get_string('adminhelpcapturetitle', 'enrol_authorize'), 'enrol')); ?><br />
+ <?php echo $OUTPUT->help_icon('authorize/captureday', get_string('adminhelpcapturetitle', 'enrol_authorize'), 'enrol'); ?><br />
<?php print_string("reviewday", "enrol_authorize", $frm->an_capture_day) ?></td>
</tr>
$PAGE->set_button($managebutton);
echo $OUTPUT->header();
- $helpicon = new moodle_help_icon();
- $helpicon->text = $struploadcsv;
- $helpicon->page = 'authorize/uploadcsv';
- $helpicon->module = 'enrol';
- echo $OUTPUT->heading_with_help($helpicon);
+ echo $OUTPUT->heading_with_help($struploadcsv, 'authorize/uploadcsv', 'enrol');
/// Handle CSV file
if (($form = data_submitted()) && confirm_sesskey()) {
<input type="checkbox" value="1" name="enrol_createnewusers" <?php if ($frm->enrol_createnewusers) echo "checked=\"checked\"" ?> />
</td>
<td>
- <?php echo $OUTPUT->help_icon(moodle_help_icon::make('createnewusers', 'More detail about this option', 'enrol/imsenterprise')); ?>
+ <?php echo $OUTPUT->help_icon('createnewusers', 'More detail about this option', 'enrol/imsenterprise'); ?>
</td>
</tr>
<input type="checkbox" value="1" name="enrol_imsdeleteusers" <?php if ($frm->enrol_imsdeleteusers) echo "checked=\"checked\"" ?> />
</td>
<td>
- <?php echo $OUTPUT->help_icon(moodle_help_icon::make('deleteusers', 'More detail about this option', 'enrol/imsenterprise')); ?>
+ <?php echo $OUTPUT->help_icon('deleteusers', 'More detail about this option', 'enrol/imsenterprise'); ?>
</td>
</tr>
<input type="checkbox" value="1" name="enrol_imssourcedidfallback" <?php if ($frm->enrol_imssourcedidfallback) echo "checked=\"checked\"" ?> />
</td>
<td>
- <?php echo $OUTPUT->help_icon(moodle_help_icon::make('sourceddidfallback', 'More detail about this option', 'enrol/imsenterprise')); ?>
+ <?php echo $OUTPUT->help_icon('sourceddidfallback', 'More detail about this option', 'enrol/imsenterprise'); ?>
</td>
</tr>
<!--
<input type="text" <?php echo 'value="'.intval($frm->enrol_truncatecoursecodes).'"' ?> name="enrol_truncatecoursecodes" size="3" maxlength="3" />
</td>
<td>
- <?php echo $OUTPUT->help_icon(moodle_help_icon::make('truncatecoursecodes', 'More detail about this option', 'enrol/imsenterprise')); ?>
+ <?php echo $OUTPUT->help_icon('truncatecoursecodes', 'More detail about this option', 'enrol/imsenterprise'); ?>
</td>
</tr>
<input type="checkbox" value="1" name="enrol_createnewcourses" <?php if ($frm->enrol_createnewcourses) echo "checked=\"checked\"" ?> />
</td>
<td>
- <?php echo $OUTPUT->help_icon(moodle_help_icon::make('createnewcourses', 'More detail about this option', 'enrol/imsenterprise')); ?>
+ <?php echo $OUTPUT->help_icon('createnewcourses', 'More detail about this option', 'enrol/imsenterprise'); ?>
</td>
</tr>
<input type="checkbox" value="1" name="enrol_createnewcategories" <?php if ($frm->enrol_createnewcategories) echo "checked=\"checked\"" ?> />
</td>
<td>
- <?php echo $OUTPUT->help_icon(moodle_help_icon::make('categorisation', 'More detail about this option', 'enrol/imsenterprise')); ?>
+ <?php echo $OUTPUT->help_icon('categorisation', 'More detail about this option', 'enrol/imsenterprise'); ?>
</td>
</tr>
<input type="checkbox" value="1" name="enrol_imsunenrol" <?php if ($frm->enrol_imsunenrol) echo "checked=\"checked\"" ?> />
</td>
<td>
- <?php echo $OUTPUT->help_icon(moodle_help_icon::make('unenrol', 'More detail about this option', 'enrol/imsenterprise')); ?>
+ <?php echo $OUTPUT->help_icon('unenrol', 'More detail about this option', 'enrol/imsenterprise'); ?>
</td>
</tr>
<td align="right"><?php print_string('restricttarget', 'enrol_imsenterprise') ?>:</td>
<td colspan="2">
<input type="text" <?php echo 'value="'.htmlspecialchars($frm->enrol_imsrestricttarget).'"' ?> name="enrol_imsrestricttarget" size="20" maxlength="32" />
- <?php echo $OUTPUT->help_icon(moodle_help_icon::make('target', 'More detail about this option', 'enrol/imsenterprise')); ?>
+ <?php echo $OUTPUT->help_icon('target', 'More detail about this option', 'enrol/imsenterprise'); ?>
</td>
</tr>
<input type="checkbox" value="1" name="enrol_imscapitafix" <?php if ($frm->enrol_imscapitafix) echo "checked=\"checked\"" ?> />
</td>
<td>
- <?php echo $OUTPUT->help_icon(moodle_help_icon::make('capita', 'More detail about this option', 'enrol/imsenterprise')); ?>
+ <?php echo $OUTPUT->help_icon('capita', 'More detail about this option', 'enrol/imsenterprise'); ?>
</td>
</tr>
}
/// Print heading.
-$helpicon = new moodle_help_icon();
-$helpicon->text = $title;
-$helpicon->page = 'localfiltersettings';
-echo $OUTPUT->heading_with_help($helpicon);
+echo $OUTPUT->heading_with_help($title, 'localfiltersettings');
if (empty($availablefilters)) {
echo '<p class="centerpara">' . get_string('nofiltersenabled', 'filters') . "</p>\n";
public function get_header_cell() {
global $OUTPUT;
$headercell = clone($this->headercell);
- $headercell->text = get_string('aggregation', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('aggregation', 'aggregation', 'grade'));
+ $headercell->text = get_string('aggregation', 'grades').$OUTPUT->help_icon('aggregation', 'aggregation', 'grade');
return $headercell;
}
public function get_header_cell() {
global $OUTPUT;
$headercell = clone($this->headercell);
- $headercell->text = get_string('extracredit', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('aggregationcoefcombo', 'aggregationcoefcombo', 'grade'));
+ $headercell->text = get_string('extracredit', 'grades').$OUTPUT->help_icon('aggregationcoefcombo', 'aggregationcoefcombo', 'grade');
return $headercell;
}
public function get_header_cell() {
global $OUTPUT;
$headercell = clone($this->headercell);
- $headercell->text = get_string('weightuc', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('aggregationcoefweight', 'aggregationcoefweight', 'grade'));
+ $headercell->text = get_string('weightuc', 'grades').$OUTPUT->help_icon('aggregationcoefweight', 'aggregationcoefweight', 'grade');
return $headercell;
}
$headercell = clone($this->headercell);
$headercell->style .= 'width: 40px;';
$headercell->text = get_string('aggregateonlygraded', 'grades')
- . $OUTPUT->help_icon(moodle_help_icon::make('aggregateonlygraded', 'aggregateonlygraded', 'grade'));
+ . $OUTPUT->help_icon('aggregateonlygraded', 'aggregateonlygraded', 'grade');
return $headercell;
}
$headercell = clone($this->headercell);
$headercell->style .= 'width: 40px;';
$headercell->text = get_string('aggregatesubcats', 'grades')
- .$OUTPUT->help_icon(moodle_help_icon::make('aggregatesubcats', 'aggregatesubcats', 'grade'));
+ .$OUTPUT->help_icon('aggregatesubcats', 'aggregatesubcats', 'grade');
return $headercell;
}
$headercell = clone($this->headercell);
$headercell->style .= 'width: 40px;';
$headercell->text = get_string('aggregateoutcomes', 'grades')
- .$OUTPUT->help_icon(moodle_help_icon::make('aggregateoutcomes', 'aggregateoutcomes', 'grade'));
+ .$OUTPUT->help_icon('aggregateoutcomes', 'aggregateoutcomes', 'grade');
return $headercell;
}
public function get_header_cell() {
global $OUTPUT;
$headercell = clone($this->headercell);
- $headercell->text = get_string('droplow', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('droplow', 'droplow', 'grade'));
+ $headercell->text = get_string('droplow', 'grades').$OUTPUT->help_icon('droplow', 'droplow', 'grade');
return $headercell;
}
public function get_header_cell() {
global $OUTPUT;
$headercell = clone($this->headercell);
- $headercell->text = get_string('keephigh', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('keephigh', 'keephigh', 'grade'));
+ $headercell->text = get_string('keephigh', 'grades').$OUTPUT->help_icon('keephigh', 'keephigh', 'grade');
return $headercell;
}
public function get_header_cell() {
global $OUTPUT;
$headercell = clone($this->headercell);
- $headercell->text = get_string('multfactor', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('multfactor', 'multfactor', 'grade'));
+ $headercell->text = get_string('multfactor', 'grades').$OUTPUT->help_icon('multfactor', 'multfactor', 'grade');
return $headercell;
}
public function get_header_cell() {
global $OUTPUT;
$headercell = clone($this->headercell);
- $headercell->text = get_string('plusfactor', 'grades').$OUTPUT->help_icon(moodle_help_icon::make('plusfactor', 'plusfactor', 'grade'));
+ $headercell->text = get_string('plusfactor', 'grades').$OUTPUT->help_icon('plusfactor', 'plusfactor', 'grade');
return $headercell;
}
global $PAGE, $OUTPUT;
if ($this->is_enabled() && !$PAGE->user_is_editing() && isloggedin() && !isguestuser()) {
echo '<span id = "completionprogressid" class="completionprogress">'.get_string('yourprogress','completion').' ';
- echo $OUTPUT->help_icon(moodle_help_icon::make('completionicons',get_string('completionicons','completion'),'completion'));
+ echo $OUTPUT->help_icon('completionicons',get_string('completionicons','completion'),'completion');
echo '</span>';
}
}
* @param string $class class added to the element
* @return string html code to display a link to a popup window.
*/
-function link_to_popup_window ($url, $name=null, $linkname=null,
- $height=400, $width=500, $title=null,
- $options=null, $return=false) {
- global $OUTPUT;
-
- debugging('link_to_popup_window() has been deprecated. Please change your code to use $OUTPUT->link().');
-
- if ($options == 'none') {
- $options = null;
- }
-
- if (empty($linkname)) {
- throw new coding_exception('A link must have a descriptive text value! See $OUTPUT->link_to_popup() for usage.');
- }
-
- // Create a html_link object
- $link = html_link::make($url, $linkname);
- $link->title = $title;
-
- // Parse the $options string
- $popupparams = array();
- if (!empty($options)) {
- $optionsarray = explode(',', $options);
- foreach ($optionsarray as $option) {
- if (strstr($option, '=')) {
- $parts = explode('=', $option);
- if ($parts[1] == '0') {
- $popupparams[$parts[0]] = false;
- } else {
- $popupparams[$parts[0]] = $parts[1];
- }
- } else {
- $popupparams[$option] = true;
- }
- }
- }
-
- $popupaction = new popup_action('click', $url, $name, $popupparams);
- $link->add_action($popupaction);
-
- // Call the output method
- $output = $OUTPUT->link($link);
+function link_to_popup_window ($url, $name=null, $linkname=null, $height=400, $width=500, $title=null, $options=null, $return=false) {
+ debugging('link_to_popup_window() has been removed. Please change your code to use $OUTPUT->link(). Please note popups are discouraged for accessibility reasons');
- if ($return) {
- return $output;
- } else {
- echo $output;
- }
+ return $OUTPUT->link($url, $name);
}
/**
}
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
global $OUTPUT;
- if (!empty($text)) {
- throw new coding_exception('The $text parameter has been deprecated. Please update your code and use $OUTPUT->help_icon() instead. <br />' .
- "You will also need to copy the following text into a proper html help file if not already done so: <p>$text</p>");
- }
-
- if (!empty($imagetext)) {
- throw new coding_exception('The $imagetext parameter has been deprecated. Please update your code and use $OUTPUT->help_icon() instead.');
- }
-
- $helpicon = new moodle_help_icon();
- $helpicon->page = $page;
- $helpicon->text = $title;
- $helpicon->module = $module;
- $helpicon->linktext = $linktext;
+ $output = $OUTPUT->help_icon($page, $title, $module, $linktext);
- // If image is true, the defaults are handled by the helpicon's prepare method
- if (!$image) {
- $helpicon->image = false;
- }
-
- $output = $OUTPUT->help_icon($helpicon);
+ // hide image with CSS if needed
if ($return) {
return $output;
} else {
echo $output;
}
+}
+
+/**
+ * Print a help button.
+ *
+ * Prints a special help button that is a link to the "live" emoticon popup
+ *
+ * @todo Finish documenting this function
+ *
+ * @global object
+ * @global object
+ * @param string $form ?
+ * @param string $field ?
+ * @param boolean $return If true then the output is returned as a string, if false it is printed to the current page.
+ * @return string|void Depending on value of $return
+ */
+function emoticonhelpbutton($form, $field, $return = false) {
+ /// TODO: MDL-21215
+
+ debugging('emoticonhelpbutton() was removed, new text editors will implement this feature');
+}
+
+/**
+ * Returns a string of html with an image of a help icon linked to a help page on a number of help topics.
+ * Should be used only with htmleditor or textarea.
+ *
+ * @global object
+ * @global object
+ * @param mixed $helptopics variable amount of params accepted. Each param may be a string or an array of arguments for
+ * helpbutton.
+ * @return string Link to help button
+ */
+function editorhelpbutton(){
+ return '';
+
+ /// TODO: MDL-21215
+
+ global $CFG, $SESSION, $OUTPUT;
+ $items = func_get_args();
+ $i = 1;
+ $urlparams = array();
+ $titles = array();
+ foreach ($items as $item){
+ if (is_array($item)){
+ $urlparams[] = "keyword$i=".urlencode($item[0]);
+ $urlparams[] = "title$i=".urlencode($item[1]);
+ if (isset($item[2])){
+ $urlparams[] = "module$i=".urlencode($item[2]);
+ }
+ $titles[] = trim($item[1], ". \t");
+ } else if (is_string($item)) {
+ $urlparams[] = "button$i=".urlencode($item);
+ switch ($item) {
+ case 'reading' :
+ $titles[] = get_string("helpreading");
+ break;
+ case 'writing' :
+ $titles[] = get_string("helpwriting");
+ break;
+ case 'questions' :
+ $titles[] = get_string("helpquestions");
+ break;
+ case 'emoticons2' :
+ $titles[] = get_string("helpemoticons");
+ break;
+ case 'richtext2' :
+ $titles[] = get_string('helprichtext');
+ break;
+ case 'text2' :
+ $titles[] = get_string('helptext');
+ break;
+ default :
+ print_error('unknownhelp', '', '', $item);
+ }
+ }
+ $i++;
+ }
+ if (count($titles)>1){
+ //join last two items with an 'and'
+ $a = new object();
+ $a->one = $titles[count($titles) - 2];
+ $a->two = $titles[count($titles) - 1];
+ $titles[count($titles) - 2] = get_string('and', '', $a);
+ unset($titles[count($titles) - 1]);
+ }
+ $alttag = join (', ', $titles);
+ $paramstring = join('&', $urlparams);
+ $linkobject = '<img alt="'.$alttag.'" class="iconhelp" src="'.$OUTPUT->pix_url('help') . '" />';
+ $link = html_link::make(s('/lib/form/editorhelp.php?'.$paramstring), $linkobject);
+ $link->add_action(new popup_action('click', $link->url, 'popup', array('height' => 400, 'width' => 500)));
+ $link->title = $alttag;
+ return $OUTPUT->link($link);
}
+/**
+ * Print a help button.
+ *
+ * Prints a special help button for html editors (htmlarea in this case)
+ *
+ * @todo Write code into this function! detect current editor and print correct info
+ * @global object
+ * @return string Only returns an empty string at the moment
+ */
+function editorshortcutshelpbutton() {
+ /// TODO: MDL-21215
+
+ global $CFG;
+ //TODO: detect current editor and print correct info
+/* $imagetext = '<img src="' . $CFG->httpswwwroot . '/lib/editor/htmlarea/images/kbhelp.gif" alt="'.
+ get_string('editorshortcutkeys').'" class="iconkbhelp" />';
+
+ return helpbutton('editorshortcuts', get_string('editorshortcutkeys'), 'moodle', true, false, '', true, $imagetext);*/
+ return '';
+}
+
+
/**
* Returns an image of an up or down arrow, used for column sorting. To avoid unnecessary DB accesses, please
* provide this function with the language strings for sortasc and sortdesc.
* @return string|bool Depending on value of $return
*/
function print_scale_menu_helpbutton($courseid, $scale, $return=false) {
- // debugging('print_scale_menu_helpbutton() has been deprecated. Please change your code to use $OUTPUT->help_button($scaleselect).');
+ // debugging('print_scale_menu_helpbutton() has been deprecated. Please change your code to use $OUTPUT->help_scale($courseid, $scale).');
global $OUTPUT;
- $output = $OUTPUT->help_button(help_button::make_scale_menu($courseid, $scale));
+ $output = $OUTPUT->help_icon_scale($courseid, $scale);
if ($return) {
return $output;
global $OUTPUT;
- $helpicon = new moodle_help_icon();
- $helpicon->page = $helppage;
- $helpicon->text = $text;
- $helpicon->module = $module;
-
// Extract the src from $icon if it exists
if (preg_match('/src="([^"]*)"/', $icon, $matches)) {
$icon = $matches[1];
+ $icon = moodle_url($icon);
+ } else {
+ $icon = '';
}
- $output = $OUTPUT->heading_with_help($helpicon, $icon);
+ $output = $OUTPUT->heading_with_help($text, $helppage, $module, $icon);
if ($return) {
return $output;
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
- if (!is_array($helpbuttonargs)){
- $helpbuttonargs=array($helpbuttonargs);
- }else{
- $helpbuttonargs=$helpbuttonargs;
- }
- //we do this to to return html instead of printing it
- //without having to specify it in every call to make a button.
- if ('helpbutton' == $function){
- $defaultargs=array('', '', 'moodle', true, false, '', true);
- $helpbuttonargs=$helpbuttonargs + $defaultargs ;
- }
- $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
/**
* get html for help button
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
- if (!is_array($helpbuttonargs)){
- $helpbuttonargs=array($helpbuttonargs);
- }else{
- $helpbuttonargs=$helpbuttonargs;
- }
- //we do this to to return html instead of printing it
- //without having to specify it in every call to make a button.
- if ('helpbutton' == $function){
- $defaultargs=array('', '', 'moodle', true, false, '', true);
- $helpbuttonargs=$helpbuttonargs + $defaultargs ;
- }
- $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
/**
* get html for help button
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
- if (!is_array($helpbuttonargs)){
- $helpbuttonargs=array($helpbuttonargs);
- }else{
- $helpbuttonargs=$helpbuttonargs;
- }
- //we do this to to return html instead of printing it
- //without having to specify it in every call to make a button.
- if ('helpbutton' == $function){
- $defaultargs=array('', '', 'moodle', true, false, '', true);
- $helpbuttonargs=$helpbuttonargs + $defaultargs ;
- }
- $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
/**
* get html for help button
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
- if (!is_array($helpbuttonargs)){
- $helpbuttonargs=array($helpbuttonargs);
- }else{
- $helpbuttonargs=$helpbuttonargs;
- }
- //we do this to to return html instead of printing it
- //without having to specify it in every call to make a button.
- if ('helpbutton' == $function){
- $defaultargs=array('', '', 'moodle', true, false, '', true);
- $helpbuttonargs=$helpbuttonargs + $defaultargs ;
- }
- $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
/**
* set html for help button
}
function setHelpButton($helpbuttonargs, $function='helpbutton'){
- if (!is_array($helpbuttonargs)){
- $helpbuttonargs=array($helpbuttonargs);
- }else{
- $helpbuttonargs=$helpbuttonargs;
- }
- //we do this to to return html instead of printing it
- //without having to specify it in every call to make a button.
- if ('helpbutton' == $function){
- $defaultargs=array('', '', 'moodle', true, false, '', true);
- $helpbuttonargs=$helpbuttonargs + $defaultargs ;
- }
- $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
function getHelpButton() {
}
function setHelpButton($helpbuttonargs, $function='helpbutton') {
- if (!is_array($helpbuttonargs)) {
- $helpbuttonargs = array($helpbuttonargs);
- } else {
- $helpbuttonargs = $helpbuttonargs;
- }
- //we do this to to return html instead of printing it
- //without having to specify it in every call to make a button.
- if ('helpbutton' == $function){
- $defaultargs = array('', '', 'moodle', true, false, '', true);
- $helpbuttonargs = $helpbuttonargs + $defaultargs ;
- }
- $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
function getHelpButton() {
}
} //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
*
case 'createElement':
$menu = format_text_menu();
$this->load($menu);
- $this->setHelpButton(array('textformat', get_string('helpformatting')));
+ //$this->setHelpButton(array('textformat', get_string('helpformatting')));
break;
case 'updateValue' :
$value = $this->_findValue($caller->_constantValues);
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
- global $OUTPUT;
- if (!is_array($helpbuttonargs)){
- $helpbuttonargs=array($helpbuttonargs);
- }else{
- $helpbuttonargs=$helpbuttonargs;
- }
- //we do this to to return html instead of printing it
- //without having to specify it in every call to make a button.
- if ($function == 'helpbutton') {
- $defaultargs=array('', '', 'moodle', true, false, '', true);
- $helpbuttonargs=$helpbuttonargs + $defaultargs ;
- $this->_helpbutton=$OUTPUT->help_icon(call_user_func_array('moodle_help_icon::make', $helpbuttonargs));
- } else {
- $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
- }
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
/**
* set html for help button
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
- if (!is_array($helpbuttonargs)){
- $helpbuttonargs=array($helpbuttonargs);
- }else{
- $helpbuttonargs=$helpbuttonargs;
- }
- //we do this to to return html instead of printing it
- //without having to specify it in every call to make a button.
- if ('helpbutton' == $function){
- $defaultargs=array('', '', 'moodle', true, false, '', true);
- $helpbuttonargs=$helpbuttonargs + $defaultargs ;
- }
- $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
/**
* get html for help button
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
- if (!$this->_canUseHtmlEditor){
- if ('editorhelpbutton' == $function){
- $key = array_search('richtext2', $helpbuttonargs);
- if ($key !== FALSE){
- array_splice($helpbuttonargs, $key, 1, array('text2', 'emoticons2'));
- }
- } elseif ('helpbutton' == $function && $helpbuttonargs[0] == 'richtext2' && ((!isset($helpbuttonargs[2])) || $helpbuttonargs[2] == 'moodle')){
- //replace single 'richtext' help button with text and emoticon button when htmleditor off.
- return $this->setHelpButton(array('text2', 'emoticons2'), 'editorhelpbutton');
- }
- }
- return parent::setHelpButton($helpbuttonargs, $function);
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
function toHtml(){
$grades[$i] = $i;
}
$this->load($grades);
- $this->setHelpButton(array($COURSE->id), 'modgradehelpbutton');
+ //TODO: rewrite mod grading support in modforms
+ // $this->setHelpButton(array($COURSE->id), 'modgradehelpbutton');
return $result;
}
return parent::onQuickFormEvent($event, $arg, $caller);
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
- if (!is_array($helpbuttonargs)){
- $helpbuttonargs=array($helpbuttonargs);
- }else{
- $helpbuttonargs=$helpbuttonargs;
- }
- //we do this to to return html instead of printing it
- //without having to specify it in every call to make a button.
- if ('helpbutton' == $function){
- $defaultargs=array('', '', 'moodle', true, false, '', true);
- $helpbuttonargs=$helpbuttonargs + $defaultargs ;
- }
- $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
/**
* get html for help button
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
- if (!is_array($helpbuttonargs)){
- $helpbuttonargs=array($helpbuttonargs);
- }else{
- $helpbuttonargs=$helpbuttonargs;
- }
- //we do this to to return html instead of printing it
- //without having to specify it in every call to make a button.
- if ('helpbutton' == $function){
- $defaultargs=array('', '', 'moodle', true, false, '', true);
- $helpbuttonargs=$helpbuttonargs + $defaultargs ;
- }
- $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
/**
* get html for help button
* @category Admin
* @package admin
* @author Nicolas Connault <nicolasconnault@gmail.com>
- * @version $Id$
*/
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
- if (!is_array($helpbuttonargs)){
- $helpbuttonargs=array($helpbuttonargs);
- }else{
- $helpbuttonargs=$helpbuttonargs;
- }
- //we do this to to return html instead of printing it
- //without having to specify it in every call to make a button.
- if ('helpbutton' == $function){
- $defaultargs=array('', '', 'moodle', true, false, '', true);
- $helpbuttonargs=$helpbuttonargs + $defaultargs ;
- }
- $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
/**
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
- global $OUTPUT;
- if (!is_array($helpbuttonargs)){
- $helpbuttonargs=array($helpbuttonargs);
- }else{
- $helpbuttonargs=$helpbuttonargs;
- }
- //we do this to to return html instead of printing it
- //without having to specify it in every call to make a button.
- if ('helpbutton' == $function){
- $defaultargs=array('', '', 'moodle', true, false, '', true);
- $helpbuttonargs=$helpbuttonargs + $defaultargs ;
- $this->_helpbutton=$OUTPUT->help_icon(call_user_func_array('moodle_help_icon::make', $helpbuttonargs));
- } else {
- $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
- }
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
/**
* get html for help button
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
- if (!is_array($helpbuttonargs)){
- $helpbuttonargs=array($helpbuttonargs);
- }else{
- $helpbuttonargs=$helpbuttonargs;
- }
- //we do this to to return html instead of printing it
- //without having to specify it in every call to make a button.
- if ('helpbutton' == $function){
- $defaultargs=array('', '', 'moodle', true, false, '', true);
- $helpbuttonargs=$helpbuttonargs + $defaultargs ;
- }
- $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
/**
* get html for help button
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
- if (!is_array($helpbuttonargs)){
- $helpbuttonargs=array($helpbuttonargs);
- }else{
- $helpbuttonargs=$helpbuttonargs;
- }
- //we do this to to return html instead of printing it
- //without having to specify it in every call to make a button.
- if ('helpbutton' == $function){
- $defaultargs=array('', '', 'moodle', true, false, '', true);
- $helpbuttonargs=$helpbuttonargs + $defaultargs ;
- }
- $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
/**
* get html for help button
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
- if (!is_array($helpbuttonargs)){
- $helpbuttonargs=array($helpbuttonargs);
- }else{
- $helpbuttonargs=$helpbuttonargs;
- }
- //we do this to to return html instead of printing it
- //without having to specify it in every call to make a button.
- if ('helpbutton' == $function){
- $defaultargs=array('', '', 'moodle', true, false, '', true);
- $helpbuttonargs=$helpbuttonargs + $defaultargs ;
- }
- $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
/**
* get html for help button
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
- if (!is_array($helpbuttonargs)){
- $helpbuttonargs=array($helpbuttonargs);
- }else{
- $helpbuttonargs=$helpbuttonargs;
- }
- //we do this to to return html instead of printing it
- //without having to specify it in every call to make a button.
- if ('helpbutton' == $function){
- $defaultargs=array('', '', 'moodle', true, false, '', true);
- $helpbuttonargs=$helpbuttonargs + $defaultargs ;
- }
- $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
/**
* get html for help button
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
- global $SESSION;
- if (!is_array($helpbuttonargs)) {
- $helpbuttonargs = array($helpbuttonargs);
- } else {
- $helpbuttonargs = $helpbuttonargs;
- }
- //we do this to to return html instead of printing it
- //without having to specify it in every call to make a button.
- if ('helpbutton' == $function){
- $defaultargs = array('', '', 'moodle', true, false, '', true);
- $helpbuttonargs = $helpbuttonargs + $defaultargs ;
- if (in_array($helpbuttonargs[0], array('emoticons2', 'text2', 'richtext2'))) {
- $SESSION->inserttextform = $this->_formid;
- $SESSION->inserttextfield = $this->getAttribute('name');
- }
- } else if ('editorhelpbutton' == $function) {
- $specialhelp = array_intersect($helpbuttonargs, array('emoticons2', 'text2', 'richtext2'));
- if (!empty($specialhelp)) {
- $SESSION->inserttextform = $this->_formid;
- $SESSION->inserttextfield = $this->getAttribute('name');
- }
- }
- $this->_helpbutton = call_user_func_array($function, $helpbuttonargs);
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
/**
* get html for help button
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
- if (!is_array($helpbuttonargs)){
- $helpbuttonargs=array($helpbuttonargs);
- }else{
- $helpbuttonargs=$helpbuttonargs;
- }
- //we do this to to return html instead of printing it
- //without having to specify it in every call to make a button.
- if ('helpbutton' == $function){
- $defaultargs=array('', '', 'moodle', true, false, '', true);
- $helpbuttonargs=$helpbuttonargs + $defaultargs ;
- }
- $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
/**
* get html for help button
* @param string $function function name to call to get html
*/
function setHelpButton($helpbuttonargs, $function='helpbutton'){
- if (!is_array($helpbuttonargs)){
- $helpbuttonargs=array($helpbuttonargs);
- }else{
- $helpbuttonargs=$helpbuttonargs;
- }
- //we do this to to return html instead of printing it
- //without having to specify it in every call to make a button.
- if ('helpbutton' == $function){
- $defaultargs=array('', '', 'moodle', true, false, '', true);
- $helpbuttonargs=$helpbuttonargs + $defaultargs ;
- }
- $this->_helpbutton=call_user_func_array($function, $helpbuttonargs);
+ debugging('component setHelpButton() is not used any more, please use $mform->setHelpButton() instead');
}
function toHtml() {
* @param string $function - function to generate html from the arguments in $button
* @param string $function
*/
- function setHelpButton($elementname, $button, $suppresscheck=false, $function='helpbutton'){
+ function setHelpButton($elementname, $buttonargs, $suppresscheck=false, $function='helpbutton'){
global $OUTPUT;
- if (array_key_exists($elementname, $this->_elementIndex)){
+ if ($function !== 'helpbutton') {
+ debugging('parameter $function in moodle_form::setHelpButton() is not supported any more');
+ }
+
+ $buttonargs = (array)$buttonargs;
+
+ if (array_key_exists($elementname, $this->_elementIndex)) {
//_elements has a numeric index, this code accesses the elements by name
- $element=&$this->_elements[$this->_elementIndex[$elementname]];
- $buttonparams = array('page', 'text', 'module', 'image', 'linktext', 'text', 'return', 'imagetext');
- $helpiconoptions = array('page' => null, 'text' => null, 'module' => 'moodle', 'image' => null, 'linktext' => false);
+ $element = $this->_elements[$this->_elementIndex[$elementname]];
- foreach ($button as $key => $val) {
- if (isset($button[$key])) {
- $helpiconoptions[$buttonparams[$key]] = $val;
- }
- }
- $helpicon = moodle_help_icon::make($helpiconoptions['page'], $helpiconoptions['text'], $helpiconoptions['module'], $helpiconoptions['linktext']);
- if (!$helpiconoptions['image']) {
- $helpicon->image = false;
- }
+ $page = isset($buttonargs[0]) ? $buttonargs[0] : null;
+ $text = isset($buttonargs[1]) ? $buttonargs[1] : null;
+ $module = isset($buttonargs[2]) ? $buttonargs[2] : 'moodle';
+ $linktext = isset($buttonargs[3]) ? $buttonargs[3] : false;
+
+ $element->_helpbutton = $OUTPUT->help_icon($page, $text, $module, $linktext);
- $element->_helpbutton = $OUTPUT->help_icon($helpicon);
- }elseif (!$suppresscheck){
+ } else if (!$suppresscheck) {
print_error('nonexistentformelements', 'form', '', $elementname);
}
}
*/
public $form;
/**
- * @var moodle_help_icon $form An optional moodle_help_icon component
+ * @var help_icon $array help icon params
*/
public $helpicon;
/**
/**
* Adds a help icon next to the select menu.
*
- * This can be used in two ways:
- *
* <pre>
- * $select->set_help_icon($page, $text, $linktext);
- * // OR
- * $helpicon = new moodle_help_icon();
- * $helpicon->page = $page;
- * $helpicon->text = $text;
- * $helpicon->linktext = $linktext;
- * $select->set_help_icon($helpicon);
+ * $select->set_help_icon($page, $text, $component);
* </pre>
*
- * Use the second form when you need to add additional HTML attributes
- * to the label and/or JS actions.
- *
- * @param mixed $page Either the keyword that defines a help page or a moodle_help_icon object
+ * @param string $helppage Either the keyword that defines a help page or a help_icon object
* @param text $text The text of the help icon
+ * @param component $component
* @param boolean $linktext Whether or not to show text next to the icon
* @return void
*/
- public function set_help_icon($page, $text, $linktext=false) {
- if ($page instanceof moodle_help_icon) {
- $this->helpicon = $page;
- } else if (!empty($page)) {
- $this->helpicon = new moodle_help_icon();
- $this->helpicon->page = $page;
- $this->helpicon->text = $text;
- $this->helpicon->linktext = $linktext;
+ public function set_help_icon($helppage='', $text='', $component='moodle') {
+ if ($helppage) {
+ $this->helpicon = array('helppage'=>$helppage, 'text'=>$text, 'component'=>$component);
+ } else {
+ $this->helpicon = null;
}
}
// to be filled later
} else if ($url instanceof moodle_url) {
- $this->src = clone($url);
+ $this->url = clone($url);
} else if (is_string($url)) {
- $this->src = new moodle_url($url);
+ $this->url = new moodle_url($url);
} else {
throw new coding_style_exception('Image can be constructed only from moodle_url or string url.');
* @param moodle_url|string $url url of the image
* @param array $options image attributes such as title, id, alt, widht, height
*/
- public function __construct($url = null, array $options = null) {
+ public function __construct($src = null, array $options = null) {
parent::__construct($options);
- if (is_null($url)) {
+ if (is_null($src)) {
// to be filled later
- } else if ($url instanceof moodle_url) {
- $this->src = clone($url);
+ } else if ($src instanceof moodle_url) {
+ $this->src = clone($src);
- } else if (is_string($url)) {
- $this->src = new moodle_url($url);
+ } else if (is_string($src)) {
+ $this->src = new moodle_url($src);
} else {
throw new coding_style_exception('Image can be constructed only from moodle_url or string url.');
*
* @param mixed $url The URL to the image (string or moodle_url)
*/
- public static function make($url) {
- return new html_image($url);
+ public static function make($src) {
+ return new html_image($src);
}
}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @since Moodle 2.0
*/
-class moodle_help_icon extends labelled_html_component {
+class help_icon extends html_image {
+ public $page;
/**
- * @var html_link $link A html_link object that will hold the URL info
+ * @var string $module Which module is the page defined in
*/
- public $link;
/**
* @var string $text A descriptive text
*/
/**
* @var string $page The keyword that defines a help page
*/
- public $page;
- /**
- * @var string $module Which module is the page defined in
- */
- public $module = 'moodle';
+ public $component = 'moodle';
/**
* @var boolean $linktext Whether or not to show text next to the icon
*/
public $linktext = false;
+
/**
- * @var mixed $image The help icon. Can be set to true (will use default help icon),
- * false (will not use any icon), the URL to an image, or a full
- * html_image object.
+ * @var html_link $link A html_link object that will hold the URL info
*/
- public $image;
+ public $link;
/**
* Constructor: sets up the other components in case they are needed
+ * @param string $page The keyword that defines a help page
+ * @param string $text A descriptive text
+ * @param string $component
+ * @param bool $linktext add extra text to icon
* @return void
*/
- public function __construct() {
+ public function __construct($helppage, $text, $component='moodle', $linktext=false) {
+ global $CFG;
+
+ if (empty($helppage)) {
+ throw new coding_exception('A help_icon object requires a $helppage parameter');
+ }
+
+ if (empty($text)) {
+ throw new coding_exception('A help_icon object requires a $text parameter');
+ }
+
+ parent::__construct(null, array('class'=>'iconhelp'));
+
+ $this->helppage = $helppage;
+ $this->text = $text;
+ $this->component = $component;
+ $this->linktext = $linktext;
+
$this->link = new html_link();
- $this->image = new html_image();
+ $this->link->url = new moodle_url($CFG->wwwroot.'/help.php', array('module' => $this->component, 'file' => $this->helppage .'.html'));
+ // Warn users about new window for Accessibility
}
/**
public function prepare(renderer_base $output, moodle_page $page, $target) {
global $CFG;
- if (empty($this->page)) {
- throw new coding_exception('A moodle_help_icon object requires a $page parameter');
- }
-
- if (empty($this->text) && empty($this->link->text)) {
- throw new coding_exception('A moodle_help_icon object (or its $link attribute) requires a $text parameter');
- } else if (!empty($this->text) && empty($this->link->text)) {
- $this->link->text = $this->text;
+ if (empty($this->link->title)) {
+ $this->link->title = get_string('helpprefix2', '', trim($this->text, ". \t")) .' ('.get_string('newwindow').')';
}
- // fix for MDL-7734
- $this->link->url = new moodle_url($CFG->wwwroot.'/help.php', array('module' => $this->module, 'file' => $this->page .'.html'));
-
- // fix for MDL-7734
- if (!empty($page->course->lang)) {
- $this->link->url->param('forcelang', $page->course->lang);
- }
-
- // Catch references to the old text.html and emoticons.html help files that
- // were renamed in MDL-13233.
- if (in_array($this->page, array('text', 'emoticons', 'richtext'))) {
- $oldname = $this->page;
- $this->page .= '2';
- debugging("You are referring to the old help file '$oldname'. " .
- "This was renamed to '$this->page' because of MDL-13233. " .
- "Please update your code.", DEBUG_DEVELOPER);
- }
-
- if ($this->module == '') {
- $this->module = 'moodle';
+ if (empty($this->src)) {
+ $this->src = $output->pix_url('help');
}
- // Warn users about new window for Accessibility
- $this->title = get_string('helpprefix2', '', trim($this->text, ". \t")) .' ('.get_string('newwindow').')';
-
- // Prepare image and linktext
- if ($this->image && !($this->image instanceof html_image)) {
- $image = fullclone($this->image);
- $this->image = new html_image();
-
- if ($image instanceof moodle_url) {
- $this->image->src = $image->out();
- } else if ($image === true) {
- $this->image->src = $output->pix_url('help');
- } else if (is_string($image)) {
- $this->image->src = $image;
- }
+ if ($this->linktext) {
+ $this->image->alt = get_string('helpwiththis');
+ } else {
$this->image->alt = $this->text;
-
- if ($this->linktext) {
- $this->image->alt = get_string('helpwiththis');
- } else {
- $this->image->alt = $this->title;
- }
- $this->image->add_class('iconhelp');
- } else if (empty($this->image->src)) {
- if (!($this->image instanceof html_image)) {
- $this->image = new html_image();
- }
- $this->image->src = $output->pix_url('help');
}
- parent::prepare($output, $page, $target);
- }
-
- /**
- * This is a shortcut for creating a help_icon with only the 2 required params
- * @param string $page The keyword that defines a help page
- * @param string $text A descriptive text
- * @return moodle_help_icon A moodle_help_icon object with the two common fields initialised.
- */
- public static function make($page, $text, $module='moodle', $linktext=false) {
- $helpicon = new moodle_help_icon();
- $helpicon->page = $page;
- $helpicon->text = $text;
- $helpicon->module = $module;
- $helpicon->linktext = $linktext;
- return $helpicon;
- }
+ $popup = new popup_action('click', $this->link->url);
+ $this->link->add_action($popup);
- public static function make_scale_menu($courseid, $scale) {
- $helpbutton = new moodle_help_icon();
- $strscales = get_string('scales');
- $helpbutton->image->alt = $scale->name;
- $helpbutton->link->url = new moodle_url('/course/scales.php', array('id' => $courseid, 'list' => true, 'scaleid' => $scale->id));
- $popupaction = new popup_action('click', $helpbutton->url, 'ratingscale', $popupparams);
- $popupaction->width = 500;
- $popupaction->height = 400;
- $helpbutton->link->add_action($popupaction);
- $helpbutton->link->title = $scale->name;
- return $helpbutton;
+ parent::prepare($output, $page, $target);
}
}
*/
public function login_info() {
global $USER, $CFG, $DB;
-
+
if (during_initial_install()) {
return '';
}
-
+
$course = $this->page->course;
-
+
if (session_is_loggedinas()) {
$realuser = session_get_realuser();
$fullname = fullname($realuser, true);
} else {
$realuserinfo = '';
}
-
+
$loginurl = get_login_url();
-
+
if (empty($course->id)) {
// $course->id is not defined during installation
return '';
} else if (!empty($USER->id)) {
$context = get_context_instance(CONTEXT_COURSE, $course->id);
-
+
$fullname = fullname($USER, true);
$username = "<a $CFG->frametarget href=\"$CFG->wwwroot/user/view.php?id=$USER->id&course=$course->id\">$fullname</a>";
if (is_mnet_remote_user($USER) and $idprovider = $DB->get_record('mnet_host', array('id'=>$USER->mnethostid))) {
$loggedinas = get_string('loggedinnot', 'moodle').
" (<a $CFG->frametarget href=\"$loginurl\">".get_string('login').'</a>)';
}
-
+
$loggedinas = '<div class="logininfo">'.$loggedinas.'</div>';
-
+
if (isset($SESSION->justloggedin)) {
unset($SESSION->justloggedin);
if (!empty($CFG->displayloginfailures)) {
}
}
}
-
+
return $loggedinas;
}
$currlang = current_language();
$langs = get_list_of_languages();
-
+
if (count($langs) < 2) {
return '';
}
/*
* Centered heading with attached help button (same title text)
* and optional icon attached
- * @param moodle_help_icon $helpicon A moodle_help_icon object
- * @param mixed $image An image URL or a html_image object
+ * @param string $text A heading text
+ * @param string $page The keyword that defines a help page
+ * @param string $component component name
+ * @param string|moodle_url $icon
+ * @param string $iconalt icon alt text
* @return string HTML fragment
*/
- public function heading_with_help($helpicon, $image=false) {
- if (!($image instanceof html_image) && !empty($image)) {
- $htmlimage = new html_image();
- $htmlimage->src = $image;
- $image = $htmlimage;
+ public function heading_with_help($text, $helppage, $component='moodle', $icon='', $iconalt='') {
+ $image = '';
+ if ($icon) {
+ if ($icon instanceof moodle_url) {
+ $image = $this->image($icon, array('class'=>'icon', 'alt'=>$iconalt));
+ } else {
+ $image = $this->image($this->pix_url($icon, $component), array('class'=>'icon', 'alt'=>$iconalt));
+ }
}
- return $this->container($this->image($image) . $this->heading($helpicon->text, 2, 'main help') . $this->help_icon($helpicon), 'heading-with-help');
+
+ $help = $this->help_icon($helppage, $text, $component);
+
+ return $this->heading($image.$text.$help, 2, 'main help');
}
/**
* Print a help icon.
*
- * @param moodle_help_icon $helpicon A moodle_help_icon object, subclass of html_link
- *
+ * @param string $page The keyword that defines a help page
+ * @param string $text A descriptive text
+ * @param string $component component name
+ * @param bool $linktext show extra descriptive text
+
* @return string HTML fragment
*/
- public function help_icon($icon) {
- global $COURSE;
- $icon = clone($icon);
- $icon->prepare($this, $this->page, $this->target);
+ public function help_icon($helppage, $text=null, $component='moodle', $linktext=false) {
+ $icon = new help_icon($helppage, $text, $component, $linktext);
- $popup = new popup_action('click', $icon->link->url);
- $icon->link->add_action($popup);
-
- $image = null;
+ $icon->prepare($this, $this->page, $this->target);
- if (!empty($icon->image)) {
- $image = $icon->image;
- $image->add_class('iconhelp');
+ $icon->link->text = $this->image($icon);
+ if ($icon->linktext) {
+ $icon->link->text .= $icon->text;
}
- return $this->output_tag('span', array('class' => 'helplink'), $this->link_to_popup($icon->link, $image));
+ return $this->output_tag('span', array('class' => 'helplink'), $this->link($icon->link));
}
/**
- * Creates and returns a button to a popup window
+ * Print scale help icon.
*
- * @param html_link $link Subclass of html_component
- * @param moodle_popup $popup A moodle_popup object
- * @param html_image $image An optional image replacing the link text
- *
- * @return string HTML fragment
+ * @param int $courseid
+ * @param object $scale instance
+ * @return string HTML fragment
*/
- public function link_to_popup($link, $image=null) {
- //TODO: decide if this should be removed completely, because link() already handles this
- // we could also add html_link::make_popup() factory method
- $link = clone($link);
-
- // Use image if one is given
- if (!empty($image) && $image instanceof html_image) {
-
- if (empty($image->alt) || $image->alt == HTML_ATTR_EMPTY) {
- $image->alt = $link->text;
- $image->title = $link->text;
- }
-
- $link->text = $this->image($image);
-
- if (!empty($link->linktext)) { // TODO: this is weird!
- $link->text = "$link->title   $link->text";
- }
- }
-
- $link->prepare($this, $this->page, $this->target);
- $this->prepare_event_handlers($link);
+ public function help_icon_scale($courseid, stdClass $scale) {
+ global $CFG;
- if (empty($link->url)) {
- throw new coding_exception('Called $OUTPUT->link_to_popup($link) method without $link->url set.');
- }
+ $title = get_string('helpprefix2', '', $scale->name) .' ('.get_string('newwindow').')';
- $linkurl = prepare_url($link->url);
+ $icon = $this->image($this->pix_url('help'), array('class'=>'iconhelp', 'alt'=>get_string('scales')));
- $tagoptions = array(
- 'title' => $link->title,
- 'id' => $link->id,
- 'href' => ($linkurl) ? $linkurl : prepare_url($popup->url),
- 'class' => $link->get_classes_string());
+ $link = new html_link(new moodle_url($CFG->wwwroot.'/course/scales.php', array('id' => $courseid, 'list' => true, 'scaleid' => $scale->id)), $icon);
+ $popupaction = new popup_action('click', $link->url, 'ratingscale');
+ $link->add_action($popupaction);
- return $this->output_tag('a', $tagoptions, $link->text);
+ return $this->output_tag('span', array('class' => 'helplink'), $this->link($link));
}
/**
* html_select::set_label($label) passing a html_label object
*
* To add a help icon, use html_select::set_help($page, $text, $linktext) or
- * html_select::set_help($helpicon) passing a moodle_help_icon object
+ * html_select::set_help($helpicon) passing a help_icon object
*
* If you html_select::$rendertype to "radio", it will render radio buttons
* instead of a <select> menu, unless $multiple is true, in which case it
$html .= $this->label($select->label);
}
- if (!empty($select->helpicon) && $select->helpicon instanceof moodle_help_icon) {
- $html .= $this->help_icon($select->helpicon);
+ if ($select->helpicon) {
+ $html .= $this->help_icon($select->helpicon['helppage'], $select->helpicon['text'], $select->helpicon['component']);
}
if ($select->rendertype == 'menu') {
}
public function test_heading_with_help() {
- $originalicon = new moodle_help_icon();
+ $originalicon = new help_icon();
$originalicon->page = 'myhelppage';
$originalicon->text = 'Cool help text';
$select = html_select::make($downloadoptions, 'download', $this->defaultdownloadformat, false);
$select->nothingvalue = '';
$html .= $OUTPUT->select($select);
- $html .= $OUTPUT->help_icon(moodle_help_icon::make('tableexportformats', get_string('tableexportformats', 'table')));
+ $html .= $OUTPUT->help_icon('tableexportformats', get_string('tableexportformats', 'table'));
$html .= '</div></form>';
return $html;
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
*
if (empty($CFG->usesid)) {
echo '<br/>';
echo '('.get_string("cookiesenabled").')';
- echo $OUTPUT->help_icon(moodle_help_icon::make("cookies", get_string("cookiesenabled")));
+ echo $OUTPUT->help_icon("cookies", get_string("cookiesenabled"));
}
?>
</div>
/// TODO XXX: This is only a quick hack ... helpfile locations should be provided as part of the provider definition
if ($provider->component == 'moodle') {
- $helpbtn = $OUTPUT->help_icon(moodle_help_icon::make('moodle_'.$provider->name, $providername, 'message'));
+ $helpbtn = $OUTPUT->help_icon('moodle_'.$provider->name, $providername, 'message');
} else {
- $helpbtn = $OUTPUT->help_icon(moodle_help_icon::make('message_'.$provider->name, $providername, basename($provider->component)));
+ $helpbtn = $OUTPUT->help_icon('message_'.$provider->name, $providername, basename($provider->component));
}
echo '<tr><th align="right">'.$providername.$helpbtn.'</th><td colspan="'.$number_procs.'"></td></tr>'."\n";
} else {
echo '<div class="format">';
echo $OUTPUT->select(html_select::make(format_text_menu(), "format", $submission->format, false));
- echo $OUTPUT->help_icon(moodle_help_icon::make("textformat", get_string("helpformatting")));
+ echo $OUTPUT->help_icon("textformat", get_string("helpformatting"));
echo '</div>';
}
}
echo '<label for="mailinfo">'.get_string('enableemailnotification','assignment').'</label>';
echo '<input type="hidden" name="mailinfo" value="0" />';
echo '<input type="checkbox" id="mailinfo" name="mailinfo" value="1" '.$lastmailinfo.' />';
- echo $OUTPUT->help_icon(moodle_help_icon::make('emailnotification', get_string('enableemailnotification', 'assignment'), 'assignment')).'</p></div>';
+ echo $OUTPUT->help_icon('emailnotification', get_string('enableemailnotification', 'assignment'), 'assignment').'</p></div>';
echo '</div>';
echo '<div class="fastgbutton"><input type="submit" name="fastg" value="'.get_string('saveallfeedback', 'assignment').'" /></div>';
echo '</div>';
echo '</td>';
echo '<td>';
echo '<input type="text" id="perpage" name="perpage" size="1" value="'.$perpage.'" />';
- echo $OUTPUT->help_icon(moodle_help_icon::make('pagesize', get_string('pagesize','assignment'), 'assignment'));
+ echo $OUTPUT->help_icon('pagesize', get_string('pagesize','assignment'), 'assignment');
echo '</td></tr>';
echo '<tr><td>';
echo '<label for="quickgrade">'.get_string('quickgrade','assignment').'</label>';
echo '<td>';
$checked = $quickgrade ? 'checked="checked"' : '';
echo '<input type="checkbox" id="quickgrade" name="quickgrade" value="1" '.$checked.' />';
- echo $OUTPUT->help_icon(moodle_help_icon::make('quickgrade', get_string('quickgrade', 'assignment'), 'assignment')).'</p></div>';
+ echo $OUTPUT->help_icon('quickgrade', get_string('quickgrade', 'assignment'), 'assignment').'</p></div>';
echo '</td></tr>';
echo '<tr><td colspan="2">';
echo '<input type="submit" value="'.get_string('savepreferences').'" />';
<form action="../empty.php" method="post" target="empty" id="inputForm"
onsubmit="return empty_field_and_submit()" style="margin:0">
<input type="text" id="input_chat_message" name="chat_message" size="50" value="" />
- <?php echo $OUTPUT->help_icon(moodle_help_icon::make('chatting', get_string('helpchatting', 'chat'), 'chat', true)); ?><br />
- <input type="checkbox" id="auto" size="50" value="" checked='true' /><label for="auto"><?php echo get_string('autoscroll', 'chat');?></label>
+ <?php echo $OUTPUT->help_icon('chatting', get_string('helpchatting', 'chat'), 'chat', true); ?><br />
+ <input type="checkbox" id="auto" size="50" value="" checked="checked" /><label for="auto"><?php echo get_string('autoscroll', 'chat');?></label>
</form>
<form action="insert.php" method="post" target="empty" id="sendForm">
<form action="../empty.php" method="get" target="empty" id="inputform"
onsubmit="return empty_field_and_submit();">
<input type="text" name="chat_message" id="chat_message" size="60" value="" />
- <?php echo $OUTPUT->help_icon(moodle_help_icon::make("chatting", get_string("helpchatting", "chat"), "chat", true)); ?>
+ <?php echo $OUTPUT->help_icon("chatting", get_string("helpchatting", "chat"), "chat", true); ?>
</form>
<form action="<?php echo "http://$CFG->chat_serverhost:$CFG->chat_serverport/"; ?>" method="get" target="empty" id="sendform">
echo '<tr>';
echo '<td align="right">'.get_string('csvfile', 'data').':</td>';
echo '<td><input type="file" name="recordsfile" size="30" />';
- echo $OUTPUT->help_icon(moodle_help_icon::make('importcsv', get_string('csvimport', 'data'), 'data'));
+ echo $OUTPUT->help_icon('importcsv', get_string('csvimport', 'data'), 'data');
echo '</td><tr>';
echo '<td align="right">'.get_string('fielddelimiter', 'data').':</td>';
echo '<td><input type="text" name="fielddelimiter" size="6" />';
echo '<label for="fieldform_jump">'.get_string('newfield','data').'</label>';
$popupurl = $CFG->wwwroot.'/mod/data/field.php?d='.$data->id.'&mode=new&sesskey='. sesskey();
echo $OUTPUT->select(html_select::make_popup_form($popupurl, 'newtype', $menufield, "fieldform"));
- echo $OUTPUT->help_icon(moodle_help_icon::make('fields', get_string('addafield','data'), 'data'));
+ echo $OUTPUT->help_icon('fields', get_string('addafield','data'), 'data');
echo '</div>';
echo '<div class="sortdefault">';
$str .= '<option value="'.s($key).'" '.$selected.'>'.$desc.'</option>';
}
$str .= '</select>';
- $str .= $OUTPUT->help_icon(moodle_help_icon::make('textformat', get_string('helpformatting'), 'moodle'));
+ $str .= $OUTPUT->help_icon('textformat', get_string('helpformatting'), 'moodle');
$str .= '</div>';
$str .= '</div>';
if ($data->scale < 0) {
if ($scale = $DB->get_record('scale', array('id'=>abs($data->scale)))) {
- echo $OUTPUT->help_button(moodle_help_icon::make_scale_menu($data->course, $scale));
+ echo $OUTPUT->help_icon_scale($data->course, $scale);
}
}
if (!empty($currentfields) && !empty($newfields)) {
echo "<h3>$strfieldmappings ";
- echo $OUTPUT->help_icon(moodle_help_icon::make('fieldmappings', $strfieldmappings, 'data'));
+ echo $OUTPUT->help_icon('fieldmappings', $strfieldmappings, 'data');
echo '</h3><table>';
foreach ($newfields as $nid => $newfield) {
echo '<tr><td valign="top" colspan="2" align="center"><h3>'.$strexport.'</h3></td></tr>';
echo '<tr><td><label>'.$strexportaszip.'</label>';
-echo $OUTPUT->help_icon(moodle_help_icon::make('exportzip', get_string('help'), 'data', false));
+echo $OUTPUT->help_icon('exportzip', get_string('help'), 'data', false);
echo '</td><td>';
$options = array();
$options['sesskey'] = sesskey();
echo '</td></tr>';
echo '<tr><td><label>'.$strsaveaspreset.'</label>';
-echo $OUTPUT->help_icon(moodle_help_icon::make('savepreset', get_string('help'), 'data', false));
+echo $OUTPUT->help_icon('savepreset', get_string('help'), 'data', false);
echo '</td><td>';
$options = array();
$options['sesskey'] = sesskey();
echo '</td></tr>';
echo '<tr><td valign="top" colspan="2" align="center"><h3>'.$strimport.'</h3></td></tr>';
echo '<tr><td><label for="fromfile">'.$strfromfile.'</label>';
-echo $OUTPUT->help_icon(moodle_help_icon::make('importfromfile', get_string('help'), 'data', true));
+echo $OUTPUT->help_icon('importfromfile', get_string('help'), 'data', true);
echo '</td><td>';
echo '<form id="uploadpreset" method="post" action="preset.php">';
echo '<fieldset class="invisiblefieldset">';
echo '</td></tr>';
echo '<tr valign="top"><td><label>'.$strusestandard.'</label>';
-echo $OUTPUT->help_icon(moodle_help_icon::make('usepreset', get_string('help'), 'data', true));
+echo $OUTPUT->help_icon('usepreset', get_string('help'), 'data', true);
echo '</td><td>';
echo '<form id="presets" method="post" action="preset.php" >';
if ($mode != 'csstemplate' and $mode != 'jstemplate') {
// Add all the available fields for this data.
echo '<label for="availabletags">'.get_string('availabletags','data').'</label>';
- echo $OUTPUT->help_icon(moodle_help_icon::make('tags', get_string('tags'), 'data'));
+ echo $OUTPUT->help_icon('tags', get_string('tags'), 'data');
echo '<br />';
echo '</table>';
}
}else {
- $helpicon = new moodle_help_icon();
- $helpicon->text = get_string('insufficient_responses_for_this_group', 'feedback');
- $helpicon->page = 'insufficient_responses';
- $helpicon->module = 'feedback';
- echo $OUTPUT->heading_with_help($helpicon);
+ echo $OUTPUT->heading_with_help(get_string('insufficient_responses_for_this_group', 'feedback'), 'insufficient_responses', 'feedback');
}
echo '</td></tr></table></div>';
echo $OUTPUT->box_end();
if(is_array($feedbackitems)){
$itemnr = 0;
- $helpbutton = $OUTPUT->help_icon(moodle_help_icon::make('preview', get_string('preview','feedback'), 'feedback',true));
+ $helpbutton = $OUTPUT->help_icon('preview', get_string('preview','feedback'), 'feedback',true);
echo $OUTPUT->heading($helpbutton . get_string('preview', 'feedback'));
if(isset($SESSION->feedback->moving) AND $SESSION->feedback->moving->shouldmoving == 1) {
echo ' ' . get_string('courses') . ': ';
echo $OUTPUT->select(html_select::make ($courses, 'coursefilter', $coursefilter));
echo '<input type="submit" value="'.get_string('mapcourse', 'feedback').'"/>';
- echo $OUTPUT->help_icon(moodle_help_icon::make('mapcourses', '', 'feedback', true));
+ echo $OUTPUT->help_icon('mapcourses', '', 'feedback', true);
echo '<input type="button" value="'.get_string('searchagain').'" onclick="document.location=\'mapcourse.php?id='.$id.'\'"/>';
echo '<input type="hidden" name="searchcourse" value="'.$searchcourse.'"/>';
echo '<input type="hidden" name="feedbackid" value="'.$feedback->id.'"/>';
- echo $OUTPUT->help_icon(moodle_help_icon::make('searchcourses', '', 'feedback', true));
+ echo $OUTPUT->help_icon('searchcourses', '', 'feedback', true);
} else {
echo '<input type="text" name="searchcourse" value="'.$searchcourse.'"/> <input type="submit" value="'.get_string('searchcourses').'"/>';
- echo $OUTPUT->help_icon(moodle_help_icon::make('searchcourses', '', 'feedback', true));
+ echo $OUTPUT->help_icon('searchcourses', '', 'feedback', true);
}
echo '</form>';
if($feedback->course == SITEID){
echo '<div class="mdl-align"><a href="'.htmlspecialchars('analysis_course.php?id=' . $id . '&courseid='.$courseid).'">';
echo get_string('course') .' '. get_string('analysis', 'feedback') . ' ('.get_string('completed_feedbacks', 'feedback').': '.intval($completedFeedbackCount).')</a>';
- echo $OUTPUT->help_icon(moodle_help_icon::make('viewcompleted', '', 'feedback', true));
+ echo $OUTPUT->help_icon('viewcompleted', '', 'feedback', true);
echo '</div>';
}else {
echo '<div class="mdl-align"><a href="'.htmlspecialchars('analysis.php?id=' . $id . '&courseid='.$courseid).'">';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="id" value="'.$id.'" />';
echo '<button type="submit">'.get_string('mapcourses', 'feedback').'</button>';
- echo $OUTPUT->help_icon(moodle_help_icon::make('mapcourse', '', 'feedback', true));
+ echo $OUTPUT->help_icon('mapcourse', '', 'feedback', true);
echo '</form>';
echo '<br />';
echo '</div>';
$output = '<div class="forumsearch">';
$output .= '<form action="'.$CFG->wwwroot.'/mod/forum/search.php" style="display:inline">';
$output .= '<fieldset class="invisiblefieldset">';
- $output .= $OUTPUT->help_icon(moodle_help_icon::make('search', get_string('search')));
+ $output .= $OUTPUT->help_icon('search', get_string('search'));
$output .= '<input name="search" type="text" size="18" value="'.s($search, true).'" alt="search" />';
$output .= '<input value="'.get_string('searchforums', 'forum').'" type="submit" />';
$output .= '<input name="id" type="hidden" value="'.$course->id.'" />';
}
if ($forum->scale < 0) {
if ($scale = $DB->get_record("scale", array("id" => abs($forum->scale)))) {
- echo $OUTPUT->help_button(help_button::make_scale_menu($course->id, $scale));
+ echo $OUTPUT->help_icon_scale($course->id, $scale);
}
}
echo '</div>';
if (forum_is_forcesubscribed($forumobject)) {
$notekey = $forum->add(get_string("forcessubscribe", 'forum'));
$string = get_string('allowchoice', 'forum');
- $helpbutton = new moodle_help_icon();
- $helpbutton->page = "subscription";
- $helpbutton->text = $string;
- $helpbutton->module = "forum";
+ $helpbutton = $OUTPUT->help_icon("subscription", $string, "forum");
if (has_capability('mod/forum:managesubscriptions', $PAGE->cm->context)) {
$url = new moodle_url($CFG->wwwroot.'/mod/forum/subscribe.php', array('id'=>$forumobject->id, 'force'=>'no'));
$forum->add($string, $url, navigation_node::TYPE_SETTING);
} else if ($forumobject->forcesubscribe == FORUM_DISALLOWSUBSCRIBE) {
$string = get_string('disallowsubscribe', 'forum');
$notekey = $forum->add($string);
- $helpbutton = new moodle_help_icon();
- $helpbutton->page = "subscription";
- $helpbutton->text = $string;
- $helpbutton->module = "forum";
+ $helpbutton = $OUTPUT->help_icon("subscription", $string, "forum");
} else {
$string = get_string("forcesubscribe", "forum");
$notekey = $forum->add(get_string("allowsallsubscribe", 'forum'));
-
- $helpbutton = new moodle_help_icon();
- $helpbutton->page = "subscription";
- $helpbutton->text = $string;
- $helpbutton->module = "forum";
+ $helpbutton = $OUTPUT->help_icon("subscription", $string, "forum");
if (has_capability('mod/forum:managesubscriptions', $PAGE->cm->context)) {
$url = new moodle_url($CFG->wwwroot.'/mod/forum/subscribe.php', array('id'=>$forumobject->id, 'force'=>'yes'));
if ($notekey!==false) {
$forum->get($notekey)->add_class('note');
if ($helpbutton!==false) {
- $forum->get($notekey)->helpbutton = $OUTPUT->help_icon($helpbutton);
+ $forum->get($notekey)->helpbutton = $helpbutton;
}
}
if (has_capability('moodle/course:manageactivities', $PAGE->cm->context)) {
//we want the form to display them if they are set.
if ($typevalue[0]=='news') {
$type->addOption(get_string('namenews', 'forum'), 'news');
- $type->setHelpButton(array('forumtypenews', get_string('forumtype', 'forum'), 'forum'));
+ $mform->setHelpButton('type', array('forumtypenews', get_string('forumtype', 'forum'), 'forum'));
$type->freeze();
$type->setPersistantFreeze(true);
}
}
?>><?php echo get_string("no") ?>
</option>
- </select> <?php echo $OUTPUT->help_icon(moodle_help_icon::make("linkcategory", get_string("linkcategory", "glossary"), "glossary")) ?>
+ </select> <?php echo $OUTPUT->help_icon("linkcategory", get_string("linkcategory", "glossary"), "glossary") ?>
</td>
</tr>
<tr>
echo '(';
print_string("maxsize", "", display_size(get_max_upload_file_size($CFG->maxbytes, $course->maxbytes)));
echo ') ';
- echo $OUTPUT->help_icon(moodle_help_icon::make("filetoimport", get_string("filetoimport", "glossary"), "glossary"));
+ echo $OUTPUT->help_icon("filetoimport", get_string("filetoimport", "glossary"), "glossary");
?>
</b></td>
<td style="width:70%">
<td style="width:25%"><select size="1" name="dest">
<option selected="selected" value="current"><?php print_string("currentglossary","glossary") ?></option>
<option value="new"><?php print_string("newglossary","glossary") ?></option>
- </select> <?php echo $OUTPUT->help_icon(moodle_help_icon::make("destination", get_string("destination", "glossary"), "glossary")) ?></td>
+ </select> <?php echo $OUTPUT->help_icon("destination", get_string("destination", "glossary"), "glossary") ?></td>
<td style="width:25%" align="right"><?php print_string("importcategories","glossary") ?>:</td>
<td style="width:25%"><input type="checkbox" name="catsincl" value="1" alt="<?php print_string("importcategories","glossary") ?>" />
- <?php echo $OUTPUT->help_icon(moodle_help_icon::make("importcategories", get_string("importcategories", "glossary"), "glossary")) ?>
+ <?php echo $OUTPUT->help_icon("importcategories", get_string("importcategories", "glossary"), "glossary") ?>
</td>
</tr>
</table>
echo "<div class=\"boxaligncenter\"><input type=\"submit\" value=\"".get_string("sendinratings", "glossary")."\" />";
if ($glossary->scale < 0) {
if ($scale = $DB->get_record("scale", array("id"=>abs($glossary->scale)))) {
- echo $OUTPUT->help_button(help_button::make_scale_menu($course->id, $scale));
+ echo $OUTPUT->help_icon_scale($course->id, $scale);
}
}
echo "</div>";
);
print '<tr><td>';
- echo $OUTPUT->help_icon(moodle_help_icon::make('reportcontent', get_string('reportcontent', 'hotpot'), 'hotpot'));
+ echo $OUTPUT->help_icon('reportcontent', get_string('reportcontent', 'hotpot'), 'hotpot');
print '</td><th align="right" scope="col">'.get_string('reportcontent', 'hotpot').':</th><td colspan="7">';
foreach ($menus as $name => $options) {
$value = $formdata[$name];
);
print '<tr><td>';
- echo $OUTPUT->help_icon(moodle_help_icon::make('reportformat', get_string('reportformat', 'hotpot'), 'hotpot'));
+ echo $OUTPUT->help_icon('reportformat', get_string('reportformat', 'hotpot'), 'hotpot');
print '</td>';
foreach ($menus as $name => $options) {
$value = $formdata[$name];
if (empty($table->caption)) {
$table->caption = get_string('indivresp', 'quiz');
if ($is_html) {
- $table->caption .= $OUTPUT->help_icon(moodle_help_icon::make('responsestable', $table->caption, 'hotpot'));
+ $table->caption .= $OUTPUT->help_icon('responsestable', $table->caption, 'hotpot');
}
}
$hints = empty($response->hints) ? 0 : $response->hints;
$br = $is_html ? '<br />' : "\n";
$space = $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
unset($table);
$table->border = 1;
$table->width = '100%';
$table->caption = get_string('itemanal', 'quiz');
if ($is_html) {
- $table->caption .= $OUTPUT->help_icon(moodle_help_icon::make('analysistable', $table->caption, 'hotpot'));
+ $table->caption .= $OUTPUT->help_icon('analysistable', $table->caption, 'hotpot');
}
// initialize legend, if necessary
if (!empty($options['reportshowlegend'])) {
$PAGE->set_heading($strimportquestions);
echo $OUTPUT->header();
-$helpicon = new moodle_help_icon();
-$helpicon->text = $strimportquestions;
-$helpicon->page = "import";
-$helpicon->module = "lesson";
-echo $OUTPUT->heading_with_help($helpicon);
+echo $OUTPUT->heading_with_help($strimportquestions, 'import', 'lesson' );
if ($data = $mform->get_data()) {
echo $OUTPUT->header();
/// Print upload form
-$helpicon = new moodle_help_icon();
-$helpicon->text = $strimportppt;
-$helpicon->page = "importppt";
-$helpicon->module = "lesson";
-
-echo $OUTPUT->heading_with_help($helpicon);
+echo $OUTPUT->heading_with_help($strimportppt, 'importppt', 'lesson');
echo $OUTPUT->box_start('generalbox boxaligncenter');
$mform->display();
echo $OUTPUT->box_end();
$link->title = get_string('mediafilepopup', 'lesson');
$content = $OUTPUT->link($link);
- $content .= $OUTPUT->help_icon(moodle_help_icon::make("mediafilestudent", get_string("mediafile", "lesson"), "lesson"));
+ $content .= $OUTPUT->help_icon("mediafilestudent", get_string("mediafile", "lesson"), "lesson");
$bc = new block_contents();
$bc->title = get_string('linkedmedia', 'lesson');
$output = $this->output->header();
if (has_capability('mod/lesson:manage', $context)) {
-
- $helpicon = new moodle_help_icon();
- $helpicon->text = $activityname;
- $helpicon->page = "overview";
- $helpicon->module = "lesson";
-
- $output .= $this->output->heading_with_help($helpicon);
+ $output .= $this->output->heading_with_help($activityname, 'overview', 'lesson');
if (!empty($currenttab)) {
ob_start();
$out .= '<input type="hidden" name="categoryid" value="' . $category->id . '" />';
$out .= ' <input type="submit" name="addrandom" value="'.
$straddtoquiz.'" '.$disabled.' />';
- $out .= $OUTPUT->help_icon(moodle_help_icon::make('random', get_string('random', 'quiz'), 'quiz'));
+ $out .= $OUTPUT->help_icon('random', get_string('random', 'quiz'), 'quiz');
}
}
return $out;
echo '</div>';
}
echo $OUTPUT->heading($pagetitle.": ".$quiz->name, 2);
-echo $OUTPUT->help_icon(moodle_help_icon::make('editconcepts', get_string('basicideasofquiz', 'quiz'), 'quiz', get_string('basicideasofquiz', 'quiz')));
+echo $OUTPUT->help_icon('editconcepts', get_string('basicideasofquiz', 'quiz'), 'quiz', true);
quiz_print_status_bar($quiz);
$tabindex = 0;
</div>
</form>
</div>
- <?php echo $OUTPUT->help_icon(moodle_help_icon::make('random', get_string('random', 'quiz'), 'quiz')); ?>
+ <?php echo $OUTPUT->help_icon('random', get_string('random', 'quiz'), 'quiz'); ?>
<?php
echo "\n</div>";
}
echo '<label for="inputmaxgrade">' . get_string('maximumgradex', '', $a) . "</label>";
echo '<input type="hidden" name="savechanges" value="save" />';
echo '<input type="submit" value="' . $strsave . '" />';
- echo $OUTPUT->help_icon(moodle_help_icon::make('maxgrade', get_string('maximumgrade'), 'quiz'));
+ echo $OUTPUT->help_icon('maxgrade', get_string('maximumgrade'), 'quiz');
echo '</fieldset>';
echo "</div></form>\n";
return $tabindex + 1;
}
// Build the icon.
- $image = new html_image();
- $image->src = $OUTPUT->pix_url('t/preview');
- $image->add_class('iconsmall');
- $image->alt = $strpreviewquestion;
+ $image = $OUTPUT->image($OUTPUT->pix_url('t/preview'), array('class'=>'iconsmall', 'alt'=>$strpreviewquestion));
- $link = html_link::make("/question/preview.php?id=$question->id&quizid=$quiz->id", $strpreviewlabel);
+ $link = new html_link($CFG->wwwroot."/question/preview.php?id=$question->id&quizid=$quiz->id", $image, array('title' => $strpreviewquestion));
parse_str(QUESTION_PREVIEW_POPUP_OPTIONS, $options);
$link->add_action(new popup_action('click', $link->url, 'questionpreview', $options));
- $link->title = $strpreviewquestion;
- return $OUTPUT->link_to_popup($link, $image);
+
+ return $OUTPUT->link($link);
}
/**
/**
* This script calculates various statistics about student attempts
*
- * @version $Id$
* @author Martin Dougiamas, Jamie Pratt, Tim Hunt and others.
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package quiz
$select = html_select::make($downloadoptions, 'download', $this->table->defaultdownloadformat, false);
$select->nothingvalue = '';
$quizinformationtablehtml .= $OUTPUT->select($select);;
- $quizinformationtablehtml .= $OUTPUT->help_icon(moodle_help_icon::make('tableexportformats', get_string('tableexportformats', 'table')));
+ $quizinformationtablehtml .= $OUTPUT->help_icon('tableexportformats', get_string('tableexportformats', 'table'));
$quizinformationtablehtml .= '</div></form>';
}
$quizinformationtablehtml .= $OUTPUT->table($quizinformationtable);
if ($question->_stats->negcovar){
$negcovar = get_string('negcovar', 'quiz_statistics');
if (!$this->is_downloading()){
- $negcovar .= $OUTPUT->help_icon(moodle_help_icon::make('negcovar', $negcovar, 'quiz_statistics'));
+ $negcovar .= $OUTPUT->help_icon('negcovar', $negcovar, 'quiz_statistics');
return '<div class="negcovar">'.$negcovar.'</div>';
} else {
return $negcovar;
// Do the Action
# "setpageflags", "removepages", "strippages", "checklinks", "revertpages"
- $helpicon = new moodle_help_icon();
- $helpicon->text = get_string($action,"wiki");
- $helpicon->page = $action;
- $helpicon->module = "wiki";
- echo $OUTPUT->heading_with_help($helpicon);
+ echo $OUTPUT->heading_with_help(get_string($action,"wiki"), $action, 'wiki');
include $action.".html";
echo $OUTPUT->box_end();
<td>
<input type="text" name="authorfieldpattern" size="30" value="<?php p($form->authorfieldpattern) ?>" />
<?php
- echo $OUTPUT->help_icon(moodle_help_icon::make('revertauthorfieldpattern', get_string('authorfieldpattern', 'wiki'), 'wiki'));
+ echo $OUTPUT->help_icon('revertauthorfieldpattern', get_string('authorfieldpattern', 'wiki'), 'wiki');
if (!empty($err->authorfieldpattern)) { echo $OUTPUT->error_text($err->authorfieldpattern); }
?>
</td>
/// Formatting Rules
echo '<td class="howtowiki">';
- echo $OUTPUT->help_icon(moodle_help_icon::make('howtowiki', get_string('howtowiki', 'wiki'), 'wiki'));
+ echo $OUTPUT->help_icon('howtowiki', get_string('howtowiki', 'wiki'), 'wiki');
echo '</td>';
echo '</tr></table>';
public function output_edit_lists() {
global $OUTPUT;
- $helpicon = new moodle_help_icon();
- $helpicon->text = get_string('editcategories', 'quiz');
- $helpicon->page = 'categories';
- $helpicon->module = 'question';
- echo $OUTPUT->heading_with_help($helpicon);
+ echo $OUTPUT->heading_with_help(get_string('editcategories', 'quiz'), 'categories', 'question');
foreach ($this->editlists as $context => $list){
$listhtml = $list->to_html(0, array('str'=>$this->str));
protected function display_content($question, $rowclasses) {
global $OUTPUT;
if (question_has_capability_on($question, 'use')) {
- parse_str(QUESTION_PREVIEW_POPUP_OPTIONS, $options);
- $image = new html_image();
- $image->src = $OUTPUT->pix_url('t/preview');
- $image->add_class('iconsmall');
- $image->alt = $this->strpreview;
+ // Build the icon.
+ $image = $OUTPUT->image($OUTPUT->pix_url('t/preview'), array('class'=>'iconsmall', 'alt'=>$this->strpreview));
- $link = html_link::make($this->qbank->preview_question_url($question->id), $this->strpreview);
+ $link = new html_link($this->qbank->preview_question_url($question->id), $image, array('title' => $this->strpreview));
+ parse_str(QUESTION_PREVIEW_POPUP_OPTIONS, $options);
$link->add_action(new popup_action('click', $link->url, 'questionpreview', $options));
- $link->title = $this->strpreview;
- echo $OUTPUT->link_to_popup($link, $image);
+
+ echo $OUTPUT->link($link);
}
}
$form->button->disabled = $disabled;
echo $OUTPUT->button($form);
- echo $OUTPUT->help_icon(moodle_help_icon::make('types', get_string('createnewquestion', 'question'), 'question'));
+ echo $OUTPUT->help_icon('types', get_string('createnewquestion', 'question'), 'question');
$PAGE->requires->yui2_lib('dragdrop');
$PAGE->requires->yui2_lib('container');
if (!$choiceformprinted) {
}
/// Display export form
- $helpicon = new moodle_help_icon();
- $helpicon->text = $strexportquestions;
- $helpicon->page = 'export';
- $helpicon->module = 'quiz';
- echo $OUTPUT->heading_with_help($helpicon);
+ echo $OUTPUT->heading_with_help($strexportquestions, 'export', 'quiz');
$export_form->display();
$radioarray = array();
foreach ($fileformatnames as $shortname => $fileformatname) {
$radioelement = &MoodleQuickForm::createElement('radio','format','',$fileformatname,$shortname);
- $radioelement->setHelpButton(array("$shortname",$fileformatname,"qformat_$shortname"));
+ $mform->setHelpButton('format', array("$shortname",$fileformatname,"qformat_$shortname"));
$radioarray[] = $radioelement;
}
$mform->addGroup($radioarray,'format','',array('<br />'),false);
}
}
- $helpicon = new moodle_help_icon();
- $helpicon->text = $txt->importquestions;
- $helpicon->page = 'import';
- $helpicon->module = 'quiz';
- echo $OUTPUT->heading_with_help($helpicon);
+ echo $OUTPUT->heading_with_help($txt->importquestions, 'import', 'quiz');
/// Print upload form
$import_form->display();
return;
break;
case 'datasetdefinitions':
- $helpicon = new moodle_help_icon();
- $helpicon->text = get_string("choosedatasetproperties", "quiz");
- $helpicon->page = 'questiondatasets';
- $helpicon->module = 'quiz';
- echo $OUTPUT->heading_with_help($helpicon);
+ echo $OUTPUT->heading_with_help(get_string("choosedatasetproperties", "quiz"), 'questiondatasets', 'quiz');
break;
case 'datasetitems':
- $helpicon = new moodle_help_icon();
- $helpicon->text = get_string("editdatasets", "quiz");
- $helpicon->page = 'questiondatasets';
- $helpicon->module = 'quiz';
- echo $OUTPUT->heading_with_help($helpicon);
+ echo $OUTPUT->heading_with_help(get_string("editdatasets", "quiz"), 'questiondatasets', 'quiz');
break;
}
global $OUTPUT;
$heading = $this->get_heading(empty($question->id));
- $helpicon = new moodle_help_icon();
- $helpicon->text = $heading;
- $helpicon->page = $this->name();
- $helpicon->module = $this->plugin_name();
- echo $OUTPUT->heading_with_help($helpicon);
+ echo $OUTPUT->heading_with_help($heading, $this->name(), $this->plugin_name());
$permissionstrs = array();
if (!empty($question->id)){
function display_question_editing_page(&$mform, $question, $wizardnow){
$heading = $this->get_heading(empty($question->id));
- $helpicon = new moodle_help_icon();
- $helpicon->text = $heading;
- $helpicon->page = $this->name();
- $helpicon->module = $this->plugin_name();
- echo $OUTPUT->heading_with_help($helpicon);
+ echo $OUTPUT->heading_with_help($heading, $this->name(), $this->plugin_name());
$mform->display();
}
// Print the add and delete form
coursetag_get_jscript();
- $addtagshelp = $OUTPUT->help_icon(moodle_help_icon::make('addtags', 'adding tags', $tagslang));
+ $addtagshelp = $OUTPUT->help_icon('addtags', 'adding tags', $tagslang);
$edittagthisunit = get_string('edittagthisunit', $tagslang);
$arrowtitle = get_string('arrowtitle', $tagslang);
$sesskey = sesskey();
</div>
EOT;
if ($coursetabs) {
- $deletetagshelp = $OUTPUT->help_icon(moodle_help_icon::make('deletetags', 'deleting tags', $tagslang));
+ $deletetagshelp = $OUTPUT->help_icon('deletetags', 'deleting tags', $tagslang);
$editdeletemytag = get_string('editdeletemytag', $tagslang);
$outstr .= <<<EOT1
<div class="coursetag_edit_row">
$outstr = '
<div class="coursetag_more_title">
<div style="padding-bottom:5px">'.$welcome.
- $OUTPUT->help_icon(moodle_help_icon::make('usingtags', 'using tags', $tagslang)).'
+ $OUTPUT->help_icon('usingtags', 'using tags', $tagslang).'
</div>
<div class="coursetag_more_link">'.$link1.'</div>
<div class="coursetag_more_link">'.$link2.'</div>
echo '</fieldset>';
$table = new html_table();
$table->head = array (get_string('fullname'),
- get_string('content', 'notes') . $OUTPUT->help_icon(moodle_help_icon::make('writing', get_string('helpwriting'))),
- get_string('publishstate', 'notes') . $OUTPUT->help_icon(moodle_help_icon::make('status', get_string('publishstate', 'notes'), 'notes')),
+ get_string('content', 'notes') . $OUTPUT->help_icon('writing', get_string('helpwriting')),
+ get_string('publishstate', 'notes') . $OUTPUT->help_icon('status', get_string('publishstate', 'notes'), 'notes'),
);
$table->align = array ('left', 'center', 'center');
$state_names = note_get_state_names();
}
$title = get_string('extendenrol');
-echo $OUTPUT->heading($title . $OUTPUT->help_icon(moodle_help_icon::make('extendenrol', $title)));
+echo $OUTPUT->heading($title . $OUTPUT->help_icon('extendenrol', $title));
echo "<form method=\"post\" action=\"extendenrol.php\">\n";
echo '<input type="hidden" name="id" value="'.$course->id.'" />';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
$objs[] =& $mform->createElement('select', $this->_name .'_ct', null, $this->get_course_categories());
$objs[] =& $mform->createElement('text', $this->_name, null);
$grp =& $mform->addElement('group', $this->_name.'_grp', $this->_label, $objs, '', false);
- $grp->setHelpButton(array('courserole', $this->_label, 'filters'));
+ $mform->setHelpButton($this->_name.'_grp', array('courserole', $this->_label, 'filters'));
if ($this->_advanced) {
$mform->setAdvanced($this->_name.'_grp');
}
$objs[] = & $mform->createElement('checkbox', $this->_name.'_never', null, get_string('includenever', 'filters'));
$grp =& $mform->addElement('group', $this->_name.'_grp', $this->_label, $objs, '', false);
- $grp->setHelpButton(array('date',$this->_label,'filters'));
+ $mform->setHelpButton($this->_name.'_grp', array('date',$this->_label,'filters'));
if ($this->_advanced) {
$mform->setAdvanced($this->_name.'_grp');
*/
function setupForm(&$mform) {
$obj =& $mform->addElement('select', $this->_name, $this->_label, $this->get_roles());
- $obj->setHelpButton(array('globalrole', $this->_label, 'filters'));
+ $mform->setHelpButton($this->_name, array('globalrole', $this->_label, 'filters'));
$mform->setDefault($this->_name, 0);
if ($this->_advanced) {
$mform->setAdvanced($this->_name);
$objs[] =& $mform->createElement('select', $this->_name.'_op', null, $this->get_operators());
$objs[] =& $mform->createElement('text', $this->_name, null);
$grp =& $mform->addElement('group', $this->_name.'_grp', $this->_label, $objs, '', false);
- $grp->setHelpButton(array('profilefield',$this->_label,'filters'));
+ $mform->setHelpButton($this->_name.'_grp', array('profilefield',$this->_label,'filters'));
if ($this->_advanced) {
$mform->setAdvanced($this->_name.'_grp');
}
$objs[] =& $mform->createElement('select', $this->_name.'_op', null, $this->get_operators());
$objs[] =& $mform->createElement('select', $this->_name, null, $this->_options);
$grp =& $mform->addElement('group', $this->_name.'_grp', $this->_label, $objs, '', false);
- $grp->setHelpButton(array('select', $this->_label, 'filters'));
+ $mform->setHelpButton($this->_name.'_grp', array('select', $this->_label, 'filters'));
$mform->disabledIf($this->_name, $this->_name.'_op', 'eq', 0);
if (!is_null($this->_default)) {
$mform->setDefault($this->_name, $this->_default);
$objs[] =& $mform->createElement('select', $this->_name.'_op', null, $this->getOperators());
$objs[] =& $mform->createElement('text', $this->_name, null);
$grp =& $mform->addElement('group', $this->_name.'_grp', $this->_label, $objs, '', false);
- $grp->setHelpButton(array('text2',$this->_label,'filters'));
+ $mform->setHelpButton($this->_name.'_grp', array('text2',$this->_label,'filters'));
$mform->disabledIf($this->_name, $this->_name.'_op', 'eq', 5);
if ($this->_advanced) {
$mform->setAdvanced($this->_name.'_grp');
echo '</p>';
echo '<p>' . get_string('content', 'notes');
-echo $OUTPUT->help_icon(moodle_help_icon::make('writing', get_string('helpwriting')));
+echo $OUTPUT->help_icon('writing', get_string('helpwriting'));
echo '<br /><textarea name="content" rows="5" cols="50">' . strip_tags(@$content) . '</textarea></p>';
echo '<p>' . $strpublishstate;
-echo $OUTPUT->help_icon(moodle_help_icon::make('status', $strpublishstate, 'notes'));
+echo $OUTPUT->help_icon('status', $strpublishstate, 'notes');
echo $OUTPUT->select(html_select::make($state_names, 'state', empty($state) ? NOTES_STATE_PUBLIC : $state, false));
echo '</p>';
}
$title = get_string('groupextendenrol');
-echo $OUTPUT->heading($title . $OUTPUT->help_icon(moodle_help_icon::make('groupextendenrol', $title)));
+echo $OUTPUT->heading($title . $OUTPUT->help_icon('groupextendenrol', $title));
echo '<form method="post" action="groupextendenrol.php">';
echo '<input type="hidden" name="id" value="'.$course->id.'" />';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
$displaylist['groupextendenrol.php'] = get_string('groupextendenrol');
}
- echo $OUTPUT->help_icon(moodle_help_icon::make("participantswithselectedusers", get_string("withselectedusers")));
+ echo $OUTPUT->help_icon("participantswithselectedusers", get_string("withselectedusers"));
$select = new html_select();
$select->options = $displaylist;
$select->name = "formaction";
<tr valign="top">
<td align="right" valign="middle" nowrap="nowrap">
<?php
- echo $OUTPUT->help_icon(moodle_help_icon::make("reading", get_string("helpreading"), "moodle", true));
+ //TODO: replace by new editor stuff!
+ echo $OUTPUT->help_icon("reading", get_string("helpreading"), "moodle", true);
echo "<br />";
- echo $OUTPUT->help_icon(moodle_help_icon::make("writing", get_string("helpwriting"), "moodle", true));
+ echo $OUTPUT->help_icon("writing", get_string("helpwriting"), "moodle", true);
echo "<br />";
- echo $OUTPUT->help_icon(moodle_help_icon::make("questions", get_string("helpquestions"), "moodle", true));
+ echo $OUTPUT->help_icon("questions", get_string("helpquestions"), "moodle", true);
echo "<br />";
if ($usehtmleditor) {
- echo $OUTPUT->help_icon(moodle_help_icon::make("richtext2", get_string("helprichtext"), "moodle", true));
+ echo $OUTPUT->help_icon("richtext2", get_string("helprichtext"), "moodle", true);
} else {
- emoticonhelpbutton("theform", "message");
+ //emoticonhelpbutton("theform", "message"); to be replaced by new editor stuff
}
?>
<br />
} else {
choose_from_menu(format_text_menu(), "format", $format, "");
}
- echo $OUTPUT->help_icon(moodle_help_icon::make("textformat", get_string("helpformatting")));
+ echo $OUTPUT->help_icon("textformat", get_string("helpformatting"));
?>
</td>
</tr>