MDL-19756 Renamed help_icon class to moodle_help_icon

This commit is contained in:
nicolasconnault
2009-08-10 06:26:50 +00:00
parent d9c8f425fc
commit 94056d9dbe
4 changed files with 16 additions and 16 deletions
+2 -2
View File
@@ -2809,7 +2809,7 @@ function helpbutton($page, $title, $module='moodle', $image=true, $linktext=fals
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;
@@ -3459,7 +3459,7 @@ function print_heading_with_help($text, $helppage, $module='moodle', $icon=false
global $OUTPUT;
$helpicon = new help_icon();
$helpicon = new moodle_help_icon();
$helpicon->page = $helppage;
$helpicon->text = $text;
$helpicon->module = $module;
+9 -9
View File
@@ -307,7 +307,7 @@ class moodle_select extends moodle_html_component {
*/
public $form;
/**
* @var help_icon $form An optional help_icon component
* @var moodle_help_icon $form An optional moodle_help_icon component
*/
public $helpicon;
/**
@@ -546,7 +546,7 @@ class moodle_select extends moodle_html_component {
* <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;
@@ -556,16 +556,16 @@ class moodle_select extends moodle_html_component {
* 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;
@@ -1340,7 +1340,7 @@ class html_link extends moodle_html_component {
* @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
*/
@@ -1385,11 +1385,11 @@ class help_icon extends moodle_html_component {
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;
@@ -1450,7 +1450,7 @@ class help_icon extends moodle_html_component {
}
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));
+4 -4
View File
@@ -1263,7 +1263,7 @@ class moodle_core_renderer extends moodle_renderer_base {
/*
* 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
*/
@@ -1279,7 +1279,7 @@ class moodle_core_renderer extends moodle_renderer_base {
/**
* 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
*/
@@ -1569,7 +1569,7 @@ class moodle_core_renderer extends moodle_renderer_base {
* 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
@@ -1628,7 +1628,7 @@ class moodle_core_renderer extends moodle_renderer_base {
$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);
}
+1 -1
View File
@@ -1208,7 +1208,7 @@ class moodle_core_renderer_test extends UnitTestCase {
}
public function test_heading_with_help() {
$originalicon = new help_icon();
$originalicon = new moodle_help_icon();
$originalicon->page = 'myhelppage';
$originalicon->text = 'Cool help text';