Merge branch 'wip-MDL-25927' of git://github.com/sammarshallou/moodle

This commit is contained in:
Petr Skoda 2011-01-10 15:16:22 +01:00
commit 4bbcdcec0d
3 changed files with 19 additions and 7 deletions

View File

@ -69,7 +69,7 @@ if ($editing) {
// 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');

View File

@ -61,7 +61,7 @@ defined('MOODLE_INTERNAL') || die();
//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');

View File

@ -207,17 +207,29 @@ class completion_info {
}
/**
* Print the Your progress help icon if the completion tracking is enabled.
* @global object
* Displays the 'Your progress' help icon, if completion tracking is enabled.
* Just prints the result of display_help_icon().
* @deprecated Use display_help_icon instead.
* @return void
*/
public function print_help_icon() {
print $this->display_help_icon();
}
/**
* Returns the 'Your progress' help icon, if completion tracking is enabled.
* @global object
* @return string HTML code for help icon, or blank if not needed
*/
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;
}
/**