]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-11741 - Convert core modules to take advantage of recent improvements to build_na...
authortjhunt <tjhunt>
Fri, 12 Oct 2007 15:55:49 +0000 (15:55 +0000)
committertjhunt <tjhunt>
Fri, 12 Oct 2007 15:55:49 +0000 (15:55 +0000)
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.

68 files changed:
lang/en_utf8/quiz.php
lib/pagelib.php
mod/assignment/lib.php
mod/chat/report.php
mod/choice/report.php
mod/choice/view.php
mod/data/edit.php
mod/data/field/latlong/kml.php
mod/data/import.php
mod/data/lib.php
mod/data/templates.php
mod/data/view.php
mod/exercise/assessments.php
mod/exercise/submissions.php
mod/exercise/upload.php
mod/exercise/view.php
mod/forum/discuss.php
mod/forum/markposts.php
mod/forum/post.php
mod/forum/search.php
mod/forum/settracking.php
mod/forum/subscribe.php
mod/forum/subscribers.php
mod/forum/view.php
mod/glossary/comment.php
mod/glossary/comments.php
mod/glossary/deleteentry.php
mod/glossary/edit.php
mod/glossary/export.php
mod/glossary/exportentry.php
mod/glossary/import.php
mod/glossary/view.php
mod/hotpot/report.php
mod/hotpot/review.php
mod/hotpot/view.php
mod/journal/edit.php
mod/journal/report.php
mod/journal/view.php
mod/lams/index.php
mod/lams/view.php
mod/lesson/import.php
mod/lesson/importppt.php
mod/lesson/locallib.php
mod/lesson/pagelib.php
mod/quiz/attempt.php
mod/quiz/edit.php
mod/quiz/report/default.php
mod/quiz/review.php
mod/resource/lib.php
mod/resource/type/directory/resource.class.php
mod/resource/type/file/resource.class.php
mod/resource/type/html/resource.class.php
mod/resource/type/ims/deploy.php
mod/resource/type/ims/resource.class.php
mod/resource/type/repository/resource.class.php
mod/resource/type/text/resource.class.php
mod/scorm/report.php
mod/survey/report.php
mod/survey/save.php
mod/survey/view.php
mod/wiki/admin.php
mod/wiki/view.php
mod/workshop/assess.php
mod/workshop/assessments.php
mod/workshop/submissions.php
mod/workshop/upload.php
mod/workshop/view.php
mod/workshop/viewassessment.php

index 85a71592260a67a47cd40bf154e0f13c639cbf54..690ad9aaa50700a0b53ceeeffd52168b7c7e7354 100644 (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';
index 5dc5a4d5449c718d320fe8ea5fccf90c8cbeb739..c1c5d43230573c7973995c4bef25cd3ba97cd069 100644 (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);
     }
     
index 99298c0478948ff5aec35769e26a87e938d66cad..3daa3b325c1554dfdd6eb4392835bf3cd2952225 100644 (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));
 
index 17ca573b63ccd76dbabce045aca95df6c5f061f1..9aaef0ab81a036432eca2d91b3ce3e7b993ae8fd 100644 (file)
 /// 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));
 
index d782383219b44c703a4906b5c21aad029c93dd5e..842ff43fd0365f1e470823f620ddaa932b296410 100644 (file)
         
     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
index e36863470bf43331f2fb032fa566f9b9ef84e29d..7c544b6d8d356b12301eed9a845fbf31bf96e6e9 100644 (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));
 
index eb1e791876524e9e473073613312efff57c52f05..58f7cc8c491f462cec6c5e74f6a28155b3f961c8 100755 (executable)
     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), '', '');
index e701f97b96425a567052eefc089d135ed26f98dd..7af26312b5e439d408a6dc8ac57dba11ba6b984a 100644 (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"));
index f0c78790ff61c680ce034d7e18667f28e6c6bbfb..c3ac8c73e071be3143d5b2cc4273d3f9112a605b 100755 (executable)
 /// 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));
 
index cc7543d4c4aa5cb27e8b16e8cf9db09611814bff..854956047c17cbd0e85efe978521612c4addc4e0 100755 (executable)
@@ -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));
index 2bd4ac48c6c92be7e3d68571eb0bb0eea51bf17a..4d405854129755e48322939334272dacbb78d42e 100755 (executable)
     $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);
index e17e53b9ce4dad480b174d71c896febc9965633c..9e11581832e4f730d914f87f56832366ed3603b4 100755 (executable)
 
 /// 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"));
index 20eea1c1ff1e39c9df4b8f1e327196fb46917c79..0e5d2f9b68d11c4a3e5c741189164d2810e96cb5 100644 (file)
     $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);
 
index eb9430965dcdb100bb037b070740e678a14ae98d..68d5bb4d9b3f4f115b07d5770bbc19cb070a08eb 100644 (file)
     $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);
 
