Customize 2.0 $PAGE->navbar

Customize 2.0 $PAGE->navbar

از Joseph Rézeau در
Number of replies: 3
تصویر Core developers تصویر Particularly helpful Moodlers تصویر Plugin developers تصویر Testers تصویر Translators

Hi all,

My lesson_essay_feedback block displays to the student the content of his lesson essays, together with teacher comments and score. In the 2.0 version, the navbar (automatically generated) displays as attached. I would like to remove the link to the lesson in the lesson title, so that the student could not access the lesson by mistake in that context. I do not want to remove the lesson title itself, only the link inside it.

How is $PAGE->navbar "automatically" constructed? How can I construct it manully instead?

$PAGE->navbar->ignore_active() does work but it removes too much items from navbar.

Thanks,

Joseph

Attachment 22-09-2011 09-31-05.jpg
میانگین امتیازات: -
In reply to Joseph Rézeau

Re: Customize 2.0 $PAGE->navbar

از Joseph Rézeau در
تصویر Core developers تصویر Particularly helpful Moodlers تصویر Plugin developers تصویر Testers تصویر Translators

This is what I tried, but it does not work because apparently $PAGE->navbar->add strips all links that are passed to it.ناراحت and I want the link to current course to work.

$PAGE->navbar->ignore_active();
$courselink = '<a title="'.$course->fullname.'" href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'.$course->fullname.'</a>';
$PAGE->navbar->add($courselink);
$PAGE->navbar->add(get_string('graderscomments', 'block_lesson_essay_feedback'));

Any help welcome!

Joseph

In reply to Joseph Rézeau

Re: Customize 2.0 $PAGE->navbar

از Tim Hunt در
تصویر Core developers تصویر Documentation writers تصویر Particularly helpful Moodlers تصویر Peer reviewers تصویر Plugin developers

Look at the PHPdoc for navbar::add.

I think you need something like

$PAGE->navbar->add($course->fullname, new moodle_url('/course/view.php', array('id' => $course->id)));