This check-in removes about 400 lines of code. I hope I have not screwed anything up. I would be grateful if people could review this change, and keep an eye on the navigation bar in modules.
Any navigation bar bugs you find in the near future, feel free to file them in the tracker and assign them to me. Thanks.
If not to many problems are found, I think I would like to backport this to 1.9 stable, but I am not sure that is a good idea. Opinions to the General Developer Forum please. I am about to start a thread there.
$string['reviewclosed'] = 'After the quiz is closed';
$string['reviewimmediately'] = 'Immediately after the attempt';
$string['reviewnever'] = 'Never allow review';
-$string['reviewofattempt'] = 'Review of Attempt $a';
+$string['reviewofattempt'] = 'Review of attempt $a';
+$string['reviewofpreview'] = 'Review of preview';
$string['reviewopen'] = 'Later, while the quiz is still open';
$string['reviewoptions'] = 'Students may review';
$string['reviewoptionsheading'] = 'Review options';
$title = str_replace($search, $replace, $title);
}
- $navlinks = array();
- $navlinks[] = array('name' => get_string('modulenameplural', $this->activityname), 'link' => $CFG->wwwroot."/mod/{$this->activityname}/index.php?id={$this->courserecord->id}", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($this->activityrecord->name), 'link' => $CFG->wwwroot."/mod/{$this->activityname}/view.php?id={$this->modulerecord->id}", 'type' => 'activityinstance');
-
- if (!empty($morenavlinks)) {
- $navlinks = array_merge($navlinks, $morenavlinks);
- }
-
if (empty($morenavlinks) && $this->user_allowed_editing()) {
$buttons = '<table><tr><td>'.update_module_button($this->modulerecord->id, $this->courserecord->id, get_string('modulename', $this->activityname)).'</td>';
if (!empty($CFG->showblocksonmodpages)) {
$buttons = ' ';
}
- $navigation = build_navigation($navlinks);
-
+ if (empty($morenavlinks)) {
+ $morenavlinks = array();
+ }
+ $navigation = build_navigation($morenavlinks, $this->modulerecord);
print_header($title, $this->courserecord->fullname, $navigation, '', $meta, true, $buttons, navmenu($this->courserecord, $this->modulerecord), false, $bodytags);
}
var $strassignments;
var $strsubmissions;
var $strlastmodified;
- var $navigation;
var $pagetitle;
var $currentgroup;
var $usehtmleditor;
$this->strassignments = get_string('modulenameplural', 'assignment');
$this->strsubmissions = get_string('submissions', 'assignment');
$this->strlastmodified = get_string('lastmodified');
-
- $this->navigation[] = array('name' => $this->strassignments, 'link' => "index.php?id={$this->course->id}", 'type' => 'activity');
-
$this->pagetitle = strip_tags($this->course->shortname.': '.$this->strassignment.': '.format_string($this->assignment->name,true));
// visibility
$context = get_context_instance(CONTEXT_MODULE, $cmid);
if (!$this->cm->visible and !has_capability('moodle/course:viewhiddenactivities', $context)) {
$pagetitle = strip_tags($this->course->shortname.': '.$this->strassignment);
- $this->navigation[] = array('name' => $this->strassignment, 'link' => '', 'type' => 'activityinstance');
- $navigation = build_navigation($this->navigation);
+ $navigation = build_navigation('', $this->cm);
- print_header($pagetitle, $this->course->fullname, $this->navigation,
+ print_header($pagetitle, $this->course->fullname, $navigation,
"", "", true, '', navmenu($this->course, $this->cm));
notice(get_string("activityiscurrentlyhidden"), "$CFG->wwwroot/course/view.php?id={$this->course->id}");
}
if ($subpage) {
- $this->navigation[] = array('name' => format_string($this->assignment->name,true), 'link' => "view.php?id={$this->cm->id}", 'type' => 'activityinstance');
- $this->navigation[] = array('name' => $subpage, 'link' => '', 'type' => 'title');
+ $navigation = build_navigation($subpage, $this->cm);
} else {
- $this->navigation[] = array('name' => format_string($this->assignment->name,true), 'link' => '', 'type' => 'activityinstance');
+ $navigation = build_navigation('', $this->cm);
}
- $navigation = build_navigation($this->navigation);
-
print_header($this->pagetitle, $this->course->fullname, $navigation, '', '',
true, update_module_button($this->cm->id, $this->course->id, $this->strassignment),
navmenu($this->course, $this->cm));
add_to_log($course->id, 'assignment', 'view submission', 'submissions.php?id='.$this->assignment->id, $this->assignment->id, $this->cm->id);
- $navlinks = array();
- $navlinks[] = array('name' => $this->strassignments, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($this->assignment->name,true),
- 'link' => "view.php?a={$this->assignment->id}",
- 'type' => 'activityinstance');
- $navlinks[] = array('name' => $this->strsubmissions, 'link' => '', 'type' => 'title');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($this->strsubmissions, $this->cm);
print_header_simple(format_string($this->assignment->name,true), "", $navigation,
'', '', true, update_module_button($cm->id, $course->id, $this->strassignment), navmenu($course, $cm));
/// Print a session if one has been specified
if ($start and $end and !$confirmdelete) { // Show a full transcript
-
- $navlinks[] = array('name' => $strchats, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($chat->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strchatreport, 'link' => "report.php?id=$cm->id", 'type' => 'title');
-
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($strchatreport, $cm);
print_header_simple(format_string($chat->name).": $strchatreport", '', $navigation,
'', '', true, '', navmenu($course, $cm));
/// Print the Sessions display
- $navlinks[] = array('name' => $strchats, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($chat->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strchatreport, 'link' => '', 'type' => 'title');
-
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($strchatreport, $cm);
print_header_simple(format_string($chat->name).": $strchatreport", '', $navigation,
'', '', true, '', navmenu($course, $cm));
if (!$download) {
- $navlinks = array();
- $navlinks[] = array('name' => $strchoices, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($choice->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strresponses, 'link' => '', 'type' => 'title');
-
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($strresponses, $cm);
print_header_simple(format_string($choice->name).": $strresponses", "", $navigation, "", '', true,
update_module_button($cm->id, $course->id, $strchoice), navmenu($course, $cm));
/// Check to see if groups are being used in this choice
/// Display the choice and possibly results
- $navlinks = array();
- $navlinks[] = array('name' => $strchoices, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($choice->name), 'link' => '', 'type' => 'activityinstance');
-
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation('', $cm);
print_header_simple(format_string($choice->name), "", $navigation, "", "", true,
update_module_button($cm->id, $course->id, $strchoice), navmenu($course, $cm));
if (empty($cm->visible) and !has_capability('moodle/course:viewhiddenactivities', $context)) {
$strdatabases = get_string("modulenameplural", "data");
- $navlinks = array();
- $navlinks[] = array('name' => $strdatabases, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($data->name), 'link' => '', 'type' => 'activityinstance');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation('', $cm);
print_header_simple(format_string($data->name), "", $navigation, "", "", true, '', navmenu($course, $cm));
notice(get_string("activityiscurrentlyhidden"));
}
/// Print the page header
$strdata = get_string('modulenameplural','data');
- $navlinks = array();
- $navlinks[] = array('name' => $strdata, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($data->name), 'link' => '', 'type' => 'activityinstance');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation('', $cm);
print_header_simple($data->name, '', $navigation,
'', $meta, true, update_module_button($cm->id, $course->id, get_string('modulename', 'data')),
navmenu($course, $cm), '', '');
/// If it's hidden then it's don't show anything. :)
if (empty($cm->visible) and !has_capability('moodle/course:viewhiddenactivities',get_context_instance(CONTEXT_MODULE, $cm->id))) {
- $navlinks = array();
- $navlinks[] = array('name' => $strdatabases, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($data->name), 'link' => '', 'type' => 'activityinstance');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation('', $cm);
print_header_simple(format_string($data->name), "", $navigation,
"", "", true, '', navmenu($course, $cm));
notice(get_string("activityiscurrentlyhidden"));
/// Print the page header
$strdata = get_string('modulenameplural','data');
- $navlinks = array();
- $navlinks[] = array('name' => $strdata, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($data->name), 'link' => '', 'type' => 'activityinstance');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation('', $cm);
print_header_simple($data->name, "", $navigation, "", "", true, "", navmenu($course));
print_heading(format_string($data->name));
global $CFG, $displaynoticegood, $displaynoticebad;
- $strdata = get_string('modulenameplural','data');
-
- $navlinks = array();
- $navlinks[] = array('name' => $strdata, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => $data->name, 'link' => '', 'type' => 'activityinstance');
-
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation('', $cm);
print_header_simple($data->name, '', $navigation,
'', '', true, update_module_button($cm->id, $course->id, get_string('modulename', 'data')),
navmenu($course, $cm));
$meta .= '//]]>'."\n";
$meta .= '</script>'."\n";
- $navlinks = array();
- $navlinks[] = array('name' => $strdata, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($data->name), 'link' => '', 'type' => 'activityinstance');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation('', $cm);
print_header_simple($data->name, '', $navigation,
'', $meta, true, update_module_button($cm->id, $course->id, get_string('modulename', 'data')),
navmenu($course, $cm), '', $bodytag);
/// If it's hidden then it's don't show anything. :)
if (empty($cm->visible) and !has_capability('mod/data:managetemplates', $context)) {
- $strdatabases = get_string("modulenameplural", "data");
-
- $navlinks = array();
- $navlinks[] = array('name' => $strdatabases, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($data->name), 'link' => '', 'type' => 'activityinstance');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation('', $cm);
print_header_simple(format_string($data->name), "",
$navigation, "", "", true, '', navmenu($course, $cm));
notice(get_string("activityiscurrentlyhidden"));
$strassessments = get_string("assessments", "exercise");
// ... print the header and...
- $navlinks = array();
- $navlinks[] = array('name' => $strexercises, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($exercise->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strassessments, 'link' => '', 'type' => 'title');
-
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($strassessments, $cm);
print_header_simple(format_string($exercise->name), "", $navigation,
"", "", true);
$strsubmissions = get_string("submissions", "exercise");
// ... print the header and...
- $navlinks = array();
- $navlinks[] = array('name' => $strexercises, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($exercise->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strsubmissions, 'link' => '', 'type' => 'title');
-
- $navigation = build_navigation($navlinks);
+ $navigation = build_navigation($strsubmissions, $cm);
print_header_simple(format_string($exercise->name), "", $navigation,
"", "", true);
$strexercise = get_string("modulename", "exercise");
$strupload = get_string("upload");
- $navlinks = array();
- $navlinks[] = array('name' => $strexercises, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($exercise->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strupload, 'link' => '', 'type' => 'title');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($strupload, $cm);
print_header_simple(format_string($exercise->name)." : $strupload", "", $navigation,
"", "", true);
$strexercise = get_string("modulename", "exercise");
// ...display header...
- $navlinks = array();
- $navlinks[] = array('name' => $strexercises, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($exercise->name), 'link' => '', 'type' => 'activityinstance');
- $navigation = build_navigation($navlinks);
+ $navigation = build_navigation('', $cm);
print_header_simple(format_string($exercise->name), "", $navigation,
"", "", true, update_module_button($cm->id, $course->id, $strexercise), navmenu($course, $cm));
$searchform = forum_search_form($course);
$navlinks = array();
- $navlinks[] = array('name' => get_string('forums', 'forum'), 'link' => "../forum/index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($forum->name,true), 'link' => "../forum/view.php?f=$forum->id", 'type' => 'activityinstance');
$navlinks[] = array('name' => format_string($discussion->name,true), 'link' => "discuss.php?d=$discussion->id", 'type' => 'title');
if ($parent != $discussion->firstpost) {
$navlinks[] = array('name' => format_string($post->subject,true), 'type' => 'title');
}
- $navigation = build_navigation($navlinks);
+ $navigation = build_navigation($navlinks, $cm);
print_header("$course->shortname: ".format_string($discussion->name), $course->fullname,
$navigation, "", "", true, $searchform, navmenu($course, $cm));
$wwwroot = str_replace('http:','https:', $wwwroot);
}
- $strforums = get_string('modulenameplural', 'forum');
- $navlinks = array();
- $navlinks[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($forum->name), 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance');
-
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation('', $cm);
print_header($course->shortname, $course->fullname, $navigation, '', '', true, "", navmenu($course, $cm));
notice_yesno(get_string('noguesttracking', 'forum').'<br /><br />'.get_string('liketologin'),
$wwwroot, $_SERVER['HTTP_REFERER']);
$modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
}
- $strforums = get_string('modulenameplural', 'forum');
-
if (!get_referer()) { // No referer - probably coming in via email See MDL-9052
require_login();
}
- $navlinks = array();
- $navlinks[] = array('name' => get_string("forums", "forum"), 'link' => "../forum/view.php?f=$forum->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($forum->name,true), 'link' => '../forum/index.php?id=$course->id', 'type' => 'activityinstance');
-
- $navigation = build_navigation($navlinks);
-
-
+ $navigation = build_navigation('', $cm);
print_header($course->shortname, $course->fullname, $navigation, '' , '', true, "", navmenu($course, $cm));
notice_yesno(get_string('noguestpost', 'forum').'<br /><br />'.get_string('liketologin'),
} else { // User just asked to prune something
$course = get_record('course', 'id', $forum->course);
- $strforums = get_string("modulenameplural", "forum");
$navlinks = array();
- $navlinks[] = array('name' => $strforums, 'link' => "../forum/index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => $forum->name, 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance');
$navlinks[] = array('name' => format_string($post->subject, true), 'link' => "discuss.php?d=$discussion->id", 'type' => 'title');
$navlinks[] = array('name' => get_string("prune", "forum"), 'link' => '', 'type' => 'title');
-
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($navlinks, $cm);
print_header_simple(format_string($discussion->name).": ".format_string($post->subject), "", $navigation, '', "", true, "", navmenu($course, $cm));
print_heading(get_string('pruneheading', 'forum'));
get_string("addanewdiscussion", "forum");
}
- $strforums = get_string("modulenameplural", "forum");
-
- $navlinks = array();
- $navlinks[] = array('name' => $strforums, 'link' => "../forum/index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => $forum->name, 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance');
-
-
- if ($post->parent) {
- $navlinks[] = array('name' => format_string($toppost->subject, true), 'link' => "discuss.php?d=$discussion->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => get_string('editing', 'forum'), 'link' => '', 'type' => 'action');
- } else {
- $navlinks[] = array('name' => format_string($toppost->subject), 'link' => '', 'type' => 'action');
- }
-
if (empty($post->edit)) {
$post->edit = '';
}
-
if (empty($discussion->name)) {
if (empty($discussion)) {
// not show the discussion name (same as forum name in this case) in
// the breadcrumbs.
$strdiscussionname = '';
- $navtail = '';
} else {
// Show the discussion name in the breadcrumbs.
$strdiscussionname = format_string($discussion->name).':';
$forcefocus = empty($reply) ? NULL : 'message';
-
- $navigation = build_navigation($navlinks);
+ $navlinks = array();
+ if ($post->parent) {
+ $navlinks[] = array('name' => format_string($toppost->subject, true), 'link' => "discuss.php?d=$discussion->id", 'type' => 'title');
+ $navlinks[] = array('name' => get_string('editing', 'forum'), 'link' => '', 'type' => 'title');
+ } else {
+ $navlinks[] = array('name' => format_string($toppost->subject), 'link' => '', 'type' => 'title');
+ }
+ $navigation = build_navigation($navlinks, $cm);
print_header("$course->shortname: $strdiscussionname ".
format_string($toppost->subject), $course->fullname,
$navigation, $mform_post->focus($forcefocus), "", true, "", navmenu($course, $cm));
-
// checkup
if (!empty($parent) && !forum_user_can_see_post($forum, $discussion, $post)) {
$strsearchresults = get_string("searchresults", "forum");
$strpage = get_string("page");
- $navlinks = array();
- $navlinks[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity');
-
if (!$search || $showform) {
- $crumns[] = array('name' => $strsearch, 'link' => '', 'type' => 'title');
+ $navlinks = array();
+ $navlinks[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity');
+ $navlinks[] = array('name' => $strsearch, 'link' => '', 'type' => 'title');
$navigation = build_navigation($navlinks);
print_header_simple("$strsearch", "", $navigation, 'search.words',
$wwwroot = str_replace('http:','https:', $wwwroot);
}
- $strforums = get_string('modulenameplural', 'forum');
- $navlinks = array();
- $navlinks[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($forum->name), 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance');
-
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation('', $cm);
print_header($course->shortname, $course->fullname, $navigation, '', '', true, "", navmenu($course, $cm));
notice_yesno(get_string('noguesttracking', 'forum').'<br /><br />'.get_string('liketologin'),
$wwwroot, $_SERVER['HTTP_REFERER']);
$wwwroot = str_replace('http:','https:', $wwwroot);
}
- $strforums = get_string('modulenameplural', 'forum');
- $navlinks = array();
- $navlinks[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($forum->name), 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance');
-
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation('', $cm);
print_header($course->shortname, $course->fullname, $navigation, '', '', true, "", navmenu($course, $cm));
notice_yesno(get_string('noguestsubscribe', 'forum').'<br /><br />'.get_string('liketologin'),
$strsubscribers = get_string("subscribers", "forum");
$strforums = get_string("forums", "forum");
- $navlinks = array();
- $navlinks[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($forum->name), 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strsubscribers, 'link' => '', 'type' => 'title');
-
- $navigation = build_navigation($navlinks);
+ $navigation = build_navigation($strsubscribers, $cm);
if (has_capability('mod/forum:managesubscriptions', $context)) {
print_header_simple("$strsubscribers", "", $navigation,
/// Print header.
- $navlinks = array();
- $navlinks[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($forum->name), 'link' => "view.php?f=$forum->id", 'type' => 'activityinstance');
-
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation('', $cm);
print_header_simple(format_string($forum->name), "",
$navigation, "", "", true, $buttontext, navmenu($course, $cm));
break;
}
- $strglossaries = get_string('modulenameplural', 'glossary');
$strglossary = get_string('modulename', 'glossary');
$strcomments = get_string('comments', 'glossary');
$navlinks = array();
- $navlinks[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($glossary->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
$navlinks[] = array('name' => $strcomments, 'link' => "comments.php?id=$cm->id&eid=$entry->id", 'type' => 'title');
$navlinks[] = array('name' => $straction, 'link' => '', 'type' => 'action');
-
- $navigation = build_navigation($navlinks);
+ $navigation = build_navigation($navlinks, $cm);
print_header_simple(format_string($glossary->name), '', $navigation,
'', '', true, update_module_button($cm->id, $course->id, $strglossary),
$strcomments = get_string("comments", "glossary");
$straddcomment = get_string("addcomment", "glossary");
- $navlinks = array();
- $navlinks[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($glossary->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strcomments, 'link' => '', 'type' => 'title');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($strcomments, $cm);
print_header_simple(strip_tags("$strcomments: $entry->concept"), "", $navigation,
"", "", true, update_module_button($cm->id, $course->id, $strglossary),
navmenu($course, $cm));
$strareyousuredelete = get_string("areyousuredelete","glossary");
- $navlinks = array();
- $navlinks[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
-
-$navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation('', $cm);
print_header_simple(format_string($glossary->name), "", $navigation,
"", "", true, update_module_button($cm->id, $course->id, $strglossary),
navmenu($course, $cm));
-
if (($entry->userid != $USER->id) and !$manageentries) { // guest id is never matched, no need for special check here
error("You can't delete other people's entries!");
}
}
}
-$strglossary = get_string("modulename", "glossary");
-$strglossaries = get_string("modulenameplural", "glossary");
$stredit = empty($e) ? get_string('addentry', 'glossary') : get_string("edit");
-
-$navlinks = array();
-$navlinks[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
-$navlinks[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
-$navlinks[] = array('name' => $stredit, 'link' => '', 'type' => 'title');
-
-$navigation = build_navigation($navlinks);
-
+$navigation = build_navigation($stredit, $cm);
print_header_simple(format_string($glossary->name), "", $navigation, "",
"", true, "", navmenu($course, $cm));
-
-
print_heading(format_string($glossary->name));
/// Info box
$strexportfile = get_string("exportfile", "glossary");
$strexportentries = get_string('exportentries', 'glossary');
- $navlinks = array();
- $navlinks[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
-
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation('', $cm);
print_header_simple(format_string($glossary->name), "",$navigation,
"", "", true, update_module_button($cm->id, $course->id, $strglossary),
navmenu($course, $cm));
$entryalreadyexist = get_string('entryalreadyexist','glossary');
$entryexported = get_string('entryexported','glossary');
- $navlinks = array();
- $navlinks[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
-
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation('', $cm);
print_header_simple(format_string($glossary->name), '', $navigation, '', '', true, '', navmenu($course, $cm));
if ( $PermissionGranted ) {
$strsearch = get_string("search");
$strimportentries = get_string('importentriesfromxml', 'glossary');
- $navlinks = array();
- $navlinks[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strimportentries, 'link' => '', 'type' => 'title');
-
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($strimportentries, $cm);
print_header_simple(format_string($glossary->name), "", $navigation,
"", "", true, update_module_button($cm->id, $course->id, $strglossary),
navmenu($course, $cm));
$strsearch = get_string("search");
$strwaitingapproval = get_string('waitingapproval', 'glossary');
- $navlinks = array();
- $navlinks[] = array('name' => $strglossaries, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($glossary->name), 'link' => "view.php?id=$id", 'type' => 'activityinstance');
-
/// If we are in approval mode, prit special header
if ($tab == GLOSSARY_APPROVAL_VIEW) {
require_capability('mod/glossary:approve', $context);
- $navlinks[] = array('name' => $strwaitingapproval, 'link' => '', 'type' => 'title');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($strwaitingapproval, $cm);
print_header_simple(format_string($glossary->name), "", $navigation, "", "", true,
update_module_button($cm->id, $course->id, $strglossary), navmenu($course, $cm));
print_heading($strwaitingapproval);
} else { /// Print standard header
- $navigation = build_navigation($navlinks);
+ $navigation = build_navigation('', $cm);
print_header_simple(format_string($glossary->name), "", $navigation, "", "", true,
update_module_button($cm->id, $course->id, $strglossary), navmenu($course, $cm));
}
$title = format_string($course->shortname) . ": $hotpot->name";
$heading = $course->fullname;
- $navlinks = array();
- $navlinks[] = array('name' => $strmodulenameplural, 'link' => 'index.php?id='.$course->id, 'type' => 'activity');
- $navlinks[] = array('name' => $hotpot->name, 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
-
-
$modulecontext = get_context_instance(CONTEXT_MODULE, $cm->id);
if (has_capability('mod/hotpot:viewreport',$modulecontext)) {
if ($mode=='overview' || $mode=='simplestat' || $mode=='fullstat') {
$module = "hotpot";
}
- $navlinks[] = array('name' => get_string("report$mode", $module), 'link' => '', 'type' => 'title');
-
-
+ $navigation = build_navigation(get_string("report$mode", $module), $cm);
} else {
-
- $navlinks[] = array('name' => get_string("report", "quiz"), 'link' => '', 'type' => 'title');
+ $navigation = build_navigation(get_string("report", "quiz"), $cm);
}
$button = update_module_button($cm->id, $course->id, $strmodulename);
- $navigation = build_navigation($navlinks);
print_header($title, $heading, $navigation, "", "", true, $button, navmenu($course, $cm));
print_heading($hotpot->name);
$title = format_string($course->shortname) . ": $hotpot->name";
$heading = $course->fullname;
- $navlinks = array();
- $navlinks[] = array('name' => $strmodulenameplural, 'link' => 'index.php?id='.$course->id, 'type' => 'activity');
- $navlinks[] = array('name' => get_string("review", "quiz"), 'link' => '', 'type' => 'activityinstance');
- $navigation = build_navigation($navlinks);
-
-
+ $navigation = build_navigation('', $cm);
$button = update_module_button($cm->id, $course->id, $strmodulename);
print_header($title, $heading, $navigation, "", "", true, $button, navmenu($course, $cm));
print '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'; // for overlib
$title = format_string($course->shortname.': '.$hotpot->name, true);
$heading = $course->fullname;
- $navlinks = array();
- $navlinks[] = array('name' => get_string("modulenameplural", "hotpot"), 'link' => $CFG->wwwroot.'/mod/hotpot/index.php?id='.$course->id, 'type' => 'activity');
- $navlinks[] = array('name' => $hotpot->name, 'link' => '', 'type' => 'activityinstance');
-
- $navigation = build_navigation($navlinks);
+ $navigation = build_navigation('', $cm);
$button = update_module_button($cm->id, $course->id, get_string("modulename", "hotpot"));
$button = '<div style="font-size:0.75em;">'.$button.'</div>';
$entry->format = $defaultformat;
}
- $navlinks = array();
- $navlinks[] = array('name' => $strjournals, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($journal->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $stredit, 'link' => '', 'type' => 'action');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($stredit, $cm);
print_header_simple(format_string($journal->name), "", $navigation, "",
"", true, "", navmenu($course, $cm));
$strentries = get_string("entries", "journal");
$strjournals = get_string("modulenameplural", "journal");
- $navlinks = array();
- $navlinks[] = array('name' => $strjournals, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($journal->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strentries, 'link' => '', 'type' => 'title');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($strentries, $cm);
print_header_simple("$strjournals", "", $navigation, "", "", true);
-
/// Check to see if groups are being used in this journal
$groupmode = groupmode($course, $cm);
$currentgroup = setup_and_print_groups($course, $groupmode, "report.php?id=$cm->id");
$strjournal = get_string("modulename", "journal");
$strjournals = get_string("modulenameplural", "journal");
- $navlinks = array();
- $navlinks[] = array('name' => $strjournals, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($journal->name), 'link' => '', 'type' => 'activityinstance');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation('', $cm);
print_header_simple(format_string($journal->name), '', $navigation, '', '', true,
update_module_button($cm->id, $course->id, $strjournal), navmenu($course, $cm));
/// Print the header
- if ($course->id != SITEID) {
- $navigation = "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->";
- }
+ $navlinks = array();
+ $navlinks[] = array('name' => $strlamss, 'link' => '', 'type' => 'activity');
+ $navigation = build_navigation($navlinks);
print_header("$course->shortname: $strlamss", $course->fullname, "$navigation $strlamss", "", "", true, "", navmenu($course));
add_to_log($course->id, "lams", "view", "view.php?id=$cm->id", "$lams->id");
/// Print the page header
-
-//if ($course->id != SITEID) {
-// $navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->";
-//}
-$navlinks = array();
-$navlinks[] = array('name' => $strchoices, 'link' => "index.php?id=$course->id", 'type' => 'misc');
-$navlinks[] = array('name' => format_string($lams->name), 'link' => null, 'type' => 'misc');
-$navigation = build_navigation($navlinks);
+$navigation = build_navigation('', $cm);
print_header_simple(format_string($lams->name), "", $navigation, "", "", true,
update_module_button($cm->id, $course->id, get_string("lesson","lams")), navmenu($course, $cm));
$strimportquestions = get_string("importquestions", "lesson");
$strlessons = get_string("modulenameplural", "lesson");
- $navlinks = array();
- $navlinks[] = array('name' => $strlesson, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($lesson->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strimportquestions, 'link' => '', 'type' => 'title');
-
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($strimportquestions, $cm);
print_header_simple("$strimportquestions", " $strimportquestions", $navigation);
if ($form = data_submitted()) { /// Filename
$strimportppt = get_string("importppt", "lesson");
$strlessons = get_string("modulenameplural", "lesson");
- $navlinks = array();
- $navlinks[] = array('name' => $strlessons, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($mod->name,true), 'link' => "$CFG->wwwroot/mod/$modname/view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strimportppt, 'link' => '', 'type' => 'title');
-
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($strimportppt, $cm);
print_header_simple("$strimportppt", " $strimportppt", $navigation);
if ($form = data_submitted()) { /// Filename
function lesson_print_header($cm, $course, $lesson, $currenttab = '') {
global $CFG, $USER;
- $strlessons = get_string('modulenameplural', 'lesson');
$strlesson = get_string('modulename', 'lesson');
- $strname = format_string($lesson->name, true);
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
}
/// Header setup
- $navlinks = array();
- $navlinks[] = array('name' => $strlessons, 'link' => "$CFG->wwwroot/mod/lesson/index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => $strname, 'link' => '', 'type' => 'activityinstance');
-
- $navigation = build_navigation($navlinks);
+ $navigation = build_navigation('', $cm);
/// Print header, heading, tabs and messages
print_header("$course->shortname: $strname", $course->fullname, $navigation,
$title = "{$this->courserecord->shortname}: $activityname";
}
- $navlinks = array();
- $navlinks[] = array('name' => get_string('modulenameplural', $this->activityname), 'link' => $CFG->wwwroot."/mod/{$this->activityname}/index.php?id={$this->courserecord->id}", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($this->activityrecord->name), 'link' => $CFG->wwwroot."/mod/{$this->activityname}/view.php?id={$this->modulerecord->id}", 'type' => 'activityinstance');
-
- if (!empty($morenavlinks)) {
- $navlinks = array_merge($navlinks, $morenavlinks);
- }
-
-
/// Build the buttons
if (has_capability('mod/lesson:edit', $context)) {
$buttons = '<span class="edit_buttons">'.update_module_button($this->modulerecord->id, $this->courserecord->id, get_string('modulename', 'lesson'));
$meta = '';
// }
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($morenavlinks);
print_header($title, $this->courserecord->fullname, $navigation, '', $meta, true, $buttons, navmenu($this->courserecord, $this->modulerecord));
if (has_capability('mod/lesson:manage', $context)) {
$strupdatemodule = has_capability('moodle/course:manageactivities', $coursecontext)
? update_module_button($cm->id, $course->id, get_string('modulename', 'quiz'))
: "";
- $navlinks = array();
- $navlinks[] = array('name' => $strquizzes, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($quiz->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strattemptnum, 'link' => '', 'type' => 'title');
-
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($strattemptnum, $cm);
print_header_simple(format_string($quiz->name), "", $navigation, "", $headtags, true, $strupdatemodule);
}
$strupdatemodule = has_capability('moodle/course:manageactivities', $contexts->lowest())
? update_module_button($cm->id, $course->id, get_string('modulename', 'quiz'))
: "";
- $navlinks = array();
- $navlinks[] = array('name' => $strquizzes, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($quiz->name), 'link' => "view.php?q=$quiz->instance", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $streditingquiz, 'link' => '', 'type' => 'title');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($streditingquiz, $cm);
print_header_simple($streditingquiz, '', $navigation, "", "",
true, $strupdatemodule);
$strupdatemodule = has_capability('moodle/course:manageactivities', $contexts->lowest())
? update_module_button($cm->id, $course->id, get_string('modulename', 'quiz'))
: "";
- $navlinks = array();
- $navlinks[] = array('name' => $strquizzes, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($quiz->name), 'link' => "view.php?q=$quiz->instance", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $streditingquiz, 'link' => '', 'type' => 'title');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($streditingquiz, $cm);
print_header_simple($streditingquiz, '', $navigation, "", "", true, $strupdatemodule);
$currenttab = 'edit';
$strquizzes = get_string("modulenameplural", "quiz");
$strquiz = get_string("modulename", "quiz");
/// Print the page header
- $navlinks = array();
- $navlinks[] = array('name' => $strquizzes, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($quiz->name), 'link' => '', 'type' => 'activityinstance');
- $navigation = build_navigation($navlinks);
+ $navigation = build_navigation('', $cm);
print_header_simple(format_string($quiz->name), "", $navigation,
'', $meta, true, update_module_button($cm->id, $course->id, $strquiz), navmenu($course, $cm));
/// Print the page header
- $strquizzes = get_string("modulenameplural", "quiz");
- $strreview = get_string("review", "quiz");
$strscore = get_string("score", "quiz");
$strgrade = get_string("grade");
$strbestgrade = get_string("bestgrade", "quiz");
$strtimecompleted = get_string("completedon", "quiz");
$stroverdue = get_string("overdue", "quiz");
+/// Work out appropriate title.
+ if ($isteacher and $attempt->userid == $USER->id) {
+ $strreviewtitle = get_string('reviewofpreview', 'quiz');
+ } else {
+ $strreviewtitle = get_string('reviewofattempt', 'quiz', $attempt->attempt);
+ }
+
$pagequestions = explode(',', $pagelist);
$headtags = get_html_head_contributions($pagequestions, $questions, $states);
if (!empty($popup)) {
$strupdatemodule = has_capability('moodle/course:manageactivities', $coursecontext)
? update_module_button($cm->id, $course->id, get_string('modulename', 'quiz'))
: "";
-
- $navlinks = array();
- $navlinks[] = array('name' => $strquizzes, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($quiz->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strreview, 'link' => '', 'type' => 'title');
-
- $navigation = build_navigation($navlinks);
-
+ get_string('reviewofattempt', 'quiz', $attempt->attempt);
+ $navigation = build_navigation($strreviewtitle, $cm);
print_header_simple(format_string($quiz->name), "", $navigation, "", $headtags, true, $strupdatemodule);
}
echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'; // for overlib
$mode = '';
}
include('tabs.php');
- } else {
- print_heading(format_string($quiz->name));
}
+ print_heading(format_string($quiz->name));
if ($isteacher and $attempt->userid == $USER->id) {
// the teacher is at the end of a preview. Print button to start new preview
unset($buttonoptions);
echo '<div class="controls">';
print_single_button($CFG->wwwroot.'/mod/quiz/attempt.php', $buttonoptions, get_string('startagain', 'quiz'));
echo '</div>';
- } else { // print number of the attempt
- print_heading(get_string('reviewofattempt', 'quiz', $attempt->attempt));
}
+ print_heading($strreviewtitle);
// print javascript button to close the window, if necessary
if (!$isteacher) {
var $cm;
var $course;
var $resource;
- var $navigation;
var $navlinks;
/**
$this->strresource = get_string("modulename", "resource");
$this->strresources = get_string("modulenameplural", "resource");
- $this->navlinks[] = array('name' => $this->strresources, 'link' => "index.php?id={$this->course->id}", 'type' => 'activity');
-
if (!$this->cm->visible and !has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_MODULE, $this->cm->id))) {
$pagetitle = strip_tags($this->course->shortname.': '.$this->strresource);
- $this->navlinks[] = array('name' => $this->strresource, 'link' => '', 'type' => 'activityinstance');
- $this->navigation = build_navigation($this->navlinks);
+ $navigation = build_navigation($this->navlinks, $this->cm);
- print_header($pagetitle, $this->course->fullname, $this->navigation, "", "", true, '', navmenu($this->course, $this->cm));
+ print_header($pagetitle, $this->course->fullname, $navigation, "", "", true, '', navmenu($this->course, $this->cm));
notice(get_string("activityiscurrentlyhidden"), "$CFG->wwwroot/course/view.php?id={$this->course->id}");
}
array_shift($subs);
$countsubs = count($subs);
$count = 0;
- $subnav = "<a href=\"view.php?id={$cm->id}\">".format_string($resource->name,true)."</a>";
$backsub = '';
- $this->navlinks[] = array('name' => format_string($resource->name,true), 'link' => "view.php?id={$cm->id}", 'type' => 'activity');
-
+
foreach ($subs as $sub) {
$count++;
if ($count < $countsubs) {
$this->navlinks[] = array('name' => $sub, 'link' => '', 'type' => 'title');
}
}
- } else {
- $this->navlinks[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activity');
}
$pagetitle = strip_tags($course->shortname.': '.format_string($resource->name));
$editfiles = print_single_button("$CFG->wwwroot/files/index.php", $options, get_string("editfiles"), 'get', '', true);
$update = $editfiles.$update;
}
- $this->navigation = build_navigation($this->navlinks);
- print_header($pagetitle, $course->fullname, $this->navigation,
+ $navigation = build_navigation($this->navlinks, $cm);
+ print_header($pagetitle, $course->fullname, $navigation,
"", "", true, $update,
navmenu($course, $cm));
if ($inpopup) {
print_header($pagetitle, $course->fullname);
} else {
- $this->navlinks[] = array('name' => format_string($resource->name), 'link' => null, 'type' => 'misc');
- $this->navigation = build_navigation($this->navlinks);
- print_header($pagetitle, $course->fullname, $this->navigation,
+ $navigation = build_navigation($this->navlinks, $cm);
+ print_header($pagetitle, $course->fullname, $navigation,
"", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
}
notify(get_string('notallowedlocalfileaccess', 'resource', ''));
/// Check whether this is supposed to be a popup, but was called directly
if ($resource->popup and !$inpopup) { /// Make a page and a pop-up window
- $this->navlinks[] = array('name' => format_string($resource->name), 'link' => null, 'type' => 'misc');
- $this->navigation = build_navigation($this->navlinks);
-
- print_header($pagetitle, $course->fullname, $this->navigation,
+ $navigation = build_navigation($this->navlinks, $cm);
+ print_header($pagetitle, $course->fullname, $navigation,
"", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
-
echo "\n<script type=\"text/javascript\">";
echo "\n<!--\n";
echo "openpopup('/mod/resource/view.php?inpopup=true&id={$cm->id}','resource{$resource->id}','{$resource->popup}');\n";
/// If we are in a frameset, just print the top of it
if (!empty( $frameset ) and ($frameset == "top") ) {
- $this->navlinks[] = array('name' => format_string($resource->name), 'link' => null, 'type' => 'misc');
- $this->navigation = build_navigation($this->navlinks);
- print_header($pagetitle, $course->fullname, $this->navigation,
+ $navigation = build_navigation($this->navlinks, $cm);
+ print_header($pagetitle, $course->fullname, $navigation,
"", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm, "parent"));
$options = new object();
if ($inpopup) {
print_header($pagetitle);
} else {
- $this->navlinks[] = array('name' => format_string($resource->name, true),
- 'link' => $fullurl,
- 'type' => 'misc');
- $this->navigation = build_navigation($this->navlinks);
- print_header_simple($pagetitle, '', $this->navigation, "", "", true,
+ $navigation = build_navigation($this->navlinks, $cm);
+ print_header_simple($pagetitle, '', $navigation, "", "", true,
update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm, "self"));
}
"center clearfix", "", "", "20");
print_footer($course);
} else { /// Make a page and a pop-up window
-
- $this->navlinks[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activityinstance');
- $this->navigation = build_navigation($this->navlinks);
+ $navigation = build_navigation($this->navlinks, $cm);
- print_header($pagetitle, $course->fullname, $this->navigation,
+ print_header($pagetitle, $course->fullname, $navigation,
"", "", true, update_module_button($cm->id, $course->id, $this->strresource),
navmenu($course, $cm));
print_footer($course);
}
} else { /// not a popup at all
-
- $this->navlinks[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activityinstance');
- $this->navigation = build_navigation($this->navlinks);
+ $navigation = build_navigation($this->navlinks, $cm);
- print_header($pagetitle, $course->fullname, $this->navigation,
+ print_header($pagetitle, $course->fullname, $navigation,
"", "", true, update_module_button($cm->id, $course->id, $this->strresource),
navmenu($course, $cm));
print_header($pagetitle, $course->fullname);
} else {
- $resource_obj->navlinks[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activityinstance');
$resource_obj->navlinks[] = array('name' => $strdeploy, 'link' => '', 'type' => 'action');
- $navigation = build_navigation($resource_obj->navlinks);
+ $navigation = build_navigation($resource_obj->navlinks, $cm);
print_header($pagetitle, $course->fullname, $navigation,
'', '', true,
update_module_button($cm->id, $course->id, $resource_obj->strresource));
if ($inpopup) {
print_header($pagetitle, $course->fullname.' : '.$resource->name);
} else {
-
- $this->navlinks[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activityinstance');
- $this->navigation = build_navigation($this->navlinks);
-
- print_header($pagetitle, $course->fullname, $this->navigation, "", "", true,
+ $navigation = build_navigation($this->navlinks, $cm);
+ print_header($pagetitle, $course->fullname, $navigation, "", "", true,
update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
}
print_simple_box_start('center', '60%');
/// Check whether this is supposed to be a popup, but was called directly
if (empty($frameset) && $resource->popup && !$inpopup) { /// Make a page and a pop-up window
- $this->navlinks[] = array('name' => format_string($resource->name), 'link' => null, 'type' => 'misc');
- $this->navigation = build_navigation($this->navlinks);
+ $navigation = build_navigation($this->navlinks, $cm);
- print_header($pagetitle, $course->fullname, $this->navigation, "", "", true,
+ print_header($pagetitle, $course->fullname, $navigation, "", "", true,
update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
echo "\n<script type=\"text/javascript\">";
//print_header($pagetitle, $course->fullname.' : '.$resource->name);
print_header();
} else {
- $this->navlinks[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'activityinstance');
- $this->navigation = build_navigation($this->navlinks);
- print_header($pagetitle, $course->fullname, $this->navigation, "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm, "parent"));
+ $navigation = build_navigation($this->navlinks, $cm);
+ print_header($pagetitle, $course->fullname, $navigation, "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm, "parent"));
}
/// content - this produces everything else
$this->print_ims($cm, $course, $items, $resource, $page);
$resourcetype = "html";
}
}
-
-
- $this->navlinks[] = array('name' => format_string($resource->name), 'link' => null, 'type' => 'misc');
- $this->navigation = build_navigation($this->navlinks);
+ $navigation = build_navigation($this->navlinks, $cm);
/// Form the parse string
if (!empty($resource->alltext)) {
if ($inpopup) {
print_header($pagetitle, $course->fullname);
} else {
- print_header($pagetitle, $course->fullname, $this->navigation, "", "", true,
+ print_header($pagetitle, $course->fullname, $navigation, "", "", true,
update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
}
notify('You do not have access to HarvestRoad Hive. This resource is unavailable.');
if ($inpopup) {
print_header($pagetitle, $course->fullname);
} else {
- print_header($pagetitle, $course->fullname, $this->navigation, "", "", true,
+ print_header($pagetitle, $course->fullname, $navigation, "", "", true,
update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
}
notify(get_string('notallowedlocalfileaccess', 'resource', ''));
/// Check whether this is supposed to be a popup, but was called directly
if ($resource->popup and !$inpopup) { /// Make a page and a pop-up window
- print_header($pagetitle, $course->fullname, $this->navigation, "", "", true,
+ print_header($pagetitle, $course->fullname, $navigation, "", "", true,
update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
/// If we are in a frameset, just print the top of it
if (!empty($frameset) and $frameset == "top") {
- print_header($pagetitle, $course->fullname, $this->navigation, "", "", true,
+ print_header($pagetitle, $course->fullname, $navigation, "", "", true,
update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm, "parent"));
echo '<div class="summary">'.format_text($resource->summary, FORMAT_HTML, $formatoptions).'</div>';
if ($inpopup) {
print_header($pagetitle);
} else {
- print_header($pagetitle, $course->fullname, $this->navigation, "", "", true,
+ print_header($pagetitle, $course->fullname, $navigation, "", "", true,
update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm, "self"));
}
"center", "", "", "20");
print_footer($course);
} else { /// Make a page and a pop-up window
+ $navigation = build_navigation($this->navlinks, $cm);
- $this->navlinks[] = array('name' => format_string($resource->name), 'link' => null, 'type' => 'misc');
- $this->navigation = build_navigation($this->navlinks);
-
- print_header($pagetitle, $course->fullname, $this->navigation,
+ print_header($pagetitle, $course->fullname, $navigation,
"", "", true, update_module_button($cm->id, $course->id, $this->strresource),
navmenu($course, $cm));
} else { /// not a popup at all
add_to_log($course->id, "resource", "view", "view.php?id={$cm->id}", $resource->id, $cm->id);
- $this->navlinks[] = array('name' => format_string($resource->name), 'link' => '', 'type' => 'title');
- $this->navigation = build_navigation($this->navlinks);
+ $navigation = build_navigation($this->navlinks, $cm);
- print_header($pagetitle, $course->fullname, $this->navigation,
+ print_header($pagetitle, $course->fullname, $navigation,
"", "", true, update_module_button($cm->id, $course->id, $this->strresource),
navmenu($course, $cm));
$strattempt = get_string('attempt', 'scorm');
$strname = get_string('name');
- $navlinks = array();
- $navlinks[] = array('name' => $strscorms, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($scorm->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
-
if (empty($b)) {
if (empty($a)) {
- $navigation = build_navigation($navlinks);
+ $navigation = build_navigation('', $cm);
print_header("$course->shortname: ".format_string($scorm->name), $course->fullname,$navigation,
'', '', true);
} else {
+ $navlinks = array();
$navlinks[] = array('name' => $strreport, 'link' => "report.php?id=$cm->id", 'type' => 'title');
$navlinks[] = array('name' => "$strattempt $attempt - ".fullname($userdata), 'link' => '', 'type' => 'title');
- $navigation = build_navigation($navlinks);
+ $navigation = build_navigation($navlinks, $cm);
print_header("$course->shortname: ".format_string($scorm->name), $course->fullname,
$navigation, '', '', true);
}
} else {
-
+
+ $navlinks = array();
$navlinks[] = array('name' => $strreport, 'link' => "report.php?id=$cm->id", 'type' => 'title');
$navlinks[] = array('name' => "$strattempt $attempt - ".fullname($userdata), 'link' => "report.php?a=$a&user=$user&attempt=$attempt", 'type' => 'title');
$navlinks[] = array('name' => $sco->title, 'link' => '', 'type' => 'title');
- $navigation = build_navigation($navlinks);
+ $navigation = build_navigation($navlinks, $cm);
print_header("$course->shortname: ".format_string($scorm->name), $course->fullname, $navigation,
'', '', true);
<a href=\"view.php?id=$cm->id\">".format_string($survey->name,true)."</a> -> ";
}
- $navlinks = array();
- $navlinks[] = array('name' => $strsurveys, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($survey->name), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strreport, 'link' => '', 'type' => 'title');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($strreport, $cm);
print_header("$course->shortname: ".format_string($survey->name), $course->fullname, $navigation,
"", "", true,
update_module_button($cm->id, $course->id, $strsurvey), navmenu($course, $cm));
add_to_log($course->id, "survey", "submit", "view.php?id=$cm->id", "$survey->id", "$cm->id");
- $strsurveys = get_string("modulenameplural", "survey");
- $strsurveysaved = get_string("surveysaved", "survey");
- $navlinks = array();
- $navlinks[] = array('name' => $strsurveys, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($survey->name), 'link' => '', 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strsurveysaved, 'link' => '', 'type' => 'title');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($strsurveysaved, $cm);
print_header_simple("$strsurveysaved", "", $navigation, "");
$showscales = ($template->name != 'ciqname');
- $strsurveys = get_string("modulenameplural", "survey");
- $strsurvey = get_string("modulename", "survey");
-
- $navlinks = array();
- $navlinks[] = array('name' => $strsurveys, 'link' => "index.php?id=$course->id", 'type' => 'activity');;
- $navlinks[] = array('name' => format_string($survey->name), 'link' => '', 'type' => 'activityinistance');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation('', $cm);
print_header_simple(format_string($survey->name), "", $navigation, "", "", true,
update_module_button($cm->id, $course->id, $strsurvey), navmenu($course, $cm));
default: break;
}
}
- $navlinks = array();
- $navlinks[] = array('name' => $strwikis, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($wiki->name,true), 'link' => "view.php?id=$moodleID", 'type' => 'activityinstace');
- $navlinks[] = array('name' => get_string("administration","wiki"), 'link' => '', 'type' => 'title');
-
- $navigation = build_navigation($navlinks);
+ $navigation = build_navigation(get_string("administration","wiki"), $cm);
print_header_simple("$wiki_entry->pagename", "", $navigation,
$focus, "", true, update_module_button($cm->id, $course->id, $strwiki),
navmenu($course, $cm));
$strwikis = get_string("modulenameplural", "wiki");
$strwiki = get_string("modulename", "wiki");
- $navlinks = array();
- $navlinks[] = array('name' => $strwikis, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($wiki->name,true), 'link' => "view.php?id=$moodleID", 'type' => 'activityinstace');
-
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation('', $cm);
print_header_simple($ewiki_title?$ewiki_title:format_string($wiki->name), "", $navigation,
"", "", $cacheme, update_module_button($cm->id, $course->id, $strwiki),
navmenu($course, $cm));
/// top frame with the navigation bar and the assessment form
if ($frameset == "top") {
- // removed <base target="_parent" />
- // because it does not validate MDL-7861
- $navlinks = array();
- $navlinks[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strassess, 'link' => '', 'type' => 'title');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($strassess, $cm);
print_header_simple(format_string($workshop->name), "",$navigation,
"", '', true);
$strassessments = get_string("assessments", "workshop");
// ... print the header and...
-
- $navlinks = array();
- $navlinks[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strassessments, 'link' => '', 'type' => 'title');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($strassessments, $cm);
print_header_simple(format_string($workshop->name), "", $navigation,
"", "", true);
$strsubmissions = get_string("submissions", "workshop");
// ... print the header and...
- $navlinks = array();
- $navlinks[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strsubmissions, 'link' => '', 'type' => 'title');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($strsubmissions, $cm);
print_header_simple(format_string($workshop->name), "", $navigation,
"", "", true);
$strworkshop = get_string('modulename', 'workshop');
$strsubmission = get_string('submission', 'workshop');
- $navlinks = array();
- $navlinks[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strsubmission, 'link' => '', 'type' => 'title');
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($strsubmission, $cm);
print_header_simple(format_string($workshop->name)." : $strsubmission", "", $navigation,
"", "", true);
$timenow = time();
$strworkshops = get_string("modulenameplural", "workshop");
$strworkshop = get_string("modulename", "workshop");
- $straction = ($action) ? '-> '.get_string($action, 'workshop') : '';
// ...and if necessary set default action
if (workshop_is_teacher($workshop)) {
}
// ...display header...
- $navlinks = array();
- $navlinks[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- if ($straction) {
- $navlinks[] = array('name' => $straction, 'link' => '', 'type' => 'title');
- }
- $navigation = build_navigation($navlinks);
-
+ $navigation = build_navigation($action, $cm);
print_header_simple(format_string($workshop->name), "", $navigation,
"", "", true, update_module_button($cm->id, $course->id, $strworkshop), navmenu($course, $cm));
/// top frame with the navigation bar and the assessment form
if ($frameset == "top") {
- $navlinks = array();
- $navlinks[] = array('name' => $strworkshops, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => format_string($workshop->name,true), 'link' => "view.php?id=$cm->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => $strassess, 'link' => '', 'type' => 'title');
- $navigation = build_navigation($navlinks);
-
- // removed <base target="_parent" /> as it does not validate
+ $navigation = build_navigation($strassess, $cm);
print_header_simple(format_string($workshop->name), "", $navigation,
"", '', true);