index 375f125be880405c7b825a294ca55ff0d153fc61..8a6796c0733ed35626aea17041db70daea5765eb 100644 (file)
     $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);
 
index 3cf1b12375eb85edcd8124cffbc1968967c76503..5ee7fc7addc3f784e74e3b41fd9b2737bcf1a267 100644 (file)
     $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));
index abdbd9ae3305ec0a6e359b8350dc22fa12745dfb..05a14d78c5dc5547d24883c5b34247b84e92d1e3 100644 (file)
     $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));
     
index 5b859fd9a960f0f39a0430f9006630d4c2d957b5..aca13d435532ff53b768f43ad54c82926f4d216a 100644 (file)
             $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']);
index 4206de261af8fa89ce8a2cef00a8aa8c8a90b865..70f3abc9624feacd69a5505e9121a5150385a40c 100644 (file)
             $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)) {
index 4c5218736907e40b1bb28a9978258ef2bc3130aa..75e311a260d69f8a18138bfc84d4d79fae6a1b8f 100644 (file)
     $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',
index 766ad927bfb1c5beaf4318f76904cc8db60279f5..92238d73015e43d1faeeb920a6df2b63a9572cbb 100644 (file)
             $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']);
index 6baad93c689a138494f685df28f4877c3fad457a..5aad133e057d9074568866078b8d118bd5982b4b 100644 (file)
             $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'),
index 853d6a738c1e03e2b58c0843848cd70ab3d37d20..3fa4f0a2eea13fe7499641ec6d8d9174c9afbdb0 100644 (file)
     $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,
index 6a6e624ec9dd8548edd1e9975b0ec9dd91ad57de..f9da7604ad7f9ae69c5e5fada3dee822e0c18da8 100644 (file)
 
 
 /// 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));
 
index 3a0f76249c42ab86b58e75bfe665dd6457b8f24e..c9c7e0592e084ccb5dac8f85c2e1dae8bf3d967c 100644 (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),
index 271d13eee44e4a3210edfd7d04092eb897d2ec8b..cf13f26c1d57f9374b3deb6ffaea93d1e548b31a 100644 (file)
     $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));
index 4f9db3b5e4f2983049bb62a4d512b39c20f165ee..e3a8ab01137a7078fffab05746542190155cb3eb 100644 (file)
 
     $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!");
     }
index 2a3b9ca00600c75cf30eb5ac083a755ca9197aac..7a2734ffd30cb77628ccff2ec3dcb06e7a8d1874 100644 (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
index dee41637397944e72d3b184ecc2830b018c003bd..0f91fabf214baf6c30e6b094e463b0d669b0bda8 100644 (file)
     $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));
index fd03e01c89e1e61effcf89c1ef48f8a5566b85ff..5013abd96d6190c0eafbacd2c3b3c6f948d92ae2 100644 (file)
     $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 ) {
index a93d9bd57becf5ad80a6d5fe1179f8aee733a3ea..56edc02a42aae3d280dc61fa931c52115b0fb1b6 100644 (file)
     $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));
index 44f99b56814f6c498680da4729a7b4311d9f5079..e807ef08e0022ae6f16c69d005e223ae9416683c 100644 (file)
     $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));
     }
index 32e2eb1f60294f61066a1d0cd6d8932115a640b5..1e38dbc901df8bee5d7e9e5a2b1526b662cb6361 100644 (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);
index 314fd3e9d30c4b0afc8d6b64cc0e9c63c7a65004..0eef8953cf2f6b614a59ad7f74dad2450b8e27b6 100644 (file)
     $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
index 2b43347cfd38c21479ec6acf8fc961fd34f9bc91..3e18a599c6b3bf5a7dd278f7f521dec8f4dc0c45 100644 (file)
     $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>';
index d3d547c33d5b15e65c92afaa945356617ef9d5c3..79ed2eada6ee3d8148665ba29342108b47d9697e 100644 (file)
         $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));
 
index eb687ae0c93d5aa0c0e19d21c0a9c56caa626c72..441f9d86f767c7871e0c19b0aa7d2e49179721ca 100644 (file)
     $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");
index 7233ee88af668937fbcb229a32bb36a70ad5f869..7dad3fcd826344832bba1210e1d0445b240664e0 100644 (file)
     $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));
 
index 83d1ecb269f9f4ac49b4c72b1525a88823e3c966..4fa817c89906b711e61b1109011baae0621d83ff 100644 (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));
 
index 353f719e044d6d7c9215eaa5350f8bd0f06e8efc..527c7ab159d745c0eaff8eba6feab382bb24d8c1 100644 (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));
 
index be1559a04b1e75f19ee5774725e208729c7da000..8e41a64c38ab3b7d461bfc4c902fc0f1c26a70b5 100644 (file)
     $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
