throw new coding_exception('The $imagetext parameter has been deprecated. Please update your code and use $OUTPUT->help_icon() instead.');
}
- $helpicon = new help_icon();
+ $helpicon = new moodle_help_icon();
$helpicon->page = $page;
$helpicon->text = $title;
$helpicon->module = $module;
global $OUTPUT;
- $helpicon = new help_icon();
+ $helpicon = new moodle_help_icon();
$helpicon->page = $helppage;
$helpicon->text = $text;
$helpicon->module = $module;
*/
public $form;
/**
- * @var help_icon $form An optional help_icon component
+ * @var moodle_help_icon $form An optional moodle_help_icon component
*/
public $helpicon;
/**
* <pre>
* $select->set_help_icon($page, $text, $linktext);
* // OR
- * $helpicon = new help_icon();
+ * $helpicon = new moodle_help_icon();
* $helpicon->page = $page;
* $helpicon->text = $text;
* $helpicon->linktext = $linktext;
* 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 help_icon object
+ * @param mixed $page Either the keyword that defines a help page or a moodle_help_icon object
* @param text $text The text of the help icon
* @param 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 help_icon) {
+ if ($page instanceof moodle_help_icon) {
$this->helpicon = $page;
} else if (!empty($page)) {
- $this->helpicon = new help_icon();
+ $this->helpicon = new moodle_help_icon();
$this->helpicon->page = $page;
$this->helpicon->text = $text;
$this->helpicon->linktext = $linktext;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @since Moodle 2.0
*/
-class help_icon extends moodle_html_component {
+class moodle_help_icon extends moodle_html_component {
/**
* @var html_link $link A html_link object that will hold the URL info
*/
global $COURSE, $OUTPUT;
if (empty($this->page)) {
- throw new coding_exception('A help_icon object requires a $page parameter');
+ throw new coding_exception('A moodle_help_icon object requires a $page parameter');
}
if (empty($this->text)) {
- throw new coding_exception('A help_icon object requires a $text parameter');
+ throw new coding_exception('A moodle_help_icon object requires a $text parameter');
}
$this->link->text = $this->text;
}
public static function make_scale_menu($courseid, $scale) {
- $helpbutton = new help_icon();
+ $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));
/*
* Centered heading with attached help button (same title text)
* and optional icon attached
- * @param help_icon $helpicon A help_icon object
+ * @param moodle_help_icon $helpicon A moodle_help_icon object
* @param mixed $image An image URL or a html_image object
* @return string HTML fragment
*/
/**
* Print a help icon.
*
- * @param help_icon $helpicon A help_icon object, subclass of html_link
+ * @param moodle_help_icon $helpicon A moodle_help_icon object, subclass of html_link
*
* @return string HTML fragment
*/
* moodle_select::set_label($label) passing a html_label object
*
* To add a help icon, use moodle_select::set_help($page, $text, $linktext) or
- * moodle_select::set_help($helpicon) passing a help_icon object
+ * moodle_select::set_help($helpicon) passing a moodle_help_icon object
*
* If you moodle_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 help_icon) {
+ if (!empty($select->helpicon) && $select->helpicon instanceof moodle_help_icon) {
$html .= $this->help_icon($select->helpicon);
}