Skip to content

Commit

Permalink
completion MDL-25927 Change print_help_icon to display_help_icon (ret…
Browse files Browse the repository at this point in the history
…urns html instead of printing)
  • Loading branch information
sammarshallou committed Jan 10, 2011
1 parent 46f4c39 commit 563e97b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion course/format/topics/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

// Print the Your progress icon if the track completion is enabled
$completioninfo = new completion_info($course);
$completioninfo->print_help_icon();
echo $completioninfo->display_help_icon();

echo $OUTPUT->heading(get_string('topicoutline'), 2, 'headingblock header outline');

Expand Down
2 changes: 1 addition & 1 deletion course/format/weeks/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

//Print the Your progress icon if the track completion is enabled
$completioninfo = new completion_info($course);
$completioninfo->print_help_icon();
echo $completioninfo->display_help_icon();

echo $OUTPUT->heading(get_string('weeklyoutline'), 2, 'headingblock header outline');

Expand Down
14 changes: 8 additions & 6 deletions lib/completionlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,17 +207,19 @@ public function is_enabled($cm=null) {
}

/**
* Print the Your progress help icon if the completion tracking is enabled.
* Returns the 'Your progress' help icon, if completion tracking is enabled.
* @global object
* @return void
* @return string HTML code for help icon, or blank if not needed
*/
public function print_help_icon() {
public function display_help_icon() {
global $PAGE, $OUTPUT;
$result = '';
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', 'completion');
echo '</span>';
$result .= '<span id = "completionprogressid" class="completionprogress">'.get_string('yourprogress','completion').' ';
$result .= $OUTPUT->help_icon('completionicons', 'completion');
$result .= '</span>';
}
return $result;
}

/**
Expand Down

0 comments on commit 563e97b

Please sign in to comment.