index a211f78a680277f52c9ac6cb1c4688e6e44bb5af..a407515be3ba8c6900d91cba593667ea877c3d3e 100644 (file)
     $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
index 0c8044bd42ea00c0934808b77d22d57e30fd2ea2..beea2a3d2ee3bd4b34f7eb77138394349abdc7d7 100644 (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,
index e12429128d1d8be5ba77e6d5b39dc23049436b0f..41d869c0af0f1de6bf9a08913d25bfa6491434a4 100644 (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)) {
index 3f0fd0266c9ed1d7d656ce38840ff9dda2045436..0e14375de448b51ea4be5c5d28a7ca1519c83b4d 100644 (file)
         $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);
     }
 
index 094b6d2aef8d174120ba42bb4cb5abd8f7fab81a..03112733b3e0c08382fb133e62b82be5ff4d8f85 100644 (file)
         $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';
index 612069c16b28dfff83b936dacea6b313d859c0fb..a5a05c07aa13118cf33c5510f4a791a6102b84b6 100644 (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));
index c21ac84f8d1d9fea87b5243da37d44c2e7300ed6..d85f9861dd5f359cbd655902594856176a4a2d80 100644 (file)
 
 /// 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) {
index 2a2fc62a50a438a2d152bf6c3c40c5e54adef8bc..c6ae028234f6daca797aa5efe0266e56f685bb08 100644 (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}");
             }
 
index ed40f7e8a060ee598577309b9b9202ab80ce6a6f..4ac61af878fa0a4bed9fca4f94f57685e0fdf60e 100644 (file)
@@ -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));
 
index 2d164fa017bd04bae1c1a8aff7482f321bd3ae82..12fcd92ddbaf3f19f33b73eaa54a85c53ace4f03 100644 (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"));
 
             }
index bb72fdbcf317ac2a172a1707261a27e4e89c50ee..b446c16f44b8896ae9bc0ebc621cdd30d089cefb 100644 (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));
 
index 6764d0b3fa107d182a5468727b95e029b7172953..9e5426df132ff77b448e91885d997c337524d356 100644 (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));
index bdbcc6f2641cf7502fedc56f5c940ee5be06adac..2efde0f66a3599c76623bb954fd74dfec300b904 100644 (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);
index d25f1928fc9b44185abc31cc843775f1ea5648d7..f25c2b5245cee6b0c4444edcb8b62eeecbfbe812 100644 (file)
@@ -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"));
 
         }
index 138c2184b7f7fde48a9207224d24a752b679f0ac..0f2d47f4930ef1fc138916cbf510ad002b2f96f8 100644 (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));
 
index 6be8b3c544b0b05abb239a3b8876c2dff5946054..75b97ba1caa890625c17f59c08474650d0622cce 100755 (executable)
         $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);
index 8e7ceee832262e32401222cf11ec3afe9b79c0b6..a585b73f546a836b1e47fbd28cae6da20e3c512c 100644 (file)
                        <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));
index acbeaa55bd9916642c4d8af33a6fe395ef93c3d3..5998987c045b93d8aa71a4fa39b996786595807f 100644 (file)
 
     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, "");
 
 
index 3bb956496ab8e0a6aa3ff24b5e2fa8e8f7596c77..a10575f39c32f1e14c32f009a69370fce60a0d5d 100644 (file)
 
     $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));
 
index fbd7431be749aadfd04c4852b41542cb2f79b5e2..77c207a3ab679048eede99c5facd9d16530e0048 100644 (file)
           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));
index f201cf92c397928c00597ceadcdc4e62dd086543..ab1970825d129e70fdade310c8c6ba2393ff36d6 100644 (file)
     $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));
index b7b02ecb7b5ed2e058c8b61d2da6cb72558aa2d4..3a1a8a5dd613ddd3ec843d11f64937b50bad6ee4 100644 (file)
     /// 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);
 
index b284d597b943c04565c0bd0d0580e22660b792cd..7bb8e9743325ac3c3293a199236ebd48e1d3c905 100644 (file)
     $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);
 
index 71d9898854a922fe2356843ce6754ca86ed0923b..000165b4a13d124a0f28d616dfd65b20ae7b4115 100644 (file)
     $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);
 
index 155867b8caf9f6d4defcf5f747daaa9ae700f219..5d040de7fe97232488c39dafd450c773c86b043a 100644 (file)
     $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();
index ae29d2dc61c30c8203a39c92c25f71fed413a9e3..49266aa43380e623128e0313e3c47999d5e3b884 100644 (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)) {
     }
 
     // ...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));
 
index a5238fe0c841848a6cd972b2177848b9929ece08..81648b2c044505312c19117646188b96e0b242de 100644 (file)
     /// 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);