From cb616be8547a067f521986f3965cb2c85d67203d Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Mon, 16 Aug 2010 15:29:46 +0000 Subject: [PATCH] MDL-21695 Making old_help_icon() deprecated Some of the callers have never been fully implemented (help file never existed) so I just dropped the help icon. In other cases, new help_icon() is used. The help icons support in the messaging must be reviewed by the subsystem maintainer. --- blocks/tags/block_tags.php | 2 -- blocks/tags/lang/en/block_tags.php | 2 +- grade/edit/tree/lib.php | 4 ++-- lib/deprecatedlib.php | 2 +- lib/outputrenderers.php | 2 ++ message/edit.php | 9 +-------- tag/coursetags_edit.php | 6 ++---- tag/coursetags_more.php | 4 +--- user/addnote.php | 2 +- user/groupaddnote.php | 7 +++---- 10 files changed, 14 insertions(+), 26 deletions(-) diff --git a/blocks/tags/block_tags.php b/blocks/tags/block_tags.php index 3cd2ba28870..1e53da33ee6 100644 --- a/blocks/tags/block_tags.php +++ b/blocks/tags/block_tags.php @@ -230,7 +230,6 @@ class block_tags extends block_base { $tagthisunit = get_string('tagthisunit', $tagslang); $buttonadd = get_string('add', $tagslang); $arrowtitle = get_string('arrowtitle', $tagslang); - $coursetaghelpbutton = $OUTPUT->old_help_icon('addtags', 'adding tags', $tagslang); $sesskey = sesskey(); $arrowright = $OUTPUT->pix_url('t/arrow_left'); $this->content->footer .= <<
- $coursetaghelpbutton
diff --git a/blocks/tags/lang/en/block_tags.php b/blocks/tags/lang/en/block_tags.php index 2fae4637e48..2d9fd0989ea 100644 --- a/blocks/tags/lang/en/block_tags.php +++ b/blocks/tags/lang/en/block_tags.php @@ -66,7 +66,7 @@ $string['morewelcome'] = 'Welcome to the \'More tags\' tag cloud. Tags are user created links to things. Tags allow you to categorise and link things like your favourite courses, your blogs or your profile with your own words. Different groups of tags may be displayed with the links on the \'Show:\' line, -and may be reordered with the links on the \'Order:\' line. More help is here:'; +and may be reordered with the links on the \'Order:\' line.'; $string['mycoursetags'] = 'My course tags:'; $string['mycoursetag1'] = 'Show my course tags'; $string['mycoursetag2'] = 'my course tags'; diff --git a/grade/edit/tree/lib.php b/grade/edit/tree/lib.php index 3bded5651a5..6af8cd95ea2 100755 --- a/grade/edit/tree/lib.php +++ b/grade/edit/tree/lib.php @@ -869,7 +869,7 @@ class grade_edit_tree_column_aggregatesubcats extends grade_edit_tree_column_cat $headercell = clone($this->headercell); $headercell->style .= 'width: 40px;'; $headercell->text = get_string('aggregatesubcats', 'grades') - .$OUTPUT->old_help_icon('aggregatesubcats', 'aggregatesubcats', 'grade'); + .$OUTPUT->help_icon('aggregatesubcats', 'grades'); return $headercell; } @@ -984,7 +984,7 @@ class grade_edit_tree_column_keephigh extends grade_edit_tree_column_category { public function get_header_cell() { global $OUTPUT; $headercell = clone($this->headercell); - $headercell->text = get_string('keephigh', 'grades').$OUTPUT->old_help_icon('keephigh', 'keephigh', 'grade'); + $headercell->text = get_string('keephigh', 'grades').$OUTPUT->help_icon('keephigh', 'grades'); return $headercell; } diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index 7037669faf4..ce5f669c189 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -2940,7 +2940,7 @@ 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->old_help_icon().'); + debugging('helpbutton() has been deprecated. Please change your code to use $OUTPUT->help_icon().'); global $OUTPUT; diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 94a8bffb79c..1dcf3e6136a 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -1490,6 +1490,7 @@ class core_renderer extends renderer_base { /** * Print a help icon. * + * @deprecated since Moodle 2.0 * @param string $page The keyword that defines a help page * @param string $title A descriptive text for accessibility only * @param string $component component name @@ -1497,6 +1498,7 @@ class core_renderer extends renderer_base { * @return string HTML fragment */ public function old_help_icon($helpidentifier, $title, $component = 'moodle', $linktext = '') { + debugging('The method old_help_icon() is deprecated, please fix the code and use help_icon() method instead', DEBUG_DEVELOPER); $icon = new old_help_icon($helpidentifier, $title, $component); if ($linktext === true) { $icon->linktext = $title; diff --git a/message/edit.php b/message/edit.php index 4f9f4b18417..c3ed9f19263 100644 --- a/message/edit.php +++ b/message/edit.php @@ -205,14 +205,7 @@ echo ''; foreach ( $providers as $providerid => $provider){ $providername = get_string('messageprovider:'.$provider->name, $provider->component); -/// 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->old_help_icon('moodle_'.$provider->name, $providername, 'message'); - } else { - $helpbtn = $OUTPUT->old_help_icon('message_'.$provider->name, $providername, basename($provider->component)); - } - - echo ''.$providername.$helpbtn.''."\n"; + echo ''.$providername.''."\n"; foreach (array('loggedin', 'loggedoff') as $state){ $state_res = get_string($state, 'message'); echo ''.$state_res.''."\n"; diff --git a/tag/coursetags_edit.php b/tag/coursetags_edit.php index 2942606bef5..ba845b8c167 100644 --- a/tag/coursetags_edit.php +++ b/tag/coursetags_edit.php @@ -128,7 +128,6 @@ echo $OUTPUT->header(); // Print the add and delete form coursetag_get_jscript(); - $addtagshelp = $OUTPUT->old_help_icon('addtags', 'adding tags', $tagslang); $edittagthisunit = get_string('edittagthisunit', $tagslang); $arrowtitle = get_string('arrowtitle', $tagslang); $sesskey = sesskey(); @@ -142,7 +141,7 @@ echo $OUTPUT->header();
- $addtagshelp$edittagthisunit + $edittagthisunit
@@ -161,12 +160,11 @@ echo $OUTPUT->header();
EOT; if ($coursetabs) { - $deletetagshelp = $OUTPUT->old_help_icon('deletetags', 'deleting tags', $tagslang); $editdeletemytag = get_string('editdeletemytag', $tagslang); $outstr .= <<
- $deletetagshelp$editdeletemytag + $editdeletemytag

'; -echo '

' . $strpublishstate; -echo $OUTPUT->old_help_icon('status', $strpublishstate, 'notes'); +echo '

'; +echo get_string('publishstate', 'notes'); +echo $OUTPUT->help_icon('publishstate', 'notes'); echo html_writer::select($state_names, 'state', empty($state) ? NOTES_STATE_PUBLIC : $state, false); echo '

';