MDL-21695 renaming ->help_icon() to old_help_icon() and going to introduce new help_icon() with new parameters and detailed debugging - hopefully this will help during the conversion to new help

This commit is contained in:
Petr Skoda 2010-04-13 20:34:27 +00:00
parent 9f9193f623
commit 596509e431
55 changed files with 116 additions and 116 deletions

View file

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

View file

@ -2733,11 +2733,11 @@ function print_textarea($usehtmleditor, $rows, $cols, $width, $height, $name, $v
* @return string|void Depending on value of $return
*/
function helpbutton($page, $title, $module='moodle', $image=true, $linktext=false, $text='', $return=false, $imagetext='') {
debugging('helpbutton() has been deprecated. Please change your code to use $OUTPUT->help_icon().');
debugging('helpbutton() has been deprecated. Please change your code to use $OUTPUT->old_help_icon().');
global $OUTPUT;
$output = $OUTPUT->help_icon($page, $title, $module, $linktext);
$output = $OUTPUT->old_help_icon($page, $title, $module, $linktext);
// hide image with CSS if needed
@ -3291,7 +3291,7 @@ function popup_form($baseurl, $options, $formid, $selected='', $nothing='choose'
$select->disabled = $disabled;
$select->set_label($selectlabel);
$select->set_help_icon($help, $helptext);
$select->set_old_help_icon($help, $helptext);
$output = $OUTPUT->render($select);

View file

@ -1352,7 +1352,7 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless {
$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->old_help_icon($page, $text, $module, $linktext);
} else if (!$suppresscheck) {
print_error('nonexistentformelements', 'form', '', $elementname);
@ -1372,7 +1372,7 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless {
*/
function addHelpButton($elementname, $identifier, $title, $component = 'moodle', $linktext = '') {
if (array_key_exists($elementname, $this->_elementIndex)) {
$element->_helpbutton = $OUTPUT->help_icon($identifier, $title, $component, $linktext);
$element->_helpbutton = $OUTPUT->old_help_icon($identifier, $title, $component, $linktext);
} else if (!$suppresscheck) {
debugging(get_string('nonexistentformelements', 'form', $elementname));
}

View file

@ -151,7 +151,7 @@ class user_picture implements renderable {
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @since Moodle 2.0
*/
class help_icon implements renderable {
class old_help_icon implements renderable {
/**
* @var string $helpidentifier lang pack identifier (should inlcude the "_hlp" suffix)
*/
@ -430,8 +430,8 @@ class single_select implements renderable {
* @param bool $linktext add extra text to icon
* @return void
*/
public function set_help_icon($helppage, $title, $component = 'moodle') {
$this->helpicon = new help_icon($helppage, $title, $component);
public function set_old_help_icon($helppage, $title, $component = 'moodle') {
$this->helpicon = new old_help_icon($helppage, $title, $component);
}
/**
@ -527,8 +527,8 @@ class url_select implements renderable {
* @param bool $linktext add extra text to icon
* @return void
*/
public function set_help_icon($helppage, $title, $component = 'moodle') {
$this->helpicon = new help_icon($helppage, $title, $component);
public function set_old_help_icon($helppage, $title, $component = 'moodle') {
$this->helpicon = new old_help_icon($helppage, $title, $component);
}
/**

View file

@ -1355,7 +1355,7 @@ END;
$image = $this->pix_icon($icon, $iconalt, $component, array('class'=>'icon'));
}
$help = $this->help_icon($helpidentifier, $text, $component);
$help = $this->old_help_icon($helpidentifier, $text, $component);
return $this->heading($image.$text.$help, 2, 'main help');
}
@ -1369,8 +1369,8 @@ END;
* @param string|bool $linktext true means use $title as link text, string means link text value
* @return string HTML fragment
*/
public function help_icon($helpidentifier, $title, $component = 'moodle', $linktext = '') {
$icon = new help_icon($helpidentifier, $title, $component);
public function old_help_icon($helpidentifier, $title, $component = 'moodle', $linktext = '') {
$icon = new old_help_icon($helpidentifier, $title, $component);
if ($linktext === true) {
$icon->linktext = $title;
} else if (!empty($linktext)) {
@ -1384,7 +1384,7 @@ END;
* @param help_icon $helpicon
* @return string HTML fragment
*/
protected function render_help_icon(help_icon $helpicon) {
protected function render_old_help_icon(old_help_icon $helpicon) {
global $CFG;
// first get the help image icon

View file

@ -942,7 +942,7 @@ class flexible_table {
$html .= '<div class="mdl-align">';
$html .= '<input type="submit" value="'.get_string('downloadas', 'table').'"/>';
$html .= html_writer::select($downloadoptions, 'download', $this->defaultdownloadformat, false);
$html .= $OUTPUT->help_icon('tableexportformats', get_string('tableexportformats', 'table'));
$html .= $OUTPUT->old_help_icon('tableexportformats', get_string('tableexportformats', 'table'));
$html .= '</div></form>';
return $html;

View file

@ -2287,7 +2287,7 @@ function switchroles_form($courseid) {
unset($roles[$CFG->guestroleid]);
$popupurl = new moodle_url('/course/view.php', array('id'=>$courseid, 'sesskey'=>sesskey()));
$select = new single_select($popupurl, 'switchrole', $roles, null, array(''=>get_string('switchroleto')), 'switchrole');
$select->set_help_icon('switchrole', get_string('switchroleto'));
$select->set_old_help_icon('switchrole', get_string('switchroleto'));
return $OUTPUT->render($select);
}