Skip to content

Commit

Permalink
MDL-21695 Making old_help_icon() deprecated
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mudrd8mz committed Aug 16, 2010
1 parent 5610296 commit cb616be
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 26 deletions.
2 changes: 0 additions & 2 deletions blocks/tags/block_tags.php
Expand Up @@ -230,7 +230,6 @@ function get_content() {
$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 .= <<<EOT
Expand Down Expand Up @@ -260,7 +259,6 @@ function get_content() {
</div>
<div style="display: inline;">
<button type="submit">$buttonadd</button>
$coursetaghelpbutton
</div>
</div>
</form>
Expand Down
2 changes: 1 addition & 1 deletion blocks/tags/lang/en/block_tags.php
Expand Up @@ -66,7 +66,7 @@
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';
Expand Down
4 changes: 2 additions & 2 deletions grade/edit/tree/lib.php
Expand Up @@ -869,7 +869,7 @@ public function get_header_cell() {
$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;
}

Expand Down Expand Up @@ -984,7 +984,7 @@ public function __construct($params) {
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;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/deprecatedlib.php
Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions lib/outputrenderers.php
Expand Up @@ -1490,13 +1490,15 @@ public function heading_with_help($text, $helpidentifier, $component='moodle', $
/**
* 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
* @param string|bool $linktext true means use $title as link text, string means link text value
* @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;
Expand Down
9 changes: 1 addition & 8 deletions message/edit.php
Expand Up @@ -205,14 +205,7 @@
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 '<tr><th align="right">'.$providername.$helpbtn.'</th><td colspan="'.$number_procs.'"></td></tr>'."\n";
echo '<tr><th align="right">'.$providername.'</th><td colspan="'.$number_procs.'"></td></tr>'."\n";
foreach (array('loggedin', 'loggedoff') as $state){
$state_res = get_string($state, 'message');
echo '<tr><td align="right">'.$state_res.'</td>'."\n";
Expand Down
6 changes: 2 additions & 4 deletions tag/coursetags_edit.php
Expand Up @@ -128,7 +128,6 @@

// 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();
Expand All @@ -142,7 +141,7 @@
<div class="coursetag_edit_centered">
<div class="coursetag_edit_row">
<div class="coursetag_edit_left">
$addtagshelp$edittagthisunit
$edittagthisunit
</div>
<div class="coursetag_edit_right">
<div class="coursetag_form_input1">
Expand All @@ -161,12 +160,11 @@
</div>
EOT;
if ($coursetabs) {
$deletetagshelp = $OUTPUT->old_help_icon('deletetags', 'deleting tags', $tagslang);
$editdeletemytag = get_string('editdeletemytag', $tagslang);
$outstr .= <<<EOT1
<div class="coursetag_edit_row">
<div class="coursetag_edit_left">
$deletetagshelp$editdeletemytag
$editdeletemytag
</div>
<div class="coursetag_edit_right">
<select name="del_tag">
Expand Down
4 changes: 1 addition & 3 deletions tag/coursetags_more.php
Expand Up @@ -191,9 +191,7 @@
if (strlen($tags) < 10000) { $fclass = 'coursetag_more_large'; }
$outstr = '
<div class="coursetag_more_title">
<div style="padding-bottom:5px">'.$welcome.
$OUTPUT->old_help_icon('usingtags', 'using tags', $tagslang).'
</div>
<div style="padding-bottom:5px">'.$welcome.'</div>
<div class="coursetag_more_link">'.$link1.'</div>
<div class="coursetag_more_link">'.$link2.'</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion user/addnote.php
Expand Up @@ -91,7 +91,7 @@
$table = new html_table();
$table->head = array (get_string('fullname'),
get_string('content', 'notes'),
get_string('publishstate', 'notes') . $OUTPUT->old_help_icon('status', get_string('publishstate', 'notes'), 'notes'),
get_string('publishstate', 'notes') . $OUTPUT->help_icon('publishstate', 'notes'),
);
$table->align = array ('left', 'center', 'center');
$state_names = note_get_state_names();
Expand Down
7 changes: 3 additions & 4 deletions user/groupaddnote.php
Expand Up @@ -101,8 +101,6 @@
}
}

$strpublishstate = get_string('publishstate', 'notes');

$userlist = array();
foreach ($users as $k => $v) {
if (!$user = $DB->get_record('user', array('id'=>$v))) {
Expand All @@ -118,8 +116,9 @@
echo '<p>' . get_string('content', 'notes');
echo '<br /><textarea name="content" rows="5" cols="50">' . strip_tags(@$content) . '</textarea></p>';

echo '<p>' . $strpublishstate;
echo $OUTPUT->old_help_icon('status', $strpublishstate, 'notes');
echo '<p>';
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 '</p>';

Expand Down

0 comments on commit cb616be

Please sign in to comment.