mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Breadcrumbs: mod/lesson changes
- Modified to use build_navigation() for breadcrumb generation. Author: Matt Clarkson <mattc@catalyst.net.nz>
This commit is contained in:
parent
f3c8392617
commit
f8513eca8d
@ -35,8 +35,13 @@
|
||||
$strimportquestions = get_string("importquestions", "lesson");
|
||||
$strlessons = get_string("modulenameplural", "lesson");
|
||||
|
||||
print_header_simple("$strimportquestions", " $strimportquestions",
|
||||
"<a href=\"index.php?id=$course->id\">$strlessons</a> -> <a href=\"view.php?id=$cm->id\">".format_string($lesson->name,true)."</a>-> $strimportquestions");
|
||||
$crumbs[] = array('name' => $strlesson, 'link' => "index.php?id=$course->id", 'type' => 'activity');
|
||||
$crumbs[] = array('name' => format_string($lesson->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
|
||||
$crumbs[] = array('name' => $strimportquestions, 'link' => '', 'type' => 'title');
|
||||
|
||||
$navigation = build_navigation($crumbs, $course);
|
||||
|
||||
print_header_simple("$strimportquestions", " $strimportquestions", $navigation);
|
||||
|
||||
if ($form = data_submitted()) { /// Filename
|
||||
|
||||
|
@ -44,8 +44,13 @@
|
||||
$strimportppt = get_string("importppt", "lesson");
|
||||
$strlessons = get_string("modulenameplural", "lesson");
|
||||
|
||||
print_header_simple("$strimportppt", " $strimportppt",
|
||||
"<a href=\"index.php?id=$course->id\">$strlessons</a> -> <a href=\"$CFG->wwwroot/mod/$modname/view.php?id=$cm->id\">".format_string($mod->name,true)."</a>-> $strimportppt");
|
||||
$crumbs[] = array('name' => $strlessons, 'link' => "index.php?id=$course->id", 'type' => 'activity');
|
||||
$crumbs[] = array('name' => format_string($mod->name,true), 'link' => "$CFG->wwwroot/mod/$modname/view.php?id=$cm->id", 'type' => 'activityinstance');
|
||||
$crumbs[] = array('name' => $strimportppt, 'link' => '', 'type' => 'title');
|
||||
|
||||
$navigation = build_navigation($crumbs, $course);
|
||||
|
||||
print_header_simple("$strimportppt", " $strimportppt", $navigation);
|
||||
|
||||
if ($form = data_submitted()) { /// Filename
|
||||
|
||||
|
@ -30,13 +30,11 @@
|
||||
|
||||
/// Print the header
|
||||
|
||||
if ($course->id != SITEID) {
|
||||
$navigation = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> ->";
|
||||
} else {
|
||||
$navigation = '';
|
||||
}
|
||||
$crumbs[] = array('name' => $strlessons, 'link' => '', 'type' => 'activity');
|
||||
|
||||
$navigation = build_navigation($crumbs, $course);
|
||||
|
||||
print_header("$course->shortname: $strlessons", $course->fullname, "$navigation $strlessons", "", "", true, "", navmenu($course));
|
||||
print_header("$course->shortname: $strlessons", $course->fullname, $navigation, "", "", true, "", navmenu($course));
|
||||
|
||||
/// Get all the appropriate data
|
||||
|
||||
|
@ -239,25 +239,14 @@ function lesson_print_header($cm, $course, $lesson, $currenttab = '') {
|
||||
}
|
||||
|
||||
/// Header setup
|
||||
$navigation = array();
|
||||
if ($course->id != SITEID) {
|
||||
$navigation[$course->shortname] = "$CFG->wwwroot/course/view.php?id=$course->id";
|
||||
}
|
||||
$navigation[$strlessons] = "$CFG->wwwroot/mod/lesson/index.php?id=$course->id";
|
||||
$navigation[$strname] = '';
|
||||
|
||||
$urls = array();
|
||||
foreach($navigation as $text => $href) {
|
||||
if (empty($href)) {
|
||||
$urls[] = $text;
|
||||
} else {
|
||||
$urls[] = '<a href="'.$href.'">'.$text.'</a>';
|
||||
}
|
||||
}
|
||||
$breadcrumb = implode(' -> ', $urls);
|
||||
|
||||
|
||||
$crumbs[] = array('name' => $strlessons, 'link' => "$CFG->wwwroot/mod/lesson/index.php?id=$course->id", 'type' => 'activity');
|
||||
$crumbs[] = array('name' => $strname, 'link' => '', 'type' => 'activityinstance');
|
||||
|
||||
$navigation = build_navigation($crumbs, $course);
|
||||
|
||||
/// Print header, heading, tabs and messages
|
||||
print_header("$course->shortname: $strname", $course->fullname, $breadcrumb,
|
||||
print_header("$course->shortname: $strname", $course->fullname, $navigation,
|
||||
'', '', true, $button, navmenu($course, $cm));
|
||||
|
||||
if (has_capability('mod/lesson:manage', $context)) {
|
||||
|
@ -76,29 +76,13 @@ class page_lesson extends page_generic_activity {
|
||||
$title = "{$this->courserecord->shortname}: $activityname";
|
||||
}
|
||||
|
||||
/// Build the breadcrumb
|
||||
$breadcrumbs = array();
|
||||
if ($this->courserecord->id != SITEID) {
|
||||
$breadcrumbs[$this->courserecord->shortname] = "$CFG->wwwroot/course/view.php?id={$this->courserecord->id}";
|
||||
$crumbs[] = array('name' => get_string('modulenameplural', $this->activityname), 'link' => $CFG->wwwroot."/mod/{$this->activityname}/index.php?id={$this->courserecord->id}", 'type' => 'activity');
|
||||
$crumbs[] = array('name' => format_string($this->activityrecord->name), 'link' => $CFG->wwwroot."/mod/{$this->activityname}/view.php?id={$this->modulerecord->id}", 'type' => 'activityinstance');
|
||||
|
||||
if (!empty($morebreadcrumbs)) {
|
||||
$breadcrumbs = array_merge($crumbs, $morebreadcrumbs);
|
||||
}
|
||||
$breadcrumbs[get_string('modulenameplural', 'lesson')] = "$CFG->wwwroot/mod/lesson/index.php?id={$this->courserecord->id}";
|
||||
|
||||
if (empty($morebreadcrumbs)) {
|
||||
$breadcrumbs[$activityname] = '';
|
||||
} else {
|
||||
$breadcrumbs[$activityname] = "$CFG->wwwroot/mod/lesson/view.php?id={$this->modulerecord->id}&pageid=$this->lessonpageid";
|
||||
$breadcrumbs = array_merge($breadcrumbs, $morebreadcrumbs);
|
||||
}
|
||||
// Convert to breadcrumb string
|
||||
$urls = array();
|
||||
foreach($breadcrumbs as $text => $href) {
|
||||
if (empty($href)) {
|
||||
$urls[] = $text;
|
||||
} else {
|
||||
$urls[] = '<a href="'.$href.'">'.$text.'</a>';
|
||||
}
|
||||
}
|
||||
$breadcrumb = implode(' -> ', $urls);
|
||||
|
||||
|
||||
/// Build the buttons
|
||||
if (has_capability('mod/lesson:edit', $context)) {
|
||||
@ -148,7 +132,9 @@ class page_lesson extends page_generic_activity {
|
||||
$meta = '';
|
||||
// }
|
||||
|
||||
print_header($title, $this->courserecord->fullname, $breadcrumb, '', $meta, true, $buttons, navmenu($this->courserecord, $this->modulerecord));
|
||||
$navigation = build_navigation($crumbs, $this->courserecord);
|
||||
|
||||
print_header($title, $this->courserecord->fullname, $navigation, '', $meta, true, $buttons, navmenu($this->courserecord, $this->modulerecord));
|
||||
|
||||
if (has_capability('mod/lesson:manage', $context)) {
|
||||
print_heading_with_help($activityname, 'overview', 'lesson');
|
||||
|
Loading…
x
Reference in New Issue
Block a user