MDL-11741 - Convert core modules to take advantage of recent improvements to build_navigation.

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.
This commit is contained in:
tjhunt
2007-10-12 15:55:49 +00:00
parent 3f544a2481
commit 38e179a4ed
68 changed files with 135 additions and 522 deletions
+2 -1
View File
@@ -486,7 +486,8 @@ $string['reviewbefore'] = 'Allow review while quiz is open';
$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';
+4 -10
View File
@@ -648,14 +648,6 @@ class page_generic_activity extends page_base {
$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)) {
@@ -669,8 +661,10 @@ class page_generic_activity extends page_base {
$buttons = '&nbsp;';
}
$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);
}
+5 -20
View File
@@ -27,7 +27,6 @@ class assignment_base {
var $strassignments;
var $strsubmissions;
var $strlastmodified;
var $navigation;
var $pagetitle;
var $currentgroup;
var $usehtmleditor;
@@ -82,19 +81,15 @@ class assignment_base {
$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}");
}
@@ -148,14 +143,11 @@ class assignment_base {
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));
@@ -1039,14 +1031,7 @@ class assignment_base {
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));
+2 -13
View File
@@ -39,13 +39,7 @@
/// 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));
@@ -95,12 +89,7 @@
/// 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));
+1 -7
View File
@@ -40,13 +40,7 @@
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
+1 -6
View File
@@ -58,12 +58,7 @@ if ($action == 'delchoice') {
/// 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));
+2 -10
View File
@@ -68,11 +68,7 @@
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"));
}
@@ -113,11 +109,7 @@
/// 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), '', '');
+1 -5
View File
@@ -57,11 +57,7 @@ require_course_login($course, true, $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"));
+1 -5
View File
@@ -78,11 +78,7 @@
/// 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));
+1 -8
View File
@@ -1680,14 +1680,7 @@ function data_print_header($course, $cm, $data, $currenttab='') {
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));
+1 -5
View File
@@ -94,11 +94,7 @@
$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);
+1 -7
View File
@@ -92,13 +92,7 @@
/// 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"));
+1 -7
View File
@@ -62,13 +62,7 @@
$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);
+1 -6
View File
@@ -50,12 +50,7 @@
$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);
+1 -6
View File
@@ -28,12 +28,7 @@
$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);
+1 -4
View File
@@ -47,10 +47,7 @@
$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));
+1 -3
View File
@@ -134,14 +134,12 @@
$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));
+1 -7
View File
@@ -32,13 +32,7 @@
$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']);
+10 -34
View File
@@ -52,19 +52,11 @@
$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'),
@@ -410,16 +402,11 @@
} 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'));
@@ -635,24 +622,9 @@
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)) {
@@ -665,7 +637,6 @@
// 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).':';
@@ -673,13 +644,18 @@
$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)) {
+3 -4
View File
@@ -97,12 +97,11 @@
$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',
+1 -7
View File
@@ -30,13 +30,7 @@
$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']);
+1 -7
View File
@@ -51,13 +51,7 @@
$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'),
+1 -6
View File
@@ -36,12 +36,7 @@
$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,
+1 -6
View File
@@ -64,12 +64,7 @@
/// 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));
+1 -5
View File
@@ -220,17 +220,13 @@ function glossary_comment_print_header($course, $cm, $glossary, $entry, $action)
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&amp;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),
+1 -6
View File
@@ -42,12 +42,7 @@
$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));
+1 -7
View File
@@ -39,17 +39,11 @@
$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!");
}
+1 -12
View File
@@ -188,22 +188,11 @@ if ($mform->is_cancelled()){
}
}
$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
+1 -6
View File
@@ -37,12 +37,7 @@
$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));
+1 -6
View File
@@ -38,12 +38,7 @@
$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 ) {
+1 -7
View File
@@ -45,13 +45,7 @@
$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));
+2 -8
View File
@@ -224,23 +224,17 @@
$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));
}
+2 -11
View File
@@ -405,11 +405,6 @@ function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) {
$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') {
@@ -418,16 +413,12 @@ function hotpot_print_report_heading(&$course, &$cm, &$hotpot, &$mode) {
$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);
+1 -6
View File
@@ -54,12 +54,7 @@
$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
+1 -5
View File
@@ -43,11 +43,7 @@
$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>';
+1 -6
View File
@@ -75,12 +75,7 @@
$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));
+1 -7
View File
@@ -38,15 +38,9 @@
$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");
+1 -5
View File
@@ -28,11 +28,7 @@
$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));
+3 -3
View File
@@ -24,9 +24,9 @@
/// 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));
+1 -8
View File
@@ -27,14 +27,7 @@ $context = get_context_instance(CONTEXT_MODULE, $cm->id);
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));
+1 -7
View File
@@ -35,13 +35,7 @@
$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
+1 -7
View File
@@ -44,13 +44,7 @@
$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
+1 -7
View File
@@ -226,9 +226,7 @@ if (!defined("LESSON_RESPONSE_EDITOR")) {
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);
@@ -239,11 +237,7 @@ function lesson_print_header($cm, $course, $lesson, $currenttab = '') {
}
/// 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,
+1 -11
View File
@@ -76,15 +76,6 @@ class page_lesson extends page_generic_activity {
$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'));
@@ -133,8 +124,7 @@ class page_lesson extends page_generic_activity {
$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)) {
+1 -7
View File
@@ -405,13 +405,7 @@
$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);
}
+2 -12
View File
@@ -293,12 +293,7 @@
$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);
@@ -331,12 +326,7 @@
$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';
+1 -4
View File
@@ -27,10 +27,7 @@ class quiz_default_report {
$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));
+11 -14
View File
@@ -106,8 +106,6 @@
/// 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");
@@ -115,6 +113,13 @@
$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)) {
@@ -126,14 +131,8 @@
$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
@@ -147,9 +146,8 @@
$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);
@@ -158,9 +156,8 @@
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) {
+2 -6
View File
@@ -81,7 +81,6 @@ class resource_base {
var $cm;
var $course;
var $resource;
var $navigation;
var $navlinks;
/**
@@ -113,14 +112,11 @@ class resource_base {
$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}");
}
@@ -61,10 +61,8 @@ function display() {
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) {
@@ -75,8 +73,6 @@ function display() {
$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));
@@ -87,8 +83,8 @@ function display() {
$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));
+8 -16
View File
@@ -324,9 +324,8 @@ class resource_file extends resource_base {
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', ''));
@@ -340,13 +339,10 @@ class resource_file extends resource_base {
/// 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";
@@ -405,9 +401,8 @@ class resource_file extends resource_base {
/// 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();
@@ -431,11 +426,8 @@ class resource_file extends resource_base {
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"));
}
+4 -8
View File
@@ -83,11 +83,9 @@ function display() {
"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));
@@ -112,11 +110,9 @@ function display() {
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));
+1 -2
View File
@@ -64,9 +64,8 @@
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));
+6 -11
View File
@@ -372,11 +372,8 @@ class resource_ims extends resource_base {
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%');
@@ -426,10 +423,9 @@ class resource_ims extends resource_base {
/// 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\">";
@@ -478,9 +474,8 @@ class resource_ims extends resource_base {
//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);
@@ -244,10 +244,7 @@ function display() {
$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)) {
@@ -280,7 +277,7 @@ function display() {
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.');
@@ -299,7 +296,7 @@ function display() {
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', ''));
@@ -314,7 +311,7 @@ function display() {
/// 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));
@@ -373,7 +370,7 @@ function display() {
/// 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>';
@@ -395,7 +392,7 @@ function display() {
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"));
}
+4 -7
View File
@@ -82,11 +82,9 @@ function display() {
"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));
@@ -113,10 +111,9 @@ function display() {
} 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));
+6 -8
View File
@@ -64,30 +64,28 @@
$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);
+1 -6
View File
@@ -65,12 +65,7 @@
<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));
+1 -8
View File
@@ -31,14 +31,7 @@
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, "");
+1 -8
View File
@@ -34,14 +34,7 @@
$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));
+1 -6
View File
@@ -114,13 +114,8 @@
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));
+1 -6
View File
@@ -284,12 +284,7 @@
$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));
+1 -8
View File
@@ -59,14 +59,7 @@
/// 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);
+1 -7
View File
@@ -70,13 +70,7 @@
$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);
+1 -6
View File
@@ -51,12 +51,7 @@
$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);
+1 -6
View File
@@ -23,12 +23,7 @@
$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();
+1 -9
View File
@@ -40,7 +40,6 @@
$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)) {
@@ -69,14 +68,7 @@
}
// ...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));
+1 -7
View File
@@ -58,13 +58,7 @@
/// 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);