]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-10870 All files updated to new build_navigation() method. Most are untested,...
authornicolasconnault <nicolasconnault>
Fri, 17 Aug 2007 19:09:11 +0000 (19:09 +0000)
committernicolasconnault <nicolasconnault>
Fri, 17 Aug 2007 19:09:11 +0000 (19:09 +0000)
59 files changed:
course/editsection.php
course/enrol.php
course/import.php
course/import/activities/index.php
course/import/groups/index.php
course/importstudents.php
course/index.php
course/loginas.php
course/mod.php
course/pending.php
course/recent.php
course/report.php
course/report/log/index.php
course/report/outline/index.php
course/report/participation/index.php
course/report/stats/index.php
course/request.php
course/reset.php
course/search.php
course/unenrol.php
course/user.php
enrol/authorize/enrol.php
enrol/authorize/index.php
enrol/authorize/uploadcsv.php
enrol/imsenterprise/importnow.php
enrol/manual/enrol.php
enrol/paypal/enrol.php
group/assign.php
group/members.php
lib/adminlib.php
lib/blocklib.php
lib/locallib.php
lib/moodlelib.php
login/change_password.php
login/confirm.php
login/forgot_password.php
login/mnet_email.php
login/signup.php
mod/glossary/showentry.php
mod/hotpot/view.php
mod/lams/view.php
mod/resource/type/ims/resource.class.php
mod/resource/type/repository/resource.class.php
mod/resource/type/text/resource.class.php
search/query.php
search/stats.php
theme/preview.php
user/addnote.php
user/edit.php
user/editadvanced.php
user/extendenrol.php
user/groupaddnote.php
user/groupextendenrol.php
user/index.php
user/messageselect.php
user/policy.php
user/view.php
userpix/index.php
userpix/upgrade.php

index 783461d0ac46121c1965304baad5efa67fa39d9b..6e9b848a6682524bc083e66d633cff30df016b23 100644 (file)
@@ -29,7 +29,7 @@
         }
 
         add_to_log($course->id, "course", "editsection", "editsection.php?id=$section->id", "$section->section");
-        
+
         redirect("view.php?id=$course->id");
         exit;
     }
         $strsummaryof = get_string('summaryof', '', " $sectionname $form->section");
     }
 
-    print_header_simple($stredit, '', $stredit, 'theform.summary' );
+    print_header_simple($stredit, '', build_navigation(array(array('name' => $stredit, 'link' => null, 'type' => 'misc'))), 'theform.summary' );
 
     print_heading($strsummaryof);
     print_simple_box_start('center');
     include('editsection.html');
     print_simple_box_end();
 
-    if ($usehtmleditor) { 
+    if ($usehtmleditor) {
         use_html_editor("summary");
     }
     print_footer($course);
index 6c077504e3ed0837f8cccf999e9eb8c6812286dc..1cc1f87e22085f0b69843a6cc12baa98bd42d930 100644 (file)
@@ -1,6 +1,6 @@
 <?php // $Id$
-      // Depending on the current enrolment method, this page 
-      // presents the user with whatever they need to know when 
+      // Depending on the current enrolment method, this page
+      // presents the user with whatever they need to know when
       // they try to enrol in a course.
 
     require_once("../config.php");
@@ -15,7 +15,7 @@
         if (!empty($CFG->loginhttps)) {
             $wwwroot = str_replace('http:','https:', $wwwroot);
         }
-        // do not use require_login here because we are usually comming from it 
+        // do not use require_login here because we are usually comming from it
         redirect($wwwroot.'/login/index.php');
     }
 
         print_error('loginasnoenrol', '', $CFG->wwwroot.'/course/view.php?id='.$USER->loginascontext->instanceid);
     }
 
-    $enrol = enrolment_factory::factory($course->enrol); // do not use if (!$enrol... here, it can not work in PHP4 - see MDL-7529 
+    $enrol = enrolment_factory::factory($course->enrol); // do not use if (!$enrol... here, it can not work in PHP4 - see MDL-7529
 
 /// Refreshing all current role assignments for the current user
 
     load_all_capabilities();
 
-/// Double check just in case they are actually enrolled already and 
-/// thus got to this script by mistake.  This might occur if enrolments 
+/// Double check just in case they are actually enrolled already and
+/// thus got to this script by mistake.  This might occur if enrolments
 /// changed during this session or something
 
     if (has_capability('moodle/course:view', $context) and !has_capability('moodle/legacy:guest', $context, NULL, false)) {
         print_header_simple();
         notice(get_string('coursenotaccessible'), "$CFG->wwwroot/index.php");
     }
-    
+
 /// Users can't enroll to site course
     if ($course->id == SITEID) {
         print_header_simple();
         notice(get_string('enrollfirst'), "$CFG->wwwroot/index.php");
     }
 
-/// Double check just in case they are enrolled to start in the future 
+/// Double check just in case they are enrolled to start in the future
 
     if ($course->enrolperiod) {   // Only active if the course has an enrolment period in effect
         if ($roles = get_user_roles($context, $USER->id)) {
@@ -88,7 +88,7 @@
             ($course->enrollable == 2 && $course->enrolstartdate > 0 && $course->enrolstartdate > time()) ||
             ($course->enrollable == 2 && $course->enrolenddate > 0 && $course->enrolenddate <= time())
             ) {
-        print_header($course->shortname, $course->fullname, $course->shortname );
+        print_header($course->shortname, $course->fullname, build_navigation(array(array('name'=>$course->shortname,'link'=>'','type'=>'misc'))) );
         notice(get_string('notenrollable'), "$CFG->wwwroot/index.php");
     }
 
index eef47dc477761ec4e80d40ede798fe06eb303efd..3c30c3832388f0e9e0497a40f8f6d37cefb4a116 100644 (file)
     }
 
     $strimport = get_string('import');
+    $navlinks = array();
+    $navlinks[] = array('name' => $strimport, 'link' => null, 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
 
-    print_header($course->fullname.': '.$strimport, $course->fullname.': '.$strimport, 
-                 '<a href="view.php?id='.$course->id.'">'.$course->shortname.'</a> -> '.$strimport);
+    print_header($course->fullname.': '.$strimport, $course->fullname.': '.$strimport, $navigation);
 
     $directories = get_list_of_plugins('course/import');
 
index 8364871af74c0c4c5592e11961da091ddd32884e..8b593cacd2d8713c5f5d3d761f5c4456c95d4d1a 100644 (file)
@@ -3,7 +3,7 @@
     require_once('../../../config.php');
     require_once('../../lib.php');
     require_once($CFG->dirroot.'/backup/restorelib.php');
-    
+
     $id               = required_param('id', PARAM_INT);   // course id to import TO
     $fromcourse       = optional_param('fromcourse', 0, PARAM_INT);
     $fromcoursesearch = optional_param('fromcoursesearch', '', PARAM_RAW);
@@ -16,7 +16,7 @@
         error("That's an invalid course id");
     }
 
-    if (!$site = get_site()){ 
+    if (!$site = get_site()){
         error("Couldn't get site course");
     }
 
@@ -45,7 +45,7 @@
             $restore->restoreto = 1;
             $restore->course_id = $id;
             $restore->importing = 1; // magic variable so we know that we're importing rather than just restoring.
-            
+
             $SESSION->restore = $restore;
             redirect($CFG->wwwroot.'/backup/restore.php?file='.$filename.'&id='.$fromcourse.'&to='.$id);
         }
             redirect($CFG->wwwroot.'/backup/backup.php?id='.$from->id.'&to='.$course->id);
         }
     }
-    
-    print_header("$course->shortname: $strimportactivities", $course->fullname, 
-                 "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> ".
-                 "-> <a href=\"$CFG->wwwroot/course/import.php?id=$course->id\">".get_string('import')."</a> ".
-                 "-> $strimportactivities");
+
+    $navlinks = array();
+    $navlinks[] = array('name' => $course->shortname,
+                        'link' => "$CFG->wwwroot/course/view.php?id=$course->id",
+                        'type' => 'misc');
+    $navlinks[] = array('name' => get_string('import'),
+                        'link' => "$CFG->wwwroot/course/import.php?id=$course->id",
+                        'type' => 'misc');
+    $navlinks[] = array('name' => $strimportactivities, 'link' => null, 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
+
+    print_header("$course->shortname: $strimportactivities", $course->fullname, $navigation);
     require_once('mod.php');
 
     print_footer();
-?>
\ No newline at end of file
+?>
index 831d1fe4d617304c7ef0a23bb0439137130f4e9d..7dc75208cf5e67b9aac1731b7dc00a4a26d203a7 100755 (executable)
@@ -1,21 +1,21 @@
-<?php // $Id: uploadgroups.php, 2005/10/31 19:09:31 
+<?php // $Id: uploadgroups.php, 2005/10/31 19:09:31
 
 /// Bulk group creation registration script from a comma separated file
 
     require_once('../../../config.php');
     require_once($CFG->dirroot.'/course/lib.php');
     require_once($CFG->dirroot.'/group/lib.php');
-    
+
     $id = required_param('id', PARAM_INT);    // Course id
-    
+
     if (! $course = get_record('course', 'id', $id) ) {
         error("That's an invalid course id");
     }
-    
+
     require_login($course->id);
     $context = get_context_instance(CONTEXT_COURSE, $id);
-    
-    
+
+
     if (!has_capability('moodle/course:managegroups', $context)) {
         error("You do not have the required permissions to manage groups.");
     }
@@ -27,7 +27,7 @@
       $strimportgroups = get_string("importgroups");
 
     $csv_encode = '/\&\#44/';
-    if (isset($CFG->CSV_DELIMITER)) {        
+    if (isset($CFG->CSV_DELIMITER)) {
         $csv_delimiter = '\\' . $CFG->CSV_DELIMITER;
         $csv_delimiter2 = $CFG->CSV_DELIMITER;
 
     }
 
 /// Print the header
-
-    print_header("$course->shortname: $strimportgroups", $course->fullname, 
-                 "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> ".
-                 "-> <a href=\"$CFG->wwwroot/course/import.php?id=$course->id\">".get_string('import')."</a> ".
-                 "-> $strimportgroups");
+    $navlinks = array();
+    $navlinks[] = array('name' => $course->shortname,
+                        'link' => "$CFG->wwwroot/course/view.php?id=$course->id",
+                        'type' => 'misc');
+    $navlinks[] = array('name' => get_string('import'),
+                        'link' => "$CFG->wwwroot/course/import.php?id=$course->id",
+                        'type' => 'misc');
+    $navlinks[] = array('name' => $strimportgroups, 'link' => null, 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
+
+    print_header("$course->shortname: $strimportgroups", $course->fullname, $navigation);
 
 /// If a file has been uploaded, then process it
 
         // make arrays of valid fields for error checking
         $required = array("groupname" => 1, );
         $optionalDefaults = array("lang" => 1, );
-        $optional = array("coursename" => 1, 
+        $optional = array("coursename" => 1,
                           "idnumber" =>1,
                           "description" => 1,
                           "enrolmentkey" => 1,
                           "theme" => 1,
-                          "picture" => 1, 
+                          "picture" => 1,
                           "hidepicture" => 1, );
 
         // --- get header (field names) ---
@@ -78,8 +84,8 @@
         // check for valid field names
         foreach ($header as $i => $h) {
             $h = trim($h); $header[$i] = $h; // remove whitespace
-            if ( !(isset($required[$h]) or 
-                isset($optionalDefaults[$h]) or 
+            if ( !(isset($required[$h]) or
+                isset($optionalDefaults[$h]) or
                 isset($optional[$h])) ) {
                 error(get_string('invalidfieldname', 'error', $h), 'index.php?id='.$id.'&amp;sesskey='.$USER->sesskey);
             }
         $linenum = 2; // since header is line 1
 
         while (!feof ($fp)) {
-            
+
             $newgroup = new object();//to make Martin happy
             foreach ($optionalDefaults as $key => $value) {
                 $newgroup->$key = current_language(); //defaults to current language
                     if (isset($required[$name]) and !$value) {
                         error(get_string('missingfield', 'error', $name). " ".
                               get_string('erroronline', 'error', $linenum) .". ".
-                              get_string('processingstops', 'error'), 
+                              get_string('processingstops', 'error'),
                               'uploaduser.php?sesskey='.$USER->sesskey);
                     }
                     else if ($name == "groupname") {
                     }
                 }
                 ///Find the courseid of the course with the given shortname
-                
+
                 //if idnumber is set, we use that.
                 //unset invalid courseid
                 if (isset($newgroup->idnumber)){
                         notify(get_string('unknowncourseidnumber', 'error', $newgroup->idnumber));
                         unset($newgroup->courseid);//unset so 0 doesnt' get written to database
                     }
-                    $newgroup->courseid = $mycourse->id;        
+                    $newgroup->courseid = $mycourse->id;
                 }
                 //else use course short name to look up
                 //unset invalid coursename (if no id)
-                            
+
                 else if (isset($newgroup->coursename)){
                     if (!$mycourse = get_record('course', 'shortname',$newgroup->coursename)){
                         notify(get_string('unknowncourse', 'error', $newgroup->coursename));
                         unset($newgroup->courseid);//unset so 0 doesnt' get written to database
                     }
-                    $newgroup->courseid = $mycourse->id;    
+                    $newgroup->courseid = $mycourse->id;
                 }
                 //else juse use current id
                 else{
                     $newgroup->courseid = $id;
                 }
-                
+
                 //if courseid is set
                 if (isset($newgroup->courseid)){
 
                     $linenum++;
                     $groupname = $newgroup->name;
                     $newgrpcoursecontext = get_context_instance(CONTEXT_COURSE, $newgroup->courseid);
-                    
+
                     ///Users cannot upload groups in courses they cannot update.
                     if (!has_capability('moodle/course:managegroups', $newgrpcoursecontext)){
                         notify(get_string('nopermissionforcreation','group',$groupname));
 
                     } else {
                         if ( $groupid = groups_get_group_by_name($newgroup->courseid, $groupname) || !($newgroup->id = groups_create_group($newgroup)) ) {
-    
+
                             //Record not added - probably because group is already registered
                             //In this case, output groupname from previous registration
                             if ($groupid) {
                                 notify("$groupname :".get_string('groupexistforcourse', 'error', $groupname));
                             } else {
                                 notify(get_string('groupnotaddederror', 'error', $groupname));
-                            } 
-                        }  
+                            }
+                        }
                         else {
                             notify(get_string('groupaddedsuccesfully', 'group', $groupname));
                         }
index d182dde227ddbaf9d217855404ba1a88bcb58240..845cd51a1bb24e859cf6c811d49582dbef10b712 100644 (file)
@@ -45,8 +45,7 @@
 
     print_header("$course->shortname: $strassigncourses",
                  $site->fullname,
-                 "<a href=\"view.php?id=$course->id\">$course->shortname</a> -> $strassigncourses",
-                 "searchtext");
+                 build_navigation(array(array('name' => $strassigncourses, 'link' => null, 'type' => 'misc'))), "searchtext");
 
 
 /// Print a help notice about the need to use this page
index 5ab89eb36b7b72a8727ceacf5596a23d01868a0b..44ac487f933b27cd90893cfdf73901b55968963d 100644 (file)
@@ -15,7 +15,7 @@
     $moveto   = optional_param('moveto',-1,PARAM_INT);
     $moveup   = optional_param('moveup',0,PARAM_INT);
     $movedown = optional_param('movedown',0,PARAM_INT);
-    
+
     $context = get_context_instance(CONTEXT_SYSTEM, SITEID);
 
     if (!$site = get_site()) {
         if ($countcategories > 1 || ($countcategories == 1 && count_records('course') > 200)) {
             $strcourses = get_string('courses');
             $strcategories = get_string('categories');
-            print_header("$site->shortname: $strcategories", $strcourses, 
+            print_header("$site->shortname: $strcategories", build_navigation(array(array('name'=>$strcourses,'link'=>'','type'=>'misc'))),
                           $strcategories, '', '', true, update_categories_button());
             print_heading($strcategories);
             print_box_start('categorybox');
-            print_category_create_form();            
+            print_category_create_form();
             print_whole_category_list();
             print_box_end();
             print_course_search();
         } else {
             $strfulllistofcourses = get_string('fulllistofcourses');
-            print_header("$site->shortname: $strfulllistofcourses", $strfulllistofcourses, $strfulllistofcourses,
+            print_header("$site->shortname: $strfulllistofcourses", $strfulllistofcourses,
+                    build_navigation(array(array('name'=>$strfulllistofcourses, 'link'=>'','type'=>'misc'))),
                          '', '', true, update_categories_button());
             print_box_start('courseboxes');
             print_category_create_form();
@@ -89,7 +90,7 @@
             print_box_end();
         }
 
-        /// I am not sure this context in the next has_capability call is correct. 
+        /// I am not sure this context in the next has_capability call is correct.
         if (isloggedin() and !isguest() and !has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM, SITEID)) and $CFG->enablecourserequests) {  // Print link to request a new course
             print_single_button('request.php', NULL, get_string('courserequest'), 'get');
         }
 /// From now on is all the admin/course creator functions
 
 /// Print headings
-    
+
     if (has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
         require_once($CFG->libdir.'/adminlib.php');
-        admin_externalpage_setup('coursemgmt');    
+        admin_externalpage_setup('coursemgmt');
         admin_externalpage_print_header();
     } else {
-        print_header("$site->shortname: $strcategories", $strcourses, 
-                  $strcategories, '', '', true, update_categories_button());    
-    }      
-    
+        print_header("$site->shortname: $strcategories", build_navigation(array(array('name'=>$strcourses,'link'=>'','type'=>'misc'))),
+                  $strcategories, '', '', true, update_categories_button());
+    }
+
     print_heading($strcategories);
 
 /// Delete a category if necessary
 
     if (!empty($delete) and confirm_sesskey()) {
-          
+
           // context is coursecat, if not present admins should have it set in site level
-         $context = get_context_instance(CONTEXT_COURSECAT, $delete);        
+         $context = get_context_instance(CONTEXT_COURSECAT, $delete);
         if ($deletecat = get_record('course_categories', 'id', $delete) and has_capability('moodle/category:delete', $context)) {
             if (!empty($sure) && $sure == md5($deletecat->timemodified)) {
                 /// Send the children categories to live with their grandparent
                         }
                     }
                 }
-                
-                ///  If the grandparent is a valid (non-zero) category, then 
+
+                ///  If the grandparent is a valid (non-zero) category, then
                 ///  send the children courses to live with their grandparent as well
                 if ($deletecat->parent) {
                     if ($childcourses = get_records('course', 'category', $deletecat->id)) {
                         }
                     }
                 }
-                
+
                 /// Finally delete the category itself
                 if (delete_records('course_categories', 'id', $deletecat->id)) {
                     notify(get_string('categorydeleted', '', format_string($deletecat->name)));
                     // MLD-9983
                     events_trigger('category_deleted', $deletecat);
-                }             
+                }
             }
             else {
                 $strdeletecategorycheck = get_string('deletecategorycheck','', format_string($deletecat->name));
                              "index.php?delete=$delete&amp;sure=".md5($deletecat->timemodified)."&amp;sesskey=$USER->sesskey",
                              "index.php?sesskey=$USER->sesskey");
 
-                print_footer();  
+                print_footer();
                 exit();
             }
         }
                 if (! set_field('course_categories', 'parent', $moveto, 'id', $tempcat->id)) {
                     notify('Could not update that category!');
                 } else {
-                    rebuild_context_rel(get_context_instance(CONTEXT_COURSECAT, $move)); 
-                }            
+                    rebuild_context_rel(get_context_instance(CONTEXT_COURSECAT, $move));
+                }
             }
         }
     }
 
 
-/// Hide or show a category 
+/// Hide or show a category
     if ((!empty($hide) or !empty($show)) and confirm_sesskey()) {
         if (!empty($hide)) {
             $tempcat = get_record('course_categories', 'id', $hide);
 /// Move a category up or down
 
     if ((!empty($moveup) or !empty($movedown)) and confirm_sesskey()) {
-        
+
         $swapcategory = NULL;
         $movecategory = NULL;
 
             }
         }
     }
-    
+
     fix_course_sortorder();
 
 /// Print form for creating new categories
-    
+
     if (has_capability('moodle/category:create', get_context_instance(CONTEXT_SYSTEM))) {
         $mform->display();
     }
         $options['category'] = $category->id;
         print_single_button('edit.php', $options, get_string('addnewcourse'), 'get');
     }
-    
+
     if (has_capability('moodle/site:approvecourse', get_context_instance(CONTEXT_SYSTEM, SITEID))  and !empty($CFG->enablecourserequests)) {
         print_single_button('pending.php',NULL, get_string('coursespending'), 'get');
     }
@@ -341,7 +342,7 @@ function print_category_edit($category, $displaylist, $parentslist, $depth=-1, $
     global $CFG, $USER;
 
     static $str = '';
-    
+
     if (empty($str)) {
         $str->delete   = get_string('delete');
         $str->moveup   = get_string('moveup');
@@ -350,11 +351,11 @@ function print_category_edit($category, $displaylist, $parentslist, $depth=-1, $
         $str->hide     = get_string('hide');
         $str->show     = get_string('show');
     }
-    
+
     if ($category) {
 
         $context  = get_context_instance(CONTEXT_COURSECAT, $category->id);
-          
+
         echo '<tr><td align="left" class="name">';
         for ($i=0; $i<$depth;$i++) {
             echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
@@ -373,7 +374,7 @@ function print_category_edit($category, $displaylist, $parentslist, $depth=-1, $
             echo '<a title="'.$str->delete.'" href="index.php?delete='.$category->id.'&amp;sesskey='.sesskey().'"><img'.
                  ' src="'.$CFG->pixpath.'/t/delete.gif" class="iconsmall" alt="'.$str->delete.'" /></a> ';
         }
-        
+
         if (has_capability('moodle/category:visibility', $context)) {
             if (!empty($category->visible)) {
                 echo '<a title="'.$str->hide.'" href="index.php?hide='.$category->id.'&amp;sesskey='.sesskey().'"><img'.
@@ -423,7 +424,7 @@ function print_category_edit($category, $displaylist, $parentslist, $depth=-1, $
             $down = $last ? false : true;
             $first = false;
 
-            print_category_edit($cat, $displaylist, $parentslist, $depth+1, $up, $down);         
+            print_category_edit($cat, $displaylist, $parentslist, $depth+1, $up, $down);
         }
     }
 }
index 173121c34ea6991a1390935090352c108a35cc84..1a1b7bac2c1a497227005a0384ded73acec26560 100644 (file)
@@ -11,7 +11,7 @@
         if (!confirm_sesskey()) {
             print_error('confirmsesskeybad');
         }
-        
+
         $USER = get_complete_user_data('id', $USER->realuser);
         load_all_capabilities();   // load all this user's normal capabilities
 
@@ -40,7 +40,7 @@
     if (!confirm_sesskey()) {
         print_error('confirmsesskeybad');
     }
-    
+
     if (! $course = get_record('course', 'id', $id)) {
         error("Course ID was incorrect");
     }
@@ -97,7 +97,8 @@
     $strloginas    = get_string('loginas');
     $strloggedinas = get_string('loggedinas', '', $newfullname);
 
-    print_header_simple($strloggedinas, '', $strloggedinas, '', '', true, '&nbsp;', navmenu($course));
+    print_header_simple($strloggedinas, '', build_navigation(array(array('name'=>$strloggedinas, 'link'=>'','type'=>'misc'))),
+            '', '', true, '&nbsp;', navmenu($course));
     notice($strloggedinas, "$CFG->wwwroot/course/view.php?id=$course->id");
 
 
index 828da8efcbbc5746b585d39904777284855e3c25..89968269c0e4ad5ccb43400330b9b12bf0ff4fd0 100644 (file)
 
         $CFG->pagepath = 'mod/'.$module->name.'/delete';
 
-        print_header_simple($strdeletecheck, '', $strdeletecheck);
+        print_header_simple($strdeletecheck, '', build_navigation(array(array('name'=>$strdeletecheck,'link'=>'','type'=>'misc'))));
 
         print_simple_box_start('center', '60%', '#FFAAAA', 20, 'noticebox');
         print_heading($strdeletecheckfull);
         } else {
             $pageheading = get_string("addinganew", "moodle", $fullmodulename);
         }
-        
+
         $CFG->pagepath = 'mod/'.$module->name;
         if (!empty($type)) {
             $CFG->pagepath .= '/' . $type;
     } else {
         $focuscursor = "form.name";
     }
-    
+
     $navlinks = array();
     $navlinks[] = array('name' => $strmodulenameplural, 'link' => "$CFG->wwwroot/mod/$module->name/index.php?id=$course->id", 'type' => 'activity');
     $navlinks[] = array('name' => $streditinga, 'link' => '', 'type' => 'action');
     $navigation = build_navigation($navlinks);
-    
+
     print_header_simple($streditinga, '', $navigation, $focuscursor, "", false);
 
     if (!empty($cm->id)) {
index 0f865386a8f2201400245f96f676e1a599c3934d..cee06ed43306f2324ac4ff68dfa637074febe8f6 100644 (file)
@@ -3,7 +3,7 @@
 
     require_once('../config.php');
     require_once($CFG->libdir.'/pagelib.php');
-    require_once($CFG->libdir.'/blocklib.php'); 
+    require_once($CFG->libdir.'/blocklib.php');
     require_once('lib.php');
 
     require_login();
             }
         }
     }
+
     $strtitle = get_string('coursespending');
     $strheading = get_string(((!empty($reject)) ? 'coursereject' : 'coursespending'));
 
-    print_header($strtitle,$strheading,$strheading);
+    print_header($strtitle,$strheading,build_navigation(array(array('name'=>$strheading,'link'=>'','type'=>'misc'))));
+
     if (!empty($reject) and confirm_sesskey()) {
         if ($reject = get_record("course_request","id",$reject)) {
             if (empty($rejectnotice)) {
                 $collision = 1;
             }
             //do not output raw html from request, quote html entities using s()!!
-            $table->data[] = array(((!empty($course->password)) ? 
+            $table->data[] = array(((!empty($course->password)) ?
                                     '<img hspace="1" alt="'.$strrequireskey.'" class="icon" src="'.$CFG->pixpath.'/i/key.gif" />' : ''),
                                    format_string($course->shortname),format_string($course->fullname),fullname($requester),
                                    format_string($course->summary),format_string($course->reason),
index af2f60f1aeda72f8eac947a2f0f29208ed447b8e..b909b0af650286ba3af7c1d60540855cb669c7f4 100644 (file)
@@ -28,7 +28,7 @@
     $meta = '<meta name="robots" content="none" />'; // prevent duplicate content in search engines MDL-7299
 
     $loggedinas = user_login_string($course, $USER);
-
+    $navlinks = array();
 
     if (!empty($chooserecent)) {
         $userinfo = get_string("allparticipants");
         if ($date)
             $dateinfo = userdate($date, get_string("strftimedaydate"));
 
-        if ($course->id != SITEID) {
-            print_header("$course->shortname: $strrecentactivity", $course->fullname,
-                         "<a href=\"view.php?id=$course->id\">$course->shortname</a> ->
-                          <a href=\"recent.php?id=$course->id\">$strrecentactivity</a> -> $userinfo, $dateinfo", "", $meta);
-        } else {
-            print_header("$course->shortname: $strrecentactivity", $course->fullname,
-                         "<a href=\"recent.php?id=$course->id\">$strrecentactivity</a> -> $userinfo, $dateinfo", "", $meta);
-        }
+        $navlinks[] = array('name' => $strrecentactivity, 'link' => "recent.php?id=$course->id", 'type' => 'misc');
+        $navlinks[] = array('name' => "$userinfo, $dateinfo", 'link' => null, 'type' => 'misc');
+        $navigation = build_navigation($navlinks);
+        print_header("$course->shortname: $strrecentactivity", $course->fullname, $navigation, "", $meta);
 
         print_heading(format_string($course->fullname) . ": $userinfo, $dateinfo (".usertimezone().")", '', 3);
         $advancedfilter = 1;
                 }
             }
         }
-
-        if ($course->id != SITEID) {
-            print_header("$course->shortname: $strrecentactivity", $course->fullname,
-                     "<a href=\"view.php?id=$course->id\">$course->shortname</a> -> $strrecentactivity", "", $meta);
-        } else {
-            print_header("$course->shortname: $strrecentactivity", $course->fullname,
-                     "$strrecentactivity", "", $meta);
-        }
+        $navlinks[] = array('name' => $strrecentactivity, 'link' => null, 'type' => 'misc');
+        $navigation = build_navigation($navlinks);
+        print_header("$course->shortname: $strrecentactivity", $course->fullname, $navigation, "", $meta);
 
         print_heading(get_string("activitysince", "", userdate($date)));
 
index 5954b3f597a4dbb2226ec6be16416aff0d444bbf..515e0bb5d4d8d0e786859419441f601ce4fc020f 100644 (file)
 
     $strreports = get_string('reports');
 
-    print_header($course->fullname.': '.$strreports, $course->fullname.': '.$strreports, 
-                 '<a href="view.php?id='.$course->id.'">'.$course->shortname.'</a> -> '.$strreports);
+    $navlinks = array();
+    $navlinks[] = array('name' => $strreports, 'link' => null, 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
+    print_header($course->fullname.': '.$strreports, $course->fullname.': '.$strreports, $navigation);
 
     $directories = get_list_of_plugins('course/report');
 
@@ -29,6 +31,6 @@
             echo '</div>';
         }
     }
-    
+
     print_footer();
 ?>
index a2dcc54f2942b42185285e936d4cd859fc0c973a..96bb6e5d6c35a656b85415a4de1016ffda1d8626 100644 (file)
@@ -7,9 +7,9 @@
     require_once($CFG->libdir.'/adminlib.php');
 
     $id          = optional_param('id', 0, PARAM_INT);// Course ID
-    
+
     $host_course = optional_param('host_course', '', PARAM_PATH);// Course ID
-    
+
     if (empty($host_course)) {
         $hostid = $CFG->mnet_localhost_id;
         if (empty($id)) {
@@ -19,7 +19,7 @@
     } else {
         list($hostid, $id) = explode('/', $host_course);
     }
-    
+
     $group       = optional_param('group', -1, PARAM_INT); // Group to display
     $user        = optional_param('user', 0, PARAM_INT); // User to display
     $date        = optional_param('date', 0, PARAM_FILE); // Date to display - number or some string
@@ -27,7 +27,7 @@
     $modid       = optional_param('modid', 0, PARAM_FILE); // number or 'site_errors'
     $modaction   = optional_param('modaction', '', PARAM_PATH); // an action as recorded in the logs
     $page        = optional_param('page', '0', PARAM_INT);     // which page to show
-    $perpage     = optional_param('perpage', '100', PARAM_INT); // how many per page 
+    $perpage     = optional_param('perpage', '100', PARAM_INT); // how many per page
     $showcourses = optional_param('showcourses', 0, PARAM_INT); // whether to show courses if we're over our limit.
     $showusers   = optional_param('showusers', 0, PARAM_INT); // whether to show users if we're over our limit.
     $chooselog   = optional_param('chooselog', 0, PARAM_INT);
@@ -50,7 +50,7 @@
 
     require_capability('moodle/site:viewreports', $context);
 
-    add_to_log($course->id, "course", "report log", "report/log/index.php?id=$course->id", $course->id); 
+    add_to_log($course->id, "course", "report log", "report/log/index.php?id=$course->id", $course->id);
 
     $strlogs = get_string('logs');
     $stradministration = get_string('administration');
@@ -58,6 +58,8 @@
 
     session_write_close();
 
+    $navlinks = array();
+
     if (!empty($chooselog)) {
         $userinfo = get_string('allparticipants');
         $dateinfo = get_string('alldays');
                     admin_externalpage_print_header();
 
                 } else {
-                    print_header($course->shortname .': '. $strlogs, $course->fullname, 
-                                 "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> ->
-                                  <a href=\"$CFG->wwwroot/course/report.php?id=$course->id\">$strreports</a> ->
-                                  <a href=\"index.php?id=$course->id\">$strlogs</a> -> $userinfo, $dateinfo", '');
+                    $navlinks[] = array('name' => $strreports, 'link' => "$CFG->wwwroot/course/report.php?id=$course->id", 'type' => 'misc');
+                    $navlinks[] = array('name' => $strlogs, 'link' => "index.php?id=$course->id", 'type' => 'misc');
+                    $navlinks[] = array('name' => "$userinfo, $dateinfo", 'link' => null, 'type' => 'misc');
+                    $navigation = build_navigation($navlinks);
+                    print_header($course->shortname .': '. $strlogs, $course->fullname, $navigation '');
                 }
 
                 print_heading(format_string($course->fullname) . ": $userinfo, $dateinfo (".usertimezone().")");
                 print_mnet_log_selector_form($hostid, $course, $user, $date, $modname, $modid, $modaction, $group, $showcourses, $showusers, $logformat);
-                
+
                 if($hostid == $CFG->mnet_localhost_id) {
-                    print_log($course, $user, $date, 'l.time DESC', $page, $perpage, 
-                            "index.php?id=$course->id&amp;chooselog=1&amp;user=$user&amp;date=$date&amp;modid=$modid&amp;modaction=$modaction&amp;group=$group", 
+                    print_log($course, $user, $date, 'l.time DESC', $page, $perpage,
+                            "index.php?id=$course->id&amp;chooselog=1&amp;user=$user&amp;date=$date&amp;modid=$modid&amp;modaction=$modaction&amp;group=$group",
                             $modname, $modid, $modaction, $group);
                 } else {
                     print_mnet_log($hostid, $id, $user, $date, 'l.time DESC', $page, $perpage, "", $modname, $modid, $modaction, $group);
                     admin_externalpage_setup('reportlog');
                     admin_externalpage_print_header();
         } else {
-            print_header($course->shortname .': '. $strlogs, $course->fullname, 
-                     "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> -> 
-                      <a href=\"$CFG->wwwroot/course/report.php?id=$course->id\">$strreports</a> ->
-                      $strlogs", '');
+            $navlinks[] = array('name' => $strreports, 'link' => "$CFG->wwwroot/course/report.php?id=$course->id", 'type' => 'misc');
+            $navlinks[] = array('name' => $strlogs, 'link' => null, 'type' => 'misc');
+            $navigation = build_navigation($navlinks);
+            print_header($course->shortname .': '. $strlogs, $course->fullname, $navigation, '');
         }
 
         print_heading(get_string('chooselogs') .':');
index 99c5461bd5b69032d2e8305db42733b31bc009d1..784d589fcc36a10bfe46505fd65d2116bbcda3e9 100644 (file)
@@ -19,7 +19,7 @@
 
     require_capability('moodle/site:viewreports', get_context_instance(CONTEXT_COURSE, $course->id));
 
-    add_to_log($course->id, "course", "report outline", "report/outline/index.php?id=$course->id", $course->id); 
+    add_to_log($course->id, "course", "report outline", "report/outline/index.php?id=$course->id", $course->id);
 
     $stractivityreport = get_string("activityreport");
     $strparticipants   = get_string("participants");
     $strtodaylogs      = get_string("todaylogs");
     $strreports        = get_string("reports");
 
-    print_header("$course->shortname: $stractivityreport", $course->fullname,
-                 "<a href=\"../../view.php?id=$course->id\">$course->shortname</a> ->
-                  <a href=\"../../report.php?id=$course->id\">$strreports</a> ->
-                  $stractivityreport");
+    $navlinks = array();
+    $navlinks[] = array('name' => $strreports, 'link' => "../../report.php?id=$course->id", 'type' => 'misc');
+    $navlinks[] = array('name' => $stractivityreport, 'link' => null, 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
+
+    print_header("$course->shortname: $stractivityreport", $course->fullname, $navigation);
 
     print_heading(format_string($course->fullname));
 
index 9baf30c0fe9e8b31ee6697fdfedc233436b8e19b..cf4339d890c29e8af1729460875fed4485c5d001 100644 (file)
@@ -2,10 +2,10 @@
 
     require_once('../../../config.php');
     require_once($CFG->libdir.'/statslib.php');
-    
+
     define('DEFAULT_PAGE_SIZE', 20);
     define('SHOW_ALL_PAGE_SIZE', 5000);
-    
+
     $id         = required_param('id', PARAM_INT); // course id.
     $moduleid   = optional_param('moduleid', 0, PARAM_INT); // module id.
     $oldmod     = optional_param('oldmod', 0, PARAM_INT);
@@ -16,7 +16,7 @@
     $page       = optional_param('page', 0, PARAM_INT);                     // which page to show
     $perpage    = optional_param('perpage', DEFAULT_PAGE_SIZE, PARAM_INT);  // how many per page
 
-    if ($action != 'view' && $action != 'post') { 
+    if ($action != 'view' && $action != 'post') {
         $action = ''; // default to all (don't restrict)
     }
 
 
     require_login($course->id);
     $context = get_context_instance(CONTEXT_COURSE, $course->id);
-    
+
     if (!has_capability('moodle/site:viewreports', $context)) {
         print_error('mustbeteacher', '', $CFG->wwwroot.'/course/view.php?id='.$course->id);
     }
-    
 
-    add_to_log($course->id, "course", "report participation", "report/participation/index.php?id=$course->id", $course->id); 
-    
+
+    add_to_log($course->id, "course", "report participation", "report/participation/index.php?id=$course->id", $course->id);
+
     $strparticipation = get_string('participationreport');
     $strviews         = get_string('views');
     $strposts         = get_string('posts');
     $strallactions    = get_string('allactions');
     $strreports       = get_string('reports');
 
-    $strnav = "<a href=\"../../view.php?id=$course->id\">" . format_string($course->shortname) . "</a> -> 
-               <a href=\"../../report.php?id=$course->id\">$strreports</a> -> ". $strparticipation;
-    
-    print_header("$course->shortname: $strparticipation", $course->fullname,
-                 "<a href=\"../../view.php?id=$course->id\">$course->shortname</a> ->
-                  <a href=\"../../report.php?id=$course->id\">$strreports</a> ->
-                  $strparticipation");
-
-//    print_header($course->fullname.' '.$strparticipation,$strparticipation,$strnav);
+    $navlinks = array();
+    $navlinks[] = array('name' => $strreports, 'link' => "../../report.php?id=$course->id", 'type' => 'misc');
+    $navlinks[] = array('name' => $strparticipation, 'link' => null, 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
+    print_header("$course->shortname: $strparticipation", $course->fullname, $navigation);
 
     $allowedmodules = array('assignment','book','chat','choice','exercise','forum','glossary','hotpot',
                             'journal','lesson','questionnaire','quiz','resource','scorm',
@@ -96,7 +92,7 @@
             $timeoptions[strtotime('-'.$i.' weeks',$now)] = get_string('numweeks','moodle',$i);
         }
     }
-    // months 
+    // months
     for ($i = 2; $i < 12; $i++) {
         if (strtotime('-'.$i.' months',$now) >= $minlog) {
             $timeoptions[strtotime('-'.$i.' months',$now)] = get_string('nummonths','moodle',$i);
                            'view' => $strview,
                            'post' => $strpost,
                            );
-    
-    
+
+
     // print first controls.
     echo '<form class="participationselectform" action="index.php" method="get"><div>'."\n".
          '<input type="hidden" name="id" value="'.$course->id.'" />'."\n".
         print_footer();
         exit;
     }
-    
+
     $baseurl =  $CFG->wwwroot.'/course/report/participation/index.php?id='.$course->id.'&amp;roleid='
         .$roleid.'&amp;instanceid='.$instanceid.'&amp;timefrom='.$timefrom.'&amp;moduleid='
         .$moduleid.'&amp;action='.$action.'&amp;perpage='.$perpage;
     if (!$instances = get_all_instances_in_course($module->name,$course)) {
         error(get_string('noinstances','error',$modulename));
     }
-    
+
     $instanceoptions = array();
-    
+
     foreach ($instances as $instance) {
         $instanceoptions[$instance->id] = $instance->name;
     }
-    
+
     if (count($instanceoptions) == 1) { // just display it if there's only one.
         $instanceid = array_pop(array_keys($instanceoptions));
     }
     echo '<input type="submit" value="'.get_string('go').'" />'."\n".
         '</div>'."\n".
         "</form>\n";
-        
+
     if (!empty($instanceid) && !empty($roleid)) {
         if (!$cm = get_coursemodule_from_instance($module->name,$instanceid,$course->id)) {
             print_error('cmunknown');
         $table->set_attribute('class', 'generaltable generalbox reporttable');
 
         $table->sortable(true,'lastname','ASC');
-        
+
         $table->set_control_variables(array(
                                             TABLE_VAR_SORT    => 'ssort',
                                             TABLE_VAR_HIDE    => 'shide',
                                             TABLE_VAR_PAGE    => 'spage'
                                             ));
         $table->setup();
-        
+
 
         $primary_roles = sql_primary_role_subselect();   // In dmllib.php
         $sql = 'SELECT DISTINCT prs.userid, u.firstname,u.lastname,u.idnumber,count(l.action) as count FROM ('.$primary_roles.') prs'
                 break;
             default:
                 // some modules have stuff we want to hide, ie mail blocked etc so do actually need to limit here.
-                $sql .= ' AND action IN (\''.implode('\',\'',array_merge($viewnames,$postnames)).'\' )'; 
+                $sql .= ' AND action IN (\''.implode('\',\'',array_merge($viewnames,$postnames)).'\' )';
 
         }
-        
+
         $sql .= ' WHERE prs.courseid = '.$course->id.' AND prs.primary_roleid = '.$roleid.' AND prs.contextlevel = '.CONTEXT_COURSE.' AND prs.courseid = '.$course->id;
-        
+
         if ($table->get_sql_where()) {
-            $sql .= ' AND '.$table->get_sql_where(); //initial bar 
+            $sql .= ' AND '.$table->get_sql_where(); //initial bar
         }
 
         $sql .= ' GROUP BY prs.userid,u.firstname,u.lastname,u.idnumber,l.userid';
         }
 
         $countsql = 'SELECT COUNT(DISTINCT(prs.userid)) FROM ('.$primary_roles.') prs '
-            .' JOIN '.$CFG->prefix.'user u ON u.id = prs.userid WHERE prs.courseid = '.$course->id 
+            .' JOIN '.$CFG->prefix.'user u ON u.id = prs.userid WHERE prs.courseid = '.$course->id
             .' AND prs.primary_roleid = '.$roleid.' AND prs.contextlevel = '.CONTEXT_COURSE;
-        
+
         $totalcount = count_records_sql($countsql);
 
         if ($table->get_sql_where()) {
         } else {
             $matchcount = $totalcount;
         }
-        
+
         echo '<div id="participationreport">' . "\n";
         echo '<p class="modulename">'.$modulename . ' ' . $strviews.': '.implode(', ',$viewnames).'<br />'."\n"
             . $modulename . ' ' . $strposts.': '.implode(', ',$postnames).'</p>'."\n";
+
         $table->initialbars($totalcount > $perpage);
         $table->pagesize($perpage, $matchcount);
 
         }
 
         $data = array();
-        
+
         $a->count = $totalcount;
         $a->items = $role->name;
-        
+
         if ($matchcount != $totalcount) {
             $a->items .= ' ('.get_string('matched').' '.$matchcount.')';
         }
-        
+
         echo '<h2>'.get_string('counteditems', '', $a).'</h2>'."\n";
         echo '
 <script type="text/javascript">
@@ -346,7 +342,7 @@ function checknos() {
         else if ($matchcount > 0 && $perpage < $matchcount) {
             echo '<div id="showall"><a href="'.$baseurl.'&amp;perpage='.SHOW_ALL_PAGE_SIZE.'">'.get_string('showall', '', $matchcount).'</a></div>'."\n";
         }
-    
+
         echo '<input type="button" onclick="checkall()" value="'.get_string('selectall').'" /> '."\n";
         echo '<input type="button" onclick="checknone()" value="'.get_string('deselectall').'" /> '."\n";
         if ($perpage >= $matchcount) {
@@ -361,7 +357,7 @@ function checknos() {
         echo '</div>'."\n";
 
     }
-    
+
     print_footer();
 
 ?>
index f4a5292faf8fa7ee0e0b8dac5f59a168ac3e586b..9dcd3151b80c7e831ea629dbc036f6b01c8669d7 100644 (file)
 
     require_login($course->id);
     $context = get_context_instance(CONTEXT_COURSE, $course->id);
-    
+
     if (!has_capability('moodle/site:viewreports', $context)) {
         error('You need do not have the required permission to view reports for this course');
     }
 
-    add_to_log($course->id, "course", "report stats", "report/stats/index.php?course=$course->id", $course->id); 
+    add_to_log($course->id, "course", "report stats", "report/stats/index.php?course=$course->id", $course->id);
     stats_check_uptodate($course->id);
-    
-    
+
+
     $strreports = get_string("reports");
     $strstats = get_string('stats');
 
     $menu = report_stats_mode_menu($course, $mode, $time, "$CFG->wwwroot/course/report/stats/index.php");
 
-    $crumb = "<a href=\"../../view.php?id=$course->id\">" . format_string($course->shortname) . "</a> ->
-              <a href=\"../../report.php?id=$course->id\">$strreports</a> ->
-              $strstats";
+    $navlinks = array();
+    $navlinks[] = array('name' => $strreports, 'link' => "../../report.php?id=$course->id", 'type' => 'misc');
+    $navlinks[] = array('name' => $strstats, 'link' => null, 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
+
+    print_header("$course->shortname: $strstats", $course->fullname, $navigation, '', '', true, '&nbsp;', $menu);
+
 
-    print_header("$course->shortname: $strstats", $course->fullname, 
-                  $crumb, '', '', true, '&nbsp;', $menu);
-    
-    
     require_once($CFG->dirroot.'/course/report/stats/report.php');
-    
+
     print_footer();
 
 ?>
index 4858759f8f7b0ebfcaa5c6400e57ea662e46b856..9af3d0ced372b30ee35c3092a5eff5914ffcf03f 100644 (file)
     $requestform = new course_request_form();
 
     $strtitle = get_string('courserequest');
-    print_header($strtitle, $strtitle, $strtitle, $requestform->focus());
+    $navlinks = array();
+    $navlinks[] = array('name' => $strtitle, 'link' => null, 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
+
+    print_header($strtitle, $strtitle, $navigation, $requestform->focus());
 
     print_simple_box_start('center');
     print_string('courserequestintro');
index d4ba990d4ed7c5ef16341738e9727ceaa9337572..b9bd1a56611ba2526e5212f4baa1199469ab698a 100755 (executable)
@@ -1,10 +1,10 @@
 <?php  // $Id$
 /*
 resetcourse.php  - Mark Flach and moodle.com
-The purpose of this feature is to quickly remove all user related data from a course 
-in order to make it available for a new semester.  This feature can handle the removal 
-of general course data like students, teachers, logs, events and groups as well as module 
-specific data.  Each module must be modified to take advantage of this new feature.  
+The purpose of this feature is to quickly remove all user related data from a course
+in order to make it available for a new semester.  This feature can handle the removal
+of general course data like students, teachers, logs, events and groups as well as module
+specific data.  Each module must be modified to take advantage of this new feature.
 The feature will also reset the start date of the course if necessary.
 */
     require('../config.php');
@@ -23,9 +23,12 @@ The feature will also reset the start date of the course if necessary.
     $strresetcourse = get_string('resetcourse');
     $strremove = get_string('remove');
 
-    print_header($course->fullname.': '.$strresetcourse, $course->fullname.': '.$strresetcourse, 
-                 '<a href="view.php?id='.$course->id.'">'.$course->shortname.'</a> -> '.$strresetcourse);
-    
+    $navlinks = array();
+    $navlinks[] = array('name' => $strresetcourse, 'link' => null, 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
+
+    print_header($course->fullname.': '.$strresetcourse, $course->fullname.': '.$strresetcourse, $navigation);
+
     print_simple_box_start();
 
     print_heading($strresetcourse);
@@ -38,8 +41,8 @@ The feature will also reset the start date of the course if necessary.
         reset_course_userdata($data, true);
 
         if (!empty($data->reset_start_date)) {
-            if (set_field('course', 'startdate', 
-                             make_timestamp($data->startyear, $data->startmonth, $data->startday), 
+            if (set_field('course', 'startdate',
+                             make_timestamp($data->startyear, $data->startmonth, $data->startday),
                              'id', $course->id)) {
                 notify(get_string('datechanged'), 'notifysuccess');
             }
@@ -67,7 +70,7 @@ The feature will also reset the start date of the course if necessary.
     print_checkbox('reset_events', 1, true, get_string('courseevents', 'calendar'), '', '');  echo '<br />';
     print_checkbox('reset_logs', 1, true, get_string('logs'), '', '');  echo '<br />';
     print_checkbox('reset_groups', 1, true, get_string('groups'), '', '');  echo '<br />';
-    print_checkbox('reset_start_date', 1, true, get_string('startdate'), '', ''); 
+    print_checkbox('reset_start_date', 1, true, get_string('startdate'), '', '');
     print_date_selector('startday', 'startmonth', 'startyear');
     helpbutton('coursestartdate', get_string('startdate'));
     echo '</div>';
@@ -78,7 +81,7 @@ The feature will also reset the start date of the course if necessary.
         foreach ($allmods as $mod) {
             $modname = $mod->name;
             $modfile = $CFG->dirroot .'/mod/'. $modname .'/lib.php';
-            $mod_reset_course_form = $modname .'_reset_course_form'; 
+            $mod_reset_course_form = $modname .'_reset_course_form';
             if (file_exists($modfile)) {
                 @include_once($modfile);
                 if (function_exists($mod_reset_course_form)) {
@@ -92,12 +95,12 @@ The feature will also reset the start date of the course if necessary.
     } else {
         error('No modules are installed!');
     }
-    
+
     echo '<input name="id" value="'.$course->id.'" type="hidden" />';
     echo '<input name="sesskey" value="'.sesskey().'" type="hidden" />';
     echo '<p align="center"><input name="submit" value="'.$strresetcourse.'" type="submit" /></p>';
     echo '</form>';
-    
+
     print_simple_box_end();
     print_footer($course);
 
index 500721dd9af04f93db0927af8c03b1c89e20cd3d..2434915c2a4bb656c8337195e0dcd15613337670 100644 (file)
@@ -41,7 +41,7 @@
             // modes, set page to 0.
             $page = 0;
         }
-    } 
+    }
 
 /// Editing functions
 
     $strnovalidcourses = get_string('novalidcourses');
 
     if (empty($search) and empty($blocklist) and empty($modulelist)) {
-        print_header("$site->fullname : $strsearch", $site->fullname, 
-                     "<a href=\"index.php\">$strcourses</a> -> $strsearch", "", "");
+        $navlinks = array();
+        $navlinks[] = array('name' => $strcourses, 'link' => "index.php", 'type' => 'misc');
+        $navlinks[] = array('name' => $strsearch, 'link' => null, 'type' => 'misc');
+        $navigation = build_navigation($navlinks);
+
+        print_header("$site->fullname : $strsearch", $site->fullname, $navigation, "", "");
         print_simple_box_start("center");
         echo "<center>";
         echo "<br />";
     }
 
     if (!empty($moveto) and $data = data_submitted() and confirm_sesskey()) {   // Some courses are being moved
-    
+
         if (! $destcategory = get_record("course_categories", "id", $data->moveto)) {
             error("Error finding the category");
         }
-        
-        $courses = array();        
+
+        $courses = array();
         foreach ( $data as $key => $value ) {
             if (preg_match('/^c\d+$/', $key)) {
                 array_push($courses, substr($key, 1));
         $totalcount = count($courses);
     }
     else {
-        $courses = get_courses_search($searchterms, "fullname ASC", 
+        $courses = get_courses_search($searchterms, "fullname ASC",
             $page*$perpage, $perpage, $totalcount);
     }
 
     if (!empty($courses) && has_capability('moodle/course:create', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
         $searchform .= update_categories_search_button($search,$page,$perpage);
     }
 
-    print_header("$site->fullname : $strsearchresults", $site->fullname, 
+
+    print_header("$site->fullname : $strsearchresults", $site->fullname,
                  "<a href=\"index.php\">$strcourses</a> -> <a href=\"search.php\">$strsearch</a> -> '".s($search, true)."'", "", "", "", $searchform);
 
 
             echo "<a href=\"search.php?search=$encodedsearch&perpage=99999\">".get_string("showall", "", $totalcount)."</a>";
             echo "</p></center>";
         }
-        
+
         if (!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))) {
             foreach ($courses as $course) {
                 $course->fullname = highlight("$search", $course->fullname);
                 }
 
                 echo "<tr>\n";
-                echo "<td><a $linkcss href=\"view.php?id=$course->id\">" 
+                echo "<td><a $linkcss href=\"view.php?id=$course->id\">"
                     . format_string($course->fullname) . "</a></td>\n";
                 echo "<td>".$displaylist[$course->category]."</td>\n";
                 echo "<td>\n";
-                
+
                 // this is ok since this will get inherited from course category context
                 // if it is set
                 if (has_capability('moodle/category:update', $coursecontext)) {
                 } else {
                     echo "<input type=\"checkbox\" name=\"c$course->id\" disabled=\"disabled\" />\n";
                 }
-                
+
                 echo "</td>\n";
                 echo "<td>\n";
                 $pixpath = $CFG->pixpath;
-                
+
                 // checks whether user can update course settings
                 if (has_capability('moodle/course:update', $coursecontext)) {
                     echo "<a title=\"".get_string("settings")."\" href=\"$CFG->wwwroot/course/edit.php?id=$course->id\">\n<img".
                 if (has_capability('moodle/role:assign', $coursecontext)) {
                     echo'<a title="'.get_string('assignroles', 'role').'" href="'.$CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$coursecontext->id.'">';
                     echo '<img src="'.$CFG->pixpath.'/i/roles.gif" class="iconsmall" alt="'.get_string('assignroles', 'role').'" /></a> ' . "\n";
-                }                
+                }
 
                 // checks whether user can delete course
-                if (has_capability('moodle/course:delete', $coursecontext)) {  
+                if (has_capability('moodle/course:delete', $coursecontext)) {
                     echo "<a title=\"".get_string("delete")."\" href=\"delete.php?id=$course->id\">\n<img".
                         " src=\"$pixpath/t/delete.gif\" class=\"iconsmall\" alt=\"".get_string("delete")."\" /></a>\n ";
-                }  
+                }
 
                 // checks whether user can change visibility
                 if (has_capability('moodle/course:visibility', $coursecontext)) {
                         echo "<a title=\"".get_string("show")."\" href=\"search.php?search=$encodedsearch&amp;perpage=$perpage&amp;page=$page&amp;show=$course->id&amp;sesskey=$USER->sesskey\">\n<img".
                             " src=\"$pixpath/t/show.gif\" class=\"iconsmall\" alt=\"".get_string("show")."\" /></a>\n ";
                     }
-                }              
+                }
 
                 // checks whether user can do site backup
                 if (has_capability('moodle/site:backup', $coursecontext)) {
                     echo "<a title=\"".get_string("backup")."\" href=\"../backup/backup.php?id=$course->id\">\n<img".
                         " src=\"$pixpath/t/backup.gif\" class=\"iconsmall\" alt=\"".get_string("backup")."\" /></a>\n ";
                 }
-                
+
                 // checks whether user can do restore
                 if (has_capability('moodle/site:restore', $coursecontext)) {
                     echo "<a title=\"".get_string("restore")."\" href=\"../files/index.php?id=$course->id&amp;wdir=/backupdata\">\n<img".
index e007e88cc39d39bad27e2b464e260d5ae992eb18..d2b4446f48f06e03a2acc8c9d325c84c5f1901cc 100644 (file)
@@ -1,10 +1,10 @@
 <?php // $Id$
 
-//  Remove oneself or someone else from a course, unassigning all 
+//  Remove oneself or someone else from a course, unassigning all
 //  roles one might have
 //
-//  This will not delete any of their data from the course, 
-//  but will remove them from the participant list and prevent 
+//  This will not delete any of their data from the course,
+//  but will remove them from the participant list and prevent
 //  any course email being sent to them.
 
     require_once("../config.php");
 
 
     $strunenrol = get_string('unenrol');
+    $navlinks = array();
+    $navlinks[] = array('name' => $strunenrol, 'link' => null, 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
 
-    print_header("$course->shortname: $strunenrol", $course->fullname, 
-                 "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> -> $strunenrol"); 
+    print_header("$course->shortname: $strunenrol", $course->fullname, $navigation);
 
     if ($userid) {
         if (!$user = get_record('user', 'id', $userid)) {
             error('That user does not exist!');
         }
         $strunenrolsure  = get_string('unenrolsure', '', fullname($user, true));
-        notice_yesno($strunenrolsure, "unenrol.php?id=$id&amp;user=$user->id&amp;confirm=yes&amp;sesskey=".sesskey(), 
+        notice_yesno($strunenrolsure, "unenrol.php?id=$id&amp;user=$user->id&amp;confirm=yes&amp;sesskey=".sesskey(),
                                       $_SERVER['HTTP_REFERER']);
     } else {
         $strunenrolsure  = get_string('unenrolsure', '', get_string("yourself"));
-        notice_yesno($strunenrolsure, "unenrol.php?id=$id&amp;confirm=yes&amp;sesskey=".sesskey(), 
+        notice_yesno($strunenrolsure, "unenrol.php?id=$id&amp;confirm=yes&amp;sesskey=".sesskey(),
                                       $_SERVER['HTTP_REFERER']);
     }
 
index d212054eeddadf925f2bcb7f97fec38f2e616144..fe4bf7237ee3437e4fdbae075ebe4a76516a9816 100644 (file)
@@ -31,7 +31,7 @@
         error("You are not allowed to look at this page");
     }
 
-    add_to_log($course->id, "course", "user report", "user.php?id=$course->id&amp;user=$user->id&amp;mode=$mode", "$user->id"); 
+    add_to_log($course->id, "course", "user report", "user.php?id=$course->id&amp;user=$user->id&amp;mode=$mode", "$user->id");
 
     $stractivityreport = get_string("activityreport");
     $strparticipants   = get_string("participants");
     $strmode           = get_string($mode);
     $fullname          = fullname($user, true);
 
+    $navlinks = array();
     if ($course->id != SITEID) {
-        print_header("$course->shortname: $stractivityreport ($mode)", $course->fullname,
-                 "<a href=\"../course/view.php?id=$course->id\">$course->shortname</a> ->
-                  <a href=\"../user/index.php?id=$course->id\">$strparticipants</a> ->
-                  <a href=\"../user/view.php?id=$user->id&amp;course=$course->id\">$fullname</a> -> 
-                  $stractivityreport -> $strmode");
-    } else {
-        print_header("$course->shortname: $stractivityreport ($mode)", $course->fullname,
-                 "<a href=\"../user/view.php?id=$user->id&amp;course=$course->id\">$fullname</a> -> 
-                  $stractivityreport -> $strmode");
+        $navlinks[] = array('name' => $strparticipants, 'link' => "../user/index.php?id=$course->id", 'type' => 'misc');
     }
 
+    $navlinks[] = array('name' => $fullname, 'link' => "../user/view.php?id=$user->id&amp;course=$course->id", 'type' => 'misc');
+    $navlinks[] = array('name' => $stractivityreport, 'link' => null, 'type' => 'misc');
+    $navlinks[] = array('name' => $strmode, 'link' => null, 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
+
+    print_header("$course->shortname: $stractivityreport ($mode)", $course->fullname, $navigation);
+
 
 /// Print tabs at top
 /// This same call is made in:
                 // print_student_grade($user, $course);
             }
             break;
-      
+
         case "todaylogs" :
             echo '<div class="graph">';
             print_log_graph($course, $user->id, "userday.png");
             echo '</div>';
-            print_log($course, $user->id, usergetmidnight(time()), "l.time DESC", $page, $perpage, 
+            print_log($course, $user->id, usergetmidnight(time()), "l.time DESC", $page, $perpage,
                       "user.php?id=$course->id&amp;user=$user->id&amp;mode=$mode");
             break;
 
             echo '<div class="graph">';
             print_log_graph($course, $user->id, "usercourse.png");
             echo '</div>';
-            print_log($course, $user->id, 0, "l.time DESC", $page, $perpage, 
+            print_log($course, $user->id, 0, "l.time DESC", $page, $perpage,
                       "user.php?id=$course->id&amp;user=$user->id&amp;mode=$mode");
             break;
         case 'stats':
             $earliestday = get_field_sql('SELECT timeend FROM '.$CFG->prefix.'stats_user_daily ORDER BY timeend');
             $earliestweek = get_field_sql('SELECT timeend FROM '.$CFG->prefix.'stats_user_weekly ORDER BY timeend');
             $earliestmonth = get_field_sql('SELECT timeend FROM '.$CFG->prefix.'stats_user_monthly ORDER BY timeend');
-    
+
             if (empty($earliestday)) $earliestday = time();
             if (empty($earliestweek)) $earliestweek = time();
             if (empty($earliestmonth)) $earliestmonth = time();
-            
+
             $now = stats_get_base_daily();
             $lastweekend = stats_get_base_weekly();
             $lastmonthend = stats_get_base_monthly();
 
             $timeoptions = stats_get_time_options($now,$lastweekend,$lastmonthend,$earliestday,$earliestweek,$earliestmonth);
 
-            if (empty($timeoptions)) { 
+            if (empty($timeoptions)) {
                 error(get_string('nostatstodisplay'), $CFG->wwwroot.'/course/user.php?id='.$course->id.'&user='.$user->id.'&mode=outline');
             }
 
             // use the earliest.
             $time = array_pop(array_keys($timeoptions));
-            
+
             $param = stats_get_parameters($time,STATS_REPORT_USER_VIEW,$course->id,STATS_MODE_DETAILED);
 
             $param->table = 'user_'.$param->table;
             if (empty($stats)) {
                 error(get_string('nostatstodisplay'), $CFG->wwwroot.'/course/user.php?id='.$course->id.'&user='.$user->id.'&mode=outline');
             }
-    
+
             // MDL-10818, do not display broken graph when user has no permission to view graph
             if (has_capability('moodle/site:viewreports', get_context_instance(CONTEXT_COURSE, $id))) {
                 echo '<center><img src="'.$CFG->wwwroot.'/course/report/stats/graph.php?mode='.STATS_MODE_DETAILED.'&course='.$course->id.'&time='.$time.'&report='.STATS_REPORT_USER_VIEW.'&userid='.$user->id.'" alt="'.get_string('statisticsgraph').'" /></center>';
                                 default: print_string("section"); break;
                             }
                             echo " $i</h2>";
-    
+
                             echo '<div class="content">';
 
                             if ($mode == "outline") {
                                     continue;
                                 }
                                 $mod = $mods[$sectionmod];
-    
+
                                 if (empty($mod->visible)) {
                                     continue;
                                 }
                                                 echo "<h4>$image $mod->modfullname: ".
                                                      "<a href=\"$CFG->wwwroot/mod/$mod->modname/view.php?id=$mod->id\">".
                                                      format_string($instance->name,true)."</a></h4>";
-                                                
+
                                                 ob_start();
 
                                                 echo "<ul>";
 
                                                 $output = ob_get_contents();
                                                 ob_end_clean();
-                                                
+
                                                 if (str_replace(' ', '', $output) != '<ul></ul>') {
                                                     echo $output;
                                                 }
                                         }
                                     }
                                 }
-    
+
                             if ($mode == "outline") {
                                 echo "</table>";
                             }
index ffd536ce3db859a91bdfddde42a3c6e59fa7a7df..a86d7c5d98eecebf4b577fd57d7f00e37f288e9a 100755 (executable)
@@ -54,9 +54,12 @@ class enrolment_plugin_authorize
         $strcourses = get_string('courses');
         $strloginto = get_string('loginto', '', $course->shortname);
 
-        print_header($strloginto,
-                     $course->fullname,
-                     "<a href=\"$CFG->wwwroot/course/\">$strcourses</a> -> $strloginto");
+        $navlinks = array();
+        $navlinks[] = array('name' => $strcourses, 'link' => "$CFG->wwwroot/course/", 'type' => 'misc');
+        $navlinks[] = array('name' => $strloginto, 'link' => null, 'type' => 'misc');
+        $navigation = build_navigation($navlinks);
+
+        print_header($strloginto, $course->fullname, $navigation);
         print_course($course, '80%');
 
         if ($course->password) {
index 552cfba5ec0c10f4ca5a789df302f1ace5888263..7635cff43f002575c6782dd31c3716fe813f3880 100644 (file)
 
 /// Print header
     $strpaymentmanagement = get_string('paymentmanagement', 'enrol_authorize');
-    print_header_simple($strpaymentmanagement, "", "<a href=\"index.php\">$strpaymentmanagement</a>");
+    $navlinks = array();
+    $navlinks[] = array('name' => $strpaymentmanagement, 'link' => 'index.php', 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
+
+    print_header_simple($strpaymentmanagement, "", $navigation);
 
 /// If orderid is empty, user wants to see all orders
     if (empty($orderid)) {
index f13dfbd346acde0f741bc16d7f288cb4218208fb..98dff546e95fea0d04b4ae7b7528fe51253f33ca 100644 (file)
 
 /// Print header
     $struploadcsv = get_string('uploadcsv', 'enrol_authorize');
-    print_header_simple($struploadcsv, "", "<a href=\"uploadcsv.php\">$struploadcsv</a>");
+    $navlinks = array();
+    $navlinks[] = array('name' => $struploadcsv, 'link' => "uploadcsv.php", 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
+
+    print_header_simple($struploadcsv, "", $navigation);
     print_heading_with_help($struploadcsv, 'uploadcsv', 'enrol/authorize');
 
 /// Handle CSV file
index a5af41dcabe300a8616ed62eded334a22d830cf7..4351b584b43c1d17d2a4378216bc7c1b8d916c76 100644 (file)
@@ -9,10 +9,13 @@ if (!$site = get_site()) {
 
 /// get language strings
 $str = get_strings(array('enrolments', 'users', 'administration', 'settings'));
+$navlinks = array();
+$navlinks[] = array('name' => $str->administration, 'link' => "../../$CFG->admin/index.php", 'type' => 'misc');
+$navlinks[] = array('name' => $str->enrolments, 'link' => null, 'type' => 'misc');
+$navlinks[] = array('name' => 'IMS import', 'link' => null, 'type' => 'misc');
+$navigation = build_navigation($navlinks);
 
-print_header("$site->shortname: $str->enrolments", $site->fullname,
-              "<a href=\"../../$CFG->admin/index.php\">$str->administration</a> -> 
-               $str->enrolments -> IMS import");
+print_header("$site->shortname: $str->enrolments", $site->fullname, $navigation);
 
 require_once('enrol.php');
 
@@ -20,7 +23,7 @@ require_once('enrol.php');
 $enrol = new enrolment_plugin_imsenterprise();
 
 ?>
-<p>Launching the IMS Enterprise "cron" function. The import log will appear below (giving details of any 
+<p>Launching the IMS Enterprise "cron" function. The import log will appear below (giving details of any
 problems that might require attention).</p>
 <pre style="margin:10px; padding: 2px; border: 1px solid black; background-color: white; color: black;"><?php
 //error_reporting(E_ALL);
@@ -29,4 +32,4 @@ $enrol->cron();
 print_footer();
 
 exit;
-?>
\ No newline at end of file
+?>
index bc6a2a7168520bf255cbed98b1d8cab185f00d58..db8964f8880c8b71bf586071cef593aa95205be2 100644 (file)
@@ -40,8 +40,8 @@ var $errormsg;
 * Prints the entry form/page for this enrolment
 *
 * This is only called from course/enrol.php
-* Most plugins will probably override this to print payment 
-* forms etc, or even just a notice to say that manual enrolment 
+* Most plugins will probably override this to print payment
+* forms etc, or even just a notice to say that manual enrolment
 * is disabled
 *
 * @param    course  current course object
@@ -54,7 +54,12 @@ function print_entry($course) {
 
 /// Automatically enrol into courses without password
 
-    $context = get_context_instance(CONTEXT_SYSTEM, SITEID);  
+    $context = get_context_instance(CONTEXT_SYSTEM, SITEID);
+
+    $navlinks = array();
+    $navlinks[] = array('name' => $strcourses, 'link' => ".", 'type' => 'misc');
+    $navlinks[] = array('name' => $strloginto, 'link' => null, 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
 
     if ($course->password == '') {   // no password, so enrol
 
@@ -63,9 +68,9 @@ function print_entry($course) {
 
         } else if (empty($_GET['confirm']) && empty($_GET['cancel'])) {
 
-            print_header($strloginto, $course->fullname, "<a href=\".\">$strcourses</a> -> $strloginto");
+            print_header($strloginto, $course->fullname, $navigation);
             echo '<br />';
-            notice_yesno(get_string('enrolmentconfirmation'), "enrol.php?id=$course->id&amp;confirm=1", 
+            notice_yesno(get_string('enrolmentconfirmation'), "enrol.php?id=$course->id&amp;confirm=1",
                                                               "enrol.php?id=$course->id&amp;cancel=1");
             print_footer();
             exit;
@@ -103,7 +108,7 @@ function print_entry($course) {
         $password = '';
     }
 
-    print_header($strloginto, $course->fullname, "<a href=\".\">$strcourses</a> -> $strloginto", "form.password");
+    print_header($strloginto, $course->fullname, $navigation, "form.password");
 
     print_course($course, "80%");
 
@@ -118,7 +123,7 @@ function print_entry($course) {
 /**
 * The other half to print_entry, this checks the form data
 *
-* This function checks that the user has completed the task on the 
+* This function checks that the user has completed the task on the
 * enrolment entry page and then enrolls them.
 *
 * @param    form    the form data submitted, as an object
@@ -194,7 +199,7 @@ function check_group_entry ($courseid, $password) {
 /**
 * Prints a form for configuring the current enrolment plugin
 *
-* This function is called from admin/enrol.php, and outputs a 
+* This function is called from admin/enrol.php, and outputs a
 * full page with a form for defining the current enrolment plugin.
 *
 * @param    frm  an object containing all the data for this page
@@ -204,8 +209,8 @@ function config_form($frm) {
 
     if (!isset( $frm->enrol_manual_keyholderrole )) {
         $frm->enrol_manual_keyholderrole = '';
-    } 
-    
+    }
+
     include ("$CFG->dirroot/enrol/manual/config.html");
 }
 
@@ -230,9 +235,9 @@ function process_config($config) {
 
 
 /**
-* This function is run by admin/cron.php every time 
+* This function is run by admin/cron.php every time
 *
-* The cron function can perform regular checks for the current 
+* The cron function can perform regular checks for the current
 * enrollment plugin.  For example it can check a foreign database,
 * all look for a file to pull data in from
 *
@@ -245,8 +250,8 @@ function cron() {
     if (empty($CFG->lastexpirynotify)) {
         $CFG->lastexpirynotify = 0;
     }
-    
-    if ($CFG->lastexpirynotify < date('Ymd') && 
+
+    if ($CFG->lastexpirynotify < date('Ymd') &&
         ($courses = get_records_select('course', 'enrolperiod > 0 AND expirynotify > 0 AND expirythreshold > 0'))) {
 
         $admin = get_admin();
@@ -269,8 +274,8 @@ function cron() {
             }
 
             if ($oldenrolments = get_records_sql('
-                      SELECT u.* 
-                        FROM '.$CFG->prefix.'role_assignments ra, 
+                      SELECT u.*
+                        FROM '.$CFG->prefix.'role_assignments ra,
                              '.$CFG->prefix.'user u
                         WHERE ra.contextid = '.$context->id.'
                           AND ra.timeend > 0 AND ra.timeend <= '.$expiry.'
@@ -292,7 +297,7 @@ function cron() {
                     } else {
                         $a->current[] = fullname($user) . " <$user->email>";
                         if ($course->notifystudents) {     // Send this guy notice
-                            email_to_user($user, $teacher, $SITE->fullname .' '. $strexpirynotify, 
+                            email_to_user($user, $teacher, $SITE->fullname .' '. $strexpirynotify,
                                           $strexpirynotifystudentsemail);
                         }
                     }
@@ -304,7 +309,7 @@ function cron() {
                 $strexpirynotifyemail = get_string('expirynotifyemail', '', $a);
 
                 if ($a->current || $a->past) {
-                    if ($teachers = get_users_by_capability($context, 'moodle/course:update', 
+                    if ($teachers = get_users_by_capability($context, 'moodle/course:update',
                                                             'u.*,ra.hidden', 'r.sortorder ASC',
                                                             '', '', '', '', false)) {
                         foreach ($teachers as $teacher) {
@@ -358,7 +363,7 @@ function print_enrolmentkeyfrom($course) {
     global $CFG;
     global $USER;
 
-    $context = get_context_instance(CONTEXT_SYSTEM, SITEID);  
+    $context = get_context_instance(CONTEXT_SYSTEM, SITEID);
     $guest = has_capability('moodle/legacy:guest', $context, $USER->id, false);
 
     // if a keyholder role is defined we list teachers in that role (if any exist)
@@ -377,14 +382,14 @@ function print_enrolmentkeyfrom($course) {
                 echo "$contactname<br />";
             }
             $contactslisted = true;
-        } 
+        }
     }
 
     // if no keyholder role is defined OR nobody is in that role we do this the 'old' way
     // (show the first person with update rights)
     if (!$contactslisted) {
-        if ($teachers = get_users_by_capability(get_context_instance(CONTEXT_COURSE, $course->id), 'moodle/course:update', 
-            'u.*,ra.hidden', 'r.sortorder ASC', 0, 1, '', '', false, true)) {  
+        if ($teachers = get_users_by_capability(get_context_instance(CONTEXT_COURSE, $course->id), 'moodle/course:update',
+            'u.*,ra.hidden', 'r.sortorder ASC', 0, 1, '', '', false, true)) {
             $teacher = array_shift($teachers);
         }
         if (!empty($teacher)) {
index 4d901117843831796c4a61058ef3f2c25268a164..806fd90b2b339cdf190a796806f21d9412778451 100644 (file)
@@ -29,9 +29,12 @@ function print_entry($course) {
         $manual->print_entry($course);
 
     } else {
+        $navlinks = array();
+        $navlinks[] = array('name' => $strcourses, 'link' => "$CFG->wwwroot/course", 'type' => 'misc');
+        $navlinks[] = array('name' => $strloginto, 'link' => null, 'type' => 'misc');
+        $navigation = build_navigation($navlinks);
 
-        print_header($strloginto, $course->fullname,
-                     "<a href=\"$CFG->wwwroot/course/\">$strcourses</a> -> $strloginto");
+        print_header($strloginto, $course->fullname, $navigation);
         print_course($course, "80%");
 
         if ($course->password) {  // Presenting two options
index 51f74c1c638b9295cc068019590338d7f2781ca9..a56a4b318b7eb2c522a18da776f991394d5167c2 100644 (file)
@@ -90,15 +90,17 @@ if ($potentialmembers) {
 // Print the page and form
 $strgroups = get_string('groups');
 $strparticipants = get_string('participants');
+$straddgroupstogroupings = get_string('addgroupstogroupings', 'group');
 
 $groupingname = format_string($grouping->name);
 
-print_header("$course->shortname: $strgroups",
-             $course->fullname,
-             "<a href=\"$CFG->wwwroot/course/view.php?id=$courseid\">$course->shortname</a> ".
-             "-> <a href=\"$CFG->wwwroot/user/index.php?id=$courseid\">$strparticipants</a> ".
-             "-> <a href=\"$CFG->wwwroot/group/index.php?id=$courseid\">$strgroups</a>".
-             '-> '. get_string('addgroupstogroupings', 'group'), '', '', true, '', user_login_string($course, $USER));
+$navlinks = array();
+$navlinks[] = array('name' => $strparticipants, 'link' => "$CFG->wwwroot/user/index.php?id=$courseid", 'type' => 'misc');
+$navlinks[] = array('name' => $strgroups, 'link' => "$CFG->wwwroot/group/index.php?id=$courseid", 'type' => 'misc');
+$navlinks[] = array('name' => $straddgroupstogroupings, 'link' => null, 'type' => 'misc');
+$navigation = build_navigation($navlinks);
+
+print_header("$course->shortname: $strgroups", $course->fullname, $navigation, '', '', true, '', user_login_string($course, $USER));
 
 ?>
 <div id="addmembersform">
index 947f4b83c685d36d005c4996e4ea8030174170da..e675d24ce7f6a854bf2c039aff21ed6f1ebf0eea 100644 (file)
@@ -118,15 +118,17 @@ if ($potentialmemberscount <=  MAX_USERS_PER_PAGE) {
 // Print the page and form
 $strgroups = get_string('groups');
 $strparticipants = get_string('participants');
+$stradduserstogroup = get_string('adduserstogroup', 'group');
 
 $groupname = format_string($group->name);
 
-print_header("$course->shortname: $strgroups",
-             $course->fullname,
-             "<a href=\"$CFG->wwwroot/course/view.php?id=$courseid\">$course->shortname</a> ".
-             "-> <a href=\"$CFG->wwwroot/user/index.php?id=$courseid\">$strparticipants</a> ".
-             "-> <a href=\"$CFG->wwwroot/group/index.php?id=$courseid\">$strgroups</a>".
-             '-> '. get_string('adduserstogroup', 'group'), '', '', true, '', user_login_string($course, $USER));
+$navlinks = array();
+$navlinks[] = array('name' => $strparticipants, 'link' => "$CFG->wwwroot/user/index.php?id=$courseid", 'type' => 'misc');
+$navlinks[] = array('name' => $strgroups, 'link' => "$CFG->wwwroot/group/index.php?id=$courseid", 'type' => 'misc');
+$navlinks[] = array('name' => $stradduserstogroup, 'link' => null, 'type' => 'misc');
+$navigation = build_navigation($navlinks);
+
+print_header("$course->shortname: $strgroups", $course->fullname, $navigation, '', '', true, '', user_login_string($course, $USER));
 
 ?>
 <div id="addmembersform">
index 4e6ff72b89c1827f1bb90355cc82286b594aca10..d0c876b52c1913479a96eec399873b67a9544e8d 100644 (file)
@@ -60,7 +60,8 @@ function upgrade_plugins($type, $dir, $return) {
                 $info->currentmoodle = $CFG->version;
                 $info->requiremoodle = $plugin->requires;
                 if (!$updated_plugins) {
-                    print_header($strpluginsetup, $strpluginsetup, $strpluginsetup, '',
+                    print_header($strpluginsetup, $strpluginsetup,
+                        build_navigation(array(array('name' => $strpluginsetup, 'link' => null, 'type' => 'misc'))), '',
                         upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');
                 }
                 upgrade_log_start();
@@ -82,7 +83,8 @@ function upgrade_plugins($type, $dir, $return) {
             // do nothing
         } else if ($CFG->$pluginversion < $plugin->version) {
             if (!$updated_plugins) {
-                print_header($strpluginsetup, $strpluginsetup, $strpluginsetup, '',
+                print_header($strpluginsetup, $strpluginsetup,
+                        build_navigation(array(array('name' => $strpluginsetup, 'link' => null, 'type' => 'misc'))), '',
                         upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');
             }
             $updated_plugins = true;
@@ -245,7 +247,8 @@ function upgrade_activity_modules($return) {
                 $info->currentmoodle = $CFG->version;
                 $info->requiremoodle = $module->requires;
                 if (!$updated_modules) {
-                    print_header($strmodulesetup, $strmodulesetup, $strmodulesetup, '',
+                    print_header($strmodulesetup, $strmodulesetup,
+                            build_navigation(array(array('name' => $strmodulesetup, 'link' => null, 'type' => 'misc'))), '',
                             upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');
                 }
                 upgrade_log_start();
@@ -270,7 +273,8 @@ function upgrade_activity_modules($return) {
                     continue;
                 }
                 if (!$updated_modules) {
-                    print_header($strmodulesetup, $strmodulesetup, $strmodulesetup, '',
+                    print_header($strmodulesetup, $strmodulesetup,
+                            build_navigation(array(array('name' => $strmodulesetup, 'link' => null, 'type' => 'misc'))), '',
                             upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');
                 }
                 upgrade_log_start();
@@ -330,7 +334,8 @@ function upgrade_activity_modules($return) {
 
         } else {    // module not installed yet, so install it
             if (!$updated_modules) {
-                print_header($strmodulesetup, $strmodulesetup, $strmodulesetup, '',
+                print_header($strmodulesetup, $strmodulesetup,
+                        build_navigation(array(array('name' => $strmodulesetup, 'link' => null, 'type' => 'misc'))), '',
                         upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');
             }
             upgrade_log_start();
index 1704bc362ccf9fc32774197f2d0825201f6a81f5..75912a300d8eb341b7a25f73f4d00825d7e3ba3f 100644 (file)
@@ -16,7 +16,7 @@ define('BLOCKS_PINNED_FALSE',1);
 define('BLOCKS_PINNED_BOTH',2);
 
 require_once($CFG->libdir.'/pagelib.php');
-require_once($CFG->dirroot.'/course/lib.php'); // needed to solve all those: Call to undefined function: print_recent_activity() when adding Recent Activity 
+require_once($CFG->dirroot.'/course/lib.php'); // needed to solve all those: Call to undefined function: print_recent_activity() when adding Recent Activity
 
 // Returns false if this block is incompatible with the current version of Moodle.
 function block_is_compatible($blockname) {
@@ -360,8 +360,8 @@ function blocks_print_group(&$page, &$pageblocks, $position) {
     $managecourseblocks = has_capability('moodle/site:manageblocks', $coursecontext);
     $editmymoodle = $page->type == PAGE_MY_MOODLE && has_capability('moodle/my:manageblocks', $coursecontext);
 
-    if ($page->blocks_default_position() == $position && 
-        $page->user_is_editing() && 
+    if ($page->blocks_default_position() == $position &&
+        $page->user_is_editing() &&
         ($managecourseblocks || $editmymoodle || $myownblogpage)) {
 
         blocks_print_adminblock($page, $pageblocks);
@@ -522,7 +522,7 @@ function blocks_execute_action($page, &$pageblocks, $blockaction, $instanceorid,
                 $page->print_header(get_string('pageheaderconfigablock', 'moodle'), array($strheading => ''));
 
                 echo '<div class="block-config" id="'.$block->name.'">';   /// Make CSS easier
+
                 print_heading($strheading);
                 echo '<form method="post" action="'. $page->url_get_path() .'">';
                 echo '<p>';
@@ -1042,7 +1042,8 @@ function upgrade_blocks_db($continueto) {
 
     if (empty($CFG->blocks_version)) {                  // Blocks have never been installed.
         $strdatabaseupgrades = get_string('databaseupgrades');
-        print_header($strdatabaseupgrades, $strdatabaseupgrades, $strdatabaseupgrades, '',
+        print_header($strdatabaseupgrades, $strdatabaseupgrades,
+                build_navigation(array(array('name' => $strdatabaseupgrades, 'link' => null, 'type' => 'misc'))), '',
                 upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');
 
         upgrade_log_start();
@@ -1088,7 +1089,8 @@ function upgrade_blocks_db($continueto) {
 
     if ($blocks_version > $CFG->blocks_version) {       // Upgrade tables
         $strdatabaseupgrades = get_string('databaseupgrades');
-        print_header($strdatabaseupgrades, $strdatabaseupgrades, $strdatabaseupgrades, '', upgrade_get_javascript());
+        print_header($strdatabaseupgrades, $strdatabaseupgrades,
+                build_navigation(array(array('name' => $strdatabaseupgrades, 'link' => null, 'type' => 'misc'))), '', upgrade_get_javascript());
 
         upgrade_log_start();
         print_heading('blocks');
@@ -1253,7 +1255,8 @@ function upgrade_blocks_plugins($continueto) {
             } else if ($currblock->version < $block->version) {
                 if (empty($updated_blocks)) {
                     $strblocksetup    = get_string('blocksetup');
-                    print_header($strblocksetup, $strblocksetup, $strblocksetup, '',
+                    print_header($strblocksetup, $strblocksetup,
+                            build_navigation(array(array('name' => $strblocksetup, 'link' => null, 'type' => 'misc'))), '',
                             upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');
                 }
                 $updated_blocks = true;
@@ -1331,7 +1334,8 @@ function upgrade_blocks_plugins($continueto) {
             }
             if (empty($updated_blocks)) {
                 $strblocksetup    = get_string('blocksetup');
-                print_header($strblocksetup, $strblocksetup, $strblocksetup, '',
+                print_header($strblocksetup, $strblocksetup,
+                        build_navigation(array(array('name' => $strblocksetup, 'link' => null, 'type' => 'misc'))), '',
                         upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');
             }
             $updated_blocks = true;
index 85aa28f91437487ef2aaee98f37f3b39a3fec817..6aad8b20a250000ef040d04576e0edf31c8f0476 100644 (file)
@@ -1,61 +1,61 @@
 <?php
 /**
  * This file provides hooks from moodle core into custom code.
- * 
+ *
  * Important note
  * --------------
- * 
- * If at all possible, the facilities provided here should not be used. 
- * Wherever possible, customisations should be written using one of the 
+ *
+ * If at all possible, the facilities provided here should not be used.
+ * Wherever possible, customisations should be written using one of the
  * standard plug-in points like modules, blocks, auth plugins, themes, ...
- * 
+ *
  * However, sometimes that is just not possible, because of the nature
  * of the change you want to make. In which case the second best plan is
  * to implement your feature in a generally useful way, which can
  * be contributed back to the moodle project so that everyone benefits.
- * 
+ *
  * But supposing you are forced to implement some nasty hack that only
  * you will ever want, then the local folder is for you. The idea is that
- * instead of scattering your changes throughout the code base, you 
+ * instead of scattering your changes throughout the code base, you
  * put them all in a folder called 'local'. Then you won't have to
  * deal with merging problems when you upgrade the rest of your moodle
  * installation.
- * 
- * 
+ *
+ *
  * Available hooks
  * ===============
- * 
+ *
  * These are similar to the module interface, however, not all the the
  * facilities that are available to modules are available to local code (yet).
- * 
- * 
+ *
+ *
  * Local database customisations
  * -----------------------------
- * 
+ *
  * If your local customisations require changes to the database, use the files:
- * 
+ *
  * local/version.php
  * local/db/upgrade.php
- * 
+ *
  * In the file version.php, set the variable $local_version to a versionstamp
  * value like 2006030300 (a concatenation of year, month, day, serial).
- * 
+ *
  * In the file upgrade.php, implement the
  * function xmldb_local_upgrade($oldversion) to make the database changes.
- * 
+ *
  * Note that you don't need to have an install.xml file. Instead,
  * when your moodle instance is first installed, xmldb_local_upgrade() will be called
  * with $oldversion set to 0, so that all the updates run.
- * 
- * 
+ *
+ *
  * Course deletion
  * ---------------
- * 
+ *
  * To have your local customisations notified when a course is deleted,
- * make a file called 
- * 
+ * make a file called
+ *
  * local/lib.php
- * 
+ *
  * In there, implement the function local_delete_course($courseid). This
  * function will then be called whenever the functions remove_course_contents()
  * or delete_course() from moodlelib are called.
 
 /**
  * This function checks to see whether local database customisations are up-to-date
- * by comparing $CFG->local_version to the variable $local_version defined in 
+ * by comparing $CFG->local_version to the variable $local_version defined in
  * local/version.php. If not, it looks for a function called 'xmldb_local_upgrade'
- * in a file called 'local/db/upgrade.php', and if it's there calls it with the 
+ * in a file called 'local/db/upgrade.php', and if it's there calls it with the
  * appropiate $oldversion parameter. Then it updates $CFG->local_version.
  * On success it prints a continue link. On failure it prints an error.
- * 
- * @uses $CFG 
+ *
+ * @uses $CFG
  * @uses $db to do something really evil with the debug setting that should probably be eliminated. TODO!
  * @param string $continueto a URL passed to print_continue() if the local upgrades succeed.
  */
 function upgrade_local_db($continueto) {
 
     global $CFG, $db;
-    
+
     // if we don't have code version or a db upgrade file, just return true, we're unneeded
     if (!file_exists($CFG->dirroot.'/local/version.php') || !file_exists($CFG->dirroot.'/local/db/upgrade.php')) {
         return true;
@@ -88,10 +88,11 @@ function upgrade_local_db($continueto) {
         $CFG->local_version = 0;
     }
 
-    if ($local_version > $CFG->local_version) { // upgrade! 
+    if ($local_version > $CFG->local_version) { // upgrade!
         $strdatabaseupgrades = get_string('databaseupgrades');
-        print_header($strdatabaseupgrades, $strdatabaseupgrades, $strdatabaseupgrades, '', upgrade_get_javascript());
-        
+        print_header($strdatabaseupgrades, $strdatabaseupgrades,
+            build_navigation(array(array('name' => $strdatabaseupgrades, 'link' => null, 'type' => 'misc'))), '', upgrade_get_javascript());
+
         upgrade_log_start();
         require_once ($CFG->dirroot .'/local/db/upgrade.php');
 
@@ -120,10 +121,10 @@ function upgrade_local_db($continueto) {
 }
 
 /**
- * Notify local code that a course is being deleted. 
- * Look for a function local_delete_course() in a file called 
+ * Notify local code that a course is being deleted.
+ * Look for a function local_delete_course() in a file called
  * local/lib.php andn call it if it is there.
- * 
+ *
  * @param int $courseid the course that is being deleted.
  * @param bool $showfeedback Whether to display notifications on success.
  * @return false if local_delete_course failed, or true if
index 1c66f077815babbec5860868d2c0c229a8be6eb8..ec8a62b9204c8290c75910e8bfb7a5bbb4ccea53 100644 (file)
@@ -1780,7 +1780,9 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null) {
                     break;
 
                 default:    /// Guests not allowed
-                    print_header_simple('', '', get_string('loggedinasguest'));
+                    $strloggedinasguest = get_string('loggedinasguest');
+                    print_header_simple('', '',
+                            build_navigation(array(array('name' => $strloggedinasguest, 'link' => null, 'type' => 'misc'))));
                     if (empty($USER->switchrole[$context->id])) {  // Normal guest
                         notice(get_string('guestsnotallowed', '', format_string($COURSE->fullname)), "$CFG->wwwroot/login/index.php");
                     } else {
index e9647f74c69eb74cb3fee41fb632b9f3004ad643..d6482463bae5c1fa6df77f8485fda86d0aa05d94 100644 (file)
@@ -5,6 +5,8 @@
 
     $id = optional_param('id', SITEID, PARAM_INT); // current course
 
+    $strparticipants = get_string('participants');
+
     //HTTPS is potentially required in this page
     httpsrequired();
 
@@ -55,6 +57,9 @@
     $mform = new login_change_password_form();
     $mform->set_data(array('id'=>$course->id));
 
+    $navlinks = array();
+    $navlinks[] = array('name' => $strparticipants, 'link' => "$CFG->wwwroot/user/index.php?id=$course->id", 'type' => 'misc');
+
     if ($mform->is_cancelled()) {
         redirect($CFG->wwwroot.'/user/view.php?id='.$USER->id.'&amp;course='.$course->id);
     } else if ($data = $mform->get_data()) {
 
         $fullname = fullname($USER, true);
 
-        if ($course->id != SITEID) {
-            $navstr = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> -> ";
-        } else {
-            $navstr = '';
-        }
-        $navstr .= "<a href=\"$CFG->wwwroot/user/index.php?id=$course->id\">".get_string("participants")."</a> -> <a href=\"$CFG->wwwroot/user/view.php?id=$USER->id&amp;course=$course->id\">$fullname</a> -> $strpasswordchanged";
+        $navlinks[] = array('name' => $fullname,
+                            'link' => "$CFG->wwwroot/user/view.php?id=$USER->id&amp;course=$course->id",
+                            'type' => 'misc');
+        $navlinks[] = array('name' => $strpasswordchanged, 'link' => null, 'type' => 'misc');
+        $navigation = build_navigation($navlinks);
 
-        print_header($strpasswordchanged, $strpasswordchanged, $navstr);
+        print_header($strpasswordchanged, $strpasswordchanged, $navigation);
 
         if (empty($SESSION->wantsurl) or $SESSION->wantsurl == $CFG->httpswwwroot.'/login/change_password.php') {
             $returnto = "$CFG->wwwroot/user/view.php?id=$USER->id&amp;course=$id";
 
     $fullname = fullname($USER, true);
 
-    if ($course->id != SITEID) {
-        $navstr = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> -> ";
-    } else {
-        $navstr = '';
-    }
-    $navstr .= "<a href=\"$CFG->wwwroot/user/index.php?id=$course->id\">".get_string('participants')."</a> -> <a href=\"$CFG->wwwroot/user/view.php?id=$USER->id&amp;course=$course->id\">$fullname</a> -> $strchangepassword";
-
+    $navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$USER->id&amp;course=$course->id", 'type' => 'misc');
+    $navlinks[] = array('name' => $strchangepassword, 'link' => null, 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
 
-    print_header($strchangepassword, $strchangepassword, $navstr);
+    print_header($strchangepassword, $strchangepassword, $navigation);
     if (get_user_preferences('auth_forcepasswordchange')) {
         notify(get_string('forcepasswordchangenotice'));
     }
index 1cc6db998a3143b4d9222f41643e7d4071ff4afe..f07a9865e4bb601208b4561cb1298278bee68ccb 100644 (file)
@@ -31,7 +31,7 @@
 
         if ($confirmed == AUTH_CONFIRM_ALREADY) {
             $user = get_complete_user_data('username', $username);
-            print_header(get_string("alreadyconfirmed"), get_string("alreadyconfirmed"), "", "");
+            print_header(get_string("alreadyconfirmed"), get_string("alreadyconfirmed"), array(), "");
             print_box_start('generalbox centerpara boxwidthnormal boxaligncenter');
             echo "<h3>".get_string("thanks").", ". fullname($user) . "</h3>\n";
             echo "<p>".get_string("alreadyconfirmed")."</p>\n";
@@ -56,7 +56,7 @@
                 redirect($goto);
             }
 
-            print_header(get_string("confirmed"), get_string("confirmed"), "", "");
+            print_header(get_string("confirmed"), get_string("confirmed"), array(), "");
             print_box_start('generalbox centerpara boxwidthnormal boxaligncenter');
             echo "<h3>".get_string("thanks").", ". fullname($USER) . "</h3>\n";
             echo "<p>".get_string("confirmed")."</p>\n";
index 6244ace64eb2b18dc73395cdf9d0c25ff453b689..b03ee866f32d792ad9c118783e4e485b4de3b9dc 100644 (file)
@@ -18,6 +18,9 @@ $systemcontext = get_context_instance(CONTEXT_SYSTEM);
 $strforgotten = get_string('passwordforgotten');
 $strlogin     = get_string('login');
 
+$navigation = build_navigation(array(array('name' => $strlogin, 'link' => "$CFG->wwwroot/login/index.php", 'type' => 'misc'),
+                                     array('name' => $strforgotten, 'link' => null, 'type' => 'misc')));
+
 // if you are logged in then you shouldn't be here!
 if (isloggedin() and !isguestuser()) {
     redirect($CFG->wwwroot.'/index.php', get_string('loginalready'), 5);
@@ -31,10 +34,8 @@ if ($p_secret !== false) {
     update_login_count();
 
     $user = get_complete_user_data('username', $p_username);
-
     if (!empty($user) and $user->secret === '') {
-        print_header($strforgotten, $strforgotten,
-            "<a href=\"{$CFG->wwwroot}/login/index.php\">{$strlogin}</a>->{$strforgotten}");
+        print_header($strforgotten, $strforgotten, $navigation);
         error(get_string('secretalreadyused'));
 
     } else if (!empty($user) and $user->secret == stripslashes($p_secret)) {
@@ -67,13 +68,11 @@ if ($p_secret !== false) {
         $a->email = $user->email;
         $a->link = $changepasswordurl;
 
-        print_header($strforgotten, $strforgotten,
-            "<a href=\"{$CFG->wwwroot}/login/index.php\">{$strlogin}</a>->{$strforgotten}");
+        print_header($strforgotten, $strforgotten, $navigation);
         notice(get_string('emailpasswordsent', '', $a), $changepasswordurl);
 
     } else {
-        print_header($strforgotten, $strforgotten,
-            "<a href=\"{$CFG->wwwroot}/login/index.php\">{$strlogin}</a>->{$strforgotten}");
+        print_header($strforgotten, $strforgotten, $navigation);
         error(get_string('forgotteninvalidurl'));
     }
 
@@ -125,8 +124,7 @@ if ($mform->is_cancelled()) {
         }
     }
 
-    print_header($strforgotten, $strforgotten,
-        "<a href=\"{$CFG->wwwroot}/login/index.php\">{$strlogin}</a>->{$strforgotten}");
+    print_header($strforgotten, $strforgotten, $navigation
 
     if (empty($user->email) or !empty($CFG->protectusernames)) {
         // Print general confirmation message
@@ -144,12 +142,11 @@ if ($mform->is_cancelled()) {
 
 
 /// DISPLAY FORM
-print_header($strforgotten, $strforgotten,
-    "<a href=\"{$CFG->wwwroot}/login/index.php\">{$strlogin}</a>->{$strforgotten}", 'id_email');
+print_header($strforgotten, $strforgotten, $navigation, 'id_email');
 
 print_box(get_string('passwordforgotteninstructions'), 'generalbox boxwidthnormal boxaligncenter');
 $mform->display();
 
 print_footer();
 
-?>
\ No newline at end of file
+?>
index 0d3e69b10ea05bf5e5a5e5f33ec24cdf31bee65a..3181b4e1f4050961431ada149dfa1bb265e4c3b6 100644 (file)
@@ -10,8 +10,9 @@ $sesskey = sesskey();
 if (isloggedin() and !isguestuser()) {
     redirect( $CFG->wwwroot.'/', get_string('loginalready'), 5);
 }
+$navigation = build_navigation(array(array('name' => 'MNET ID Provider', 'link' => null, 'type' => 'misc')));
 
-print_header('MNET ID Provider', 'MNET ID Provider', 'MNET ID Provider', 'form.email' );
+print_header('MNET ID Provider', 'MNET ID Provider', $navigation, 'form.email' );
 
 if ($form = data_submitted() and confirm_sesskey()) {
     if ($user = get_record('user', 'username', $username, 'email', $form->email)) {
index be1f6000c101972c08860696c1428e485756c161..b5b780ed7bb2f6451a6fa0dfbe524b7ce1620ab4 100644 (file)
         $langs    = get_list_of_languages();
         $langmenu = popup_form ("$CFG->wwwroot/login/signup.php?lang=", $langs, "chooselang", $currlang, "", "", "", true);
     }
-    print_header($newaccount, $newaccount, "<a href=\"index.php\">$login</a> -> $newaccount", $mform_signup->focus(), "", true, "<div class=\"langmenu\">$langmenu</div>");
+
+    $navlinks = array();
+    $navlinks[] = array('name' => $login, 'link' => "index.php", 'type' => 'misc');
+    $navlinks[] = array('name' => $newaccount, 'link' => null, 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
+    print_header($newaccount, $newaccount, $navigation, $mform_signup->focus(), "", true, "<div class=\"langmenu\">$langmenu</div>");
 
     $mform_signup->display();
     print_footer();
 
 
-?>
\ No newline at end of file
+?>
index 11d84b4d837845e4bf152170d391a0b132dc0b2e..9d4338badb8a7400b9e91ce9b80798631975e257 100644 (file)
         $strsearch = get_string("search");
 
         $CFG->framename = "newwindow";
-        if ($course->id != SITEID) {
-            $navlinks = array();
-            $navlinks[] = array('name' => $strglossaries, 'link' => '', 'type' => 'activity');
-            $navlinks[] = array('name' => $strsearch, 'link' => '', 'type' => 'title');
-            
-            $navigation = build_navigation($navlinks);
-            
-            print_header(strip_tags("$course->shortname: $strglossaries $strsearch"), $course->fullname, $navigation, "", "", true, "&nbsp;", "&nbsp;");
-        } else {
-            print_header(strip_tags("$course->shortname: $strglossaries $strsearch"), $course->fullname,
-            "$strglossaries -> $strsearch", "", "", true, "&nbsp;", "&nbsp;");
-        }
+        $navlinks = array();
+        $navlinks[] = array('name' => $strglossaries, 'link' => '', 'type' => 'activity');
+        $navlinks[] = array('name' => $strsearch, 'link' => '', 'type' => 'title');
+
+        $navigation = build_navigation($navlinks);
+
+        print_header(strip_tags("$course->shortname: $strglossaries $strsearch"), $course->fullname, $navigation, "", "", true, "&nbsp;", "&nbsp;");
 
     } else {
         print_header();    // Needs to be something here to allow linking back to the whole glossary
index 6957eb2babe9a085190b1d1be3aabc0acd5d1849..ad5496989a206d946008b49ac5c255823eca3efd 100644 (file)
@@ -32,7 +32,7 @@
             if (! $cm = get_coursemodule_from_instance("hotpot", $hotpot->id, $course->id)) {
                 error("Course Module ID was incorrect");
             }
-        
+
         }
         require_login($course, true, $cm);
         $context = get_context_instance(CONTEXT_MODULE, $cm->id);
     // header strings
     $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);
-        
+
     $button = update_module_button($cm->id, $course->id, get_string("modulename", "hotpot"));
     $button = '<div style="font-size:0.75em;">'.$button.'</div>';
     $loggedinas = '<span class="logininfo">'.user_login_string($course, $USER).'</span>';
     }
     // if HTML is being requested ...
     if (empty($get_js) && empty($get_css)) {
-        if (empty($frameset)) { 
+        if (empty($frameset)) {
             // HP v6
             if ($hotpot->navigation==HOTPOT_NAVIGATION_FRAME || $hotpot->navigation==HOTPOT_NAVIGATION_IFRAME) {
                 $get_html = ($framename=='main') ? true : false;
             } else {
                 $get_html = true;
             }
-        } else { 
+        } else {
             // HP5 v5
             $get_html = empty($framename) ? true : false;
         }
         if ($get_html) {
-        
+
             if (HOTPOT_FIRST_ATTEMPT) {
                 add_to_log($course->id, "hotpot", "view", "view.php?id=$cm->id", "$hotpot->id", "$cm->id");
 
     $body = '';
     $body_tags = '';
     $footer = '</html>';
-    // HP6 and some HP5 (v6 and v4) 
+    // HP6 and some HP5 (v6 and v4)
     if (preg_match('|<body'.'([^>]*'.'onLoad=(["\'])(.*?)(\\2)'.'[^>]*)'.'>(.*)</body>|is', $hp->html, $matches)) {
         $body = $matches[5]; // contents of first <body onload="StartUp()">...</body> block
         if ($pageid) {
     switch ($hotpot->navigation) {
         case HOTPOT_NAVIGATION_BAR:
             //update_module_button($cm->id, $course->id, $strmodulename.'" style="font-size:0.8em')
-            print_header(
-                $title, $heading, $navigation,
-                "", $head.$styles.$scripts, true, $button, 
-                $loggedinas, false, $body_tags
+            print_header($title, $heading, $navigation, "", $head.$styles.$scripts, true, $button, $loggedinas, false, $body_tags
             );
             if (!empty($available_msg)) {
                 notify($available_msg);
                     $body_tags = " onload=\"set_iframe_height('$iframe_id')\"";
                     $iframe_js = '<script src="iframe.js" type="text/javascript"></script>'."\n";
                     print_header(
-                        $title, $heading, $navigation, 
-                        "", $head.$styles.$scripts.$iframe_js, true, $button, 
+                        $title, $heading, $navigation,
+                        "", $head.$styles.$scripts.$iframe_js, true, $button,
                         $loggedinas, false, $body_tags
                     );
                     if (!empty($available_msg)) {
                 // do nothing
             } else {
                 $hp->html = preg_replace(
-                    '|<meta[^>]*charset=iso-8859-1[^>]*>|is', 
-                    '<meta http-equiv="Content-Type" content="text/html; charset='.$charset.'" />', 
+                    '|<meta[^>]*charset=iso-8859-1[^>]*>|is',
+                    '<meta http-equiv="Content-Type" content="text/html; charset='.$charset.'" />',
                     $hp->html
                 );
             }
index 84103ea508a06bdd19f09e748f202d9e7a4589cb..353f719e044d6d7c9215eaa5350f8bd0f06e8efc 100644 (file)
@@ -31,8 +31,11 @@ add_to_log($course->id, "lams", "view", "view.php?id=$cm->id", "$lams->id");
 //if ($course->id != SITEID) {
 //    $navigation = "<A HREF=\"../../course/view.php?id=$course->id\">$course->shortname</A> ->";
 //}
-print_header_simple(format_string($lams->name), "",
-        "<a href=\"index.php?id=$course->id\">$strchoices</a> -> ".format_string($lams->name), "", "", true,
+$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);
+print_header_simple(format_string($lams->name), "", $navigation, "", "", true,
         update_module_button($cm->id, $course->id, get_string("lesson","lams")), navmenu($course, $cm));
 
 echo '<table id="layout-table"><tr>';
@@ -63,7 +66,7 @@ if(has_capability('mod/lams:manage', $context)){
     print_simple_box_start('center');
     echo '<a target="LAMS Monitor" title="LAMS Monitor" href="'.$url.'">'.get_string("openmonitor", "lams").'</a>';
     print_simple_box_end();
-    
+
     $plaintext = trim($datetime).trim($USER->username).trim($LAMSCONSTANTS->learner_method).trim($CFG->lams_serverid).trim($CFG->lams_serverkey);
     $hash = sha1(strtolower($plaintext));
     $url = $CFG->lams_serverurl.$LAMSCONSTANTS->login_request.
index 4ce1c9262be0f681782e1103cd08c86fe01e1b11..d79107ca9a0c3e50aa716d54e97fdca5ed037dd6 100644 (file)
@@ -375,8 +375,9 @@ class resource_ims extends resource_base {
 
                 $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));
+
+                print_header($pagetitle, $course->fullname, $this->navigation, "", "", true,
+                        update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
             }
             print_simple_box_start('center', '60%');
             echo '<p align="center">'.$errortext.'</p>';
@@ -425,8 +426,11 @@ 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);
 
-            print_header($pagetitle, $course->fullname, "$this->navigation ".format_string($resource->name), "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
+            print_header($pagetitle, $course->fullname, $this->navigation, "", "", true,
+                    update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
 
             echo "\n<script type=\"text/javascript\">";
             echo "\n<!--\n";
@@ -612,7 +616,7 @@ class resource_ims extends resource_base {
 
         if (!isset($defaults['popup'])) {
             // use form defaults
-    
+
         } else if (!empty($defaults['popup'])) {
             $defaults['windowpopup'] = 1;
             if (array_key_exists('popup', $defaults)) {
@@ -676,7 +680,7 @@ class resource_ims extends resource_base {
         $mform->addElement('selectyesno', 'param_skipsubmenus', get_string('skipsubmenus', 'resource'));
         $mform->setDefault('param_skipsubmenus', 1);
         $mform->disabledIf('param_skipsubmenus', 'param_navigationmenu', 'eq', 1);
-        
+
         $mform->addElement('selectyesno', 'param_navigationupbutton', get_string('navigationup', 'resource'));
         $mform->setDefault('param_navigationupbutton', 1);
         $mform->disabledIf('param_navigationupbutton', 'param_navigationmenu', 'eq', 1);
index 18bc1d3325a05415b6b54f728ba0c42881dfd4a0..d25f1928fc9b44185abc31cc843775f1ea5648d7 100644 (file)
@@ -246,6 +246,8 @@ function display() {
     }
 
 
+    $this->navlinks[] = array('name' => format_string($resource->name), 'link' => null, 'type' => 'misc');
+    $this->navigation = build_navigation($this->navlinks);
 
 /// Form the parse string
     if (!empty($resource->alltext)) {
@@ -263,7 +265,7 @@ function display() {
 
     $inpopup = optional_param('inpopup', 0, PARAM_BOOL);
 
-       $fullurl =  $resource->reference. '&amp;HIVE_SESSION='.$SESSION->HIVE_SESSION;
+   $fullurl =  $resource->reference. '&amp;HIVE_SESSION='.$SESSION->HIVE_SESSION;
     if (!empty($querystring)) {
         $urlpieces = parse_url($resource->reference);
         if (empty($urlpieces['query'])) {
@@ -278,7 +280,8 @@ function display() {
         if ($inpopup) {
             print_header($pagetitle, $course->fullname);
         } else {
-            print_header($pagetitle, $course->fullname, "$this->navigation ".format_string($resource->name), "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
+            print_header($pagetitle, $course->fullname, $this->navigation, "", "", true,
+                    update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
         }
         notify('You do not have access to HarvestRoad Hive. This resource is unavailable.');
         if ($inpopup) {
@@ -296,7 +299,8 @@ function display() {
         if ($inpopup) {
             print_header($pagetitle, $course->fullname);
         } else {
-            print_header($pagetitle, $course->fullname, "$this->navigation ".format_string($resource->name), "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
+            print_header($pagetitle, $course->fullname, $this->navigation, "", "", true,
+                    update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
         }
         notify(get_string('notallowedlocalfileaccess', 'resource', ''));
         if ($inpopup) {
@@ -310,8 +314,8 @@ 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 ".format_string($resource->name), "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
+        print_header($pagetitle, $course->fullname, $this->navigation, "", "", true,
+                update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm));
 
 
         echo "\n<script type=\"text/javascript\">";
@@ -369,7 +373,8 @@ 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 ".format_string($resource->name), "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm, "parent"));
+        print_header($pagetitle, $course->fullname, $this->navigation, "", "", true,
+                update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm, "parent"));
 
         echo '<div class="summary">'.format_text($resource->summary, FORMAT_HTML, $formatoptions).'</div>';
         if (!empty($localpath)) {  // Show some help
@@ -390,7 +395,8 @@ function display() {
         if ($inpopup) {
             print_header($pagetitle);
         } else {
-            print_header($pagetitle, $course->fullname, "$this->navigation <a $CFG->frametarget title=\"$strdirectlink\" href=\"$fullurl\"> ".format_string($resource->name,true)."</a>", "", "", true, update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm, "self"));
+            print_header($pagetitle, $course->fullname, $this->navigation, "", "", true,
+                    update_module_button($cm->id, $course->id, $this->strresource), navmenu($course, $cm, "self"));
 
         }
 
index b323e98f26151f162d81ad7124453da264a79614..138c2184b7f7fde48a9207224d24a752b679f0ac 100644 (file)
@@ -83,7 +83,10 @@ function display() {
                 print_footer($course);
             } else {                           /// Make a page and a pop-up window
 
-                print_header($pagetitle, $course->fullname, "$this->navigation ".format_string($resource->name),
+                $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,
                         "", "", true, update_module_button($cm->id, $course->id, $this->strresource),
                         navmenu($course, $cm));
 
@@ -112,7 +115,7 @@ function display() {
             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);
-            
+
             print_header($pagetitle, $course->fullname, $this->navigation,
                     "", "", true, update_module_button($cm->id, $course->id, $this->strresource),
                     navmenu($course, $cm));
index 97526fd1800980df8f59085b0a48e646d8090d34..3ffb857a6f2927bba02293e2ca1d48b1bd2a677e 100644 (file)
@@ -2,7 +2,7 @@
 /**
 * Global Search Engine for Moodle
 * Michael Champanis (mchampan) [cynnical@gmail.com]
-* review 1.8+ : Valery Fremaux [valery.fremaux@club-internet.fr] 
+* review 1.8+ : Valery Fremaux [valery.fremaux@club-internet.fr]
 * 2007/08/02
 *
 * The query page - accepts a user-entered query string and returns results.
@@ -52,15 +52,15 @@ if ($check = search_check_php5()) {
     if ($pages && isset($_SESSION['search_advanced_query'])) {
         // if both are set, then we are busy browsing through the result pages of an advanced query
         $adv = unserialize($_SESSION['search_advanced_query']);
-    } 
+    }
     else if ($advanced) {
         // otherwise we are dealing with a new advanced query
         unset($_SESSION['search_advanced_query']);
         session_unregister('search_advanced_query');
-        
+
         // chars to strip from strings (whitespace)
         $chars = " \t\n\r\0\x0B,-+";
-        
+
         // retrieve advanced query variables
         $adv->mustappear  = trim(optional_param('mustappear', '', PARAM_CLEAN), $chars);
         $adv->notappear   = trim(optional_param('notappear', '', PARAM_CLEAN), $chars);
@@ -68,82 +68,84 @@ if ($check = search_check_php5()) {
         $adv->module      = optional_param('module', '', PARAM_CLEAN);
         $adv->title       = trim(optional_param('title', '', PARAM_CLEAN), $chars);
         $adv->author      = trim(optional_param('author', '', PARAM_CLEAN), $chars);
-    } 
+    }
 
     if ($advanced) {
         //parse the advanced variables into a query string
         //TODO: move out to external query class (QueryParse?)
-        
+
         $query_string = '';
-        
+
         // get all available module types
         $module_types = array_merge(array('all'), array_values(search_get_document_types()));
         $adv->module = in_array($adv->module, $module_types) ? $adv->module : 'all';
-        
+
         // convert '1 2' into '+1 +2' for required words field
         if (strlen(trim($adv->mustappear)) > 0) {
             $query_string  = ' +'.implode(' +', preg_split("/[\s,;]+/", $adv->mustappear));
-        } 
-        
+        }
+
         // convert '1 2' into '-1 -2' for not wanted words field
         if (strlen(trim($adv->notappear)) > 0) {
             $query_string .= ' -'.implode(' -', preg_split("/[\s,;]+/", $adv->notappear));
-        } 
-        
+        }
+
         // this field is left untouched, apart from whitespace being stripped
         if (strlen(trim($adv->canappear)) > 0) {
             $query_string .= ' '.implode(' ', preg_split("/[\s,;]+/", $adv->canappear));
-        } 
-        
+        }
+
         // add module restriction
         $doctypestr = get_string('doctype', 'search');
         $titlestr = get_string('title', 'search');
         $authorstr = get_string('author', 'search');
         if ($adv->module != 'all') {
             $query_string .= " +{$doctypestr}:".$adv->module;
-        } 
-        
+        }
+
         // create title search string
         if (strlen(trim($adv->title)) > 0) {
             $query_string .= " +{$titlestr}:".implode(" +{$titlestr}:", preg_split("/[\s,;]+/", $adv->title));
-        } 
-        
+        }
+
         // create author search string
         if (strlen(trim($adv->author)) > 0) {
             $query_string .= " +{$authorstr}:".implode(" +{$authorstr}:", preg_split("/[\s,;]+/", $adv->author));
-        } 
-        
+        }
+
         // save our options if the query is valid
         if (!empty($query_string)) {
             $_SESSION['search_advanced_query'] = serialize($adv);
-        } 
-    } 
+        }
+    }
 
     // normalise page number
     if ($page_number < 1) {
         $page_number = 1;
-    } 
+    }
 
     //run the query against the index
     $sq = new SearchQuery($query_string, $page_number, 10, false);
-} 
+}
 
 if (!$site = get_site()) {
     redirect("index.php");
-} 
+}
 
-$strsearch = get_string('search', 'search'); 
+$strsearch = get_string('search', 'search');
 $strquery  = get_string('enteryoursearchquery', 'search');
-
-print_header("$site->shortname: $strsearch: $strquery", "$site->fullname",
-               "<a href=\"index.php\">$strsearch</a> -> $strquery");
+$navlinks = array();
+$navlinks[] = array('name' => $strsearch, 'link' => "index.php", 'type' => 'misc');
+$navlinks[] = array('name' => $strquery, 'link' => null, 'type' => 'misc');
+$navigation = build_navigation($navlinks);
+print_header("$site->shortname: $strsearch: $strquery", "$site->fullname", $navigation);
 
 //keep things pretty, even if php5 isn't available
 if (!$check) {
     print_heading(search_check_php5(true));
     print_footer();
     exit(0);
-} 
+}
 
 print_box_start();
 print_heading($strquery);
@@ -155,20 +157,20 @@ $vars = get_object_vars($adv);
 if (isset($vars)) {
     foreach ($vars as $key => $value) {
         $adv->$key = stripslashes(htmlentities($value));
-    } 
+    }
 }
 ?>
 
 <form id="query" method="get" action="query.php">
-<?php 
-if (!$advanced) { 
+<?php
+if (!$advanced) {
 ?>
     <input type="text" name="query_string" length="50" value="<?php print stripslashes($query_string) ?>" />
     &nbsp;<input type="submit" value="<?php print_string('search', 'search') ?>" /> &nbsp;
     <a href="query.php?a=1"><?php print_string('advancedsearch', 'search') ?></a> |
     <a href="stats.php"><?php print_string('statistics', 'search') ?></a>
-<?php 
-} 
+<?php
+}
 else {
     print_box_start();
   ?>
@@ -195,7 +197,7 @@ else {
       <td><?php print_string('whichmodulestosearch?', 'search') ?>:</td>
       <td>
         <select name="module">
-<?php 
+<?php
     foreach($module_types as $mod) {
         if ($mod == $adv->module) {
             if ($mod != 'all'){
@@ -204,7 +206,7 @@ else {
             else{
                 print "<option value='$mod' selected=\"selected\">".get_string('all', 'search')."</option>\n";
             }
-        } 
+        }
         else {
             if ($mod != 'all'){
                 print "<option value='$mod'>".get_string('modulenameplural', $mod)."</option>\n";
@@ -212,8 +214,8 @@ else {
             else{
                 print "<option value='$mod'>".get_string('all', 'search')."</option>\n";
             }
-        } 
-    } 
+        }
+    }
 ?>
         </select>
       </td>
@@ -246,7 +248,7 @@ else {
     </table>
 <?php
     print_box_end();
-    } 
+    }
 ?>
 </form>
 <br/>
@@ -258,10 +260,10 @@ print_string('searching', 'search') . ': ';
 if ($sq->is_valid_index()) {
     //use cached variable to show up-to-date index size (takes deletions into account)
     print $CFG->search_index_size;
-} 
+}
 else {
     print "0";
-} 
+}
 
 print ' ';
 print_string('documents', 'search');
@@ -269,7 +271,7 @@ print '.';
 
 if (!$sq->is_valid_index() and isadmin()) {
     print '<p>' . get_string('noindexmessage', 'search') . '<a href="indexersplash.php">' . get_string('createanindex', 'search')."</a></p>\n";
-} 
+}
 
 ?>
 </div>
@@ -279,28 +281,28 @@ print_box_end();
 // prints all the results in a box
 if ($sq->is_valid()) {
     print_box_start();
-    
+
     search_stopwatch();
     $hit_count = $sq->count();
-    
+
     print "<br />";
-    
+
     print $hit_count.' '.get_string('resultsreturnedfor', 'search') . " '".stripslashes($query_string)."'.";
     print "<br />";
-    
+
     if ($hit_count > 0) {
         $page_links = $sq->page_numbers();
         $hits = $sq->results();
-        
+
         if ($advanced) {
             // if in advanced mode, search options are saved in the session, so
             // we can remove the query string var from the page links, and replace
             // it with a=1 (Advanced = on) instead
             $page_links = preg_replace("/query_string=[^&]+/", 'a=1', $page_links);
-        } 
-        
+        }
+
         print "<ol>";
-        
+
         $typestr = get_string('type', 'search');
         $scorestr = get_string('score', 'search');
         $authorstr = get_string('author', 'search');
@@ -315,17 +317,17 @@ if ($sq->is_valid()) {
                ."{$typestr}: ".$listing->doctype.", {$scorestr}: ".round($listing->score, 3).", {$authorstr}: ".$listing->author."\n"
                ."</li>\n";
         }
-        
+
         print "</ol>";
         print $page_links;
-    } 
+    }
 
     print_box_end();
 ?>
 <div align="center">
-<?php 
+<?php
     print_string('ittook', 'search');
-    search_stopwatch(); 
+    search_stopwatch();
     print_string('tofetchtheseresults', 'search');
 ?>.
 </div>
@@ -334,4 +336,4 @@ if ($sq->is_valid()) {
 }
 print_box_end();
 print_footer();
-?>
\ No newline at end of file
+?>
index 412205595b6832d76269e2c5b6f93ca88ebf8368..cd956e0ceed34cb6a9f9596d4e44f08505b8d1c1 100644 (file)
@@ -2,12 +2,12 @@
 /**
 * Global Search Engine for Moodle
 * Michael Champanis (mchampan) [cynnical@gmail.com]
-* review 1.8+ : Valery Fremaux [valery.fremaux@club-internet.fr] 
+* review 1.8+ : Valery Fremaux [valery.fremaux@club-internet.fr]
 * 2007/08/02
 *
 * Prints some basic statistics about the current index.
 * Does some diagnostics if you are logged in as an administrator.
-* 
+*
 */
 
 require_once('../config.php');
@@ -24,19 +24,22 @@ if (empty($CFG->enableglobalsearch)) {
 //check for php5, but don't die yet
 if ($check = search_check_php5()) {
     require_once("{$CFG->dirroot}/search/indexlib.php");
-    
+
     $indexinfo = new IndexInfo();
-} 
+}
 
 if (!$site = get_site()) {
     redirect("index.php");
-} 
+}
 
 $strsearch = get_string('search', 'search');
-$strquery  = get_string('statistics', 'search'); 
+$strquery  = get_string('statistics', 'search');
 
-print_header("$site->shortname: $strsearch: $strquery", "$site->fullname",
-           "<a href=\"index.php\">$strsearch</a> -> $strquery");
+$navlinks = array();
+$navlinks[] = array('name' => $strsearch, 'link' => "index.php", 'type' => 'misc');
+$navlinks[] = array('name' => $strquery, 'link' => null, 'type' => 'misc');
+$navigation = build_navigation($navlinks);
+print_header("$site->shortname: $strsearch: $strquery", "$site->fullname", $navigation);
 
 //keep things pretty, even if php5 isn't available
 if (!$check) {
@@ -69,7 +72,7 @@ if (isadmin()) {
     $checkdbadvicestr = get_string('checkdbadvice', 'search');
     $runindexerteststr = get_string('runindexertest', 'search');
     $runindexerstr = get_string('runindexer', 'search');
-    
+
     $admin_table->tablealign = "center";
     $admin_table->align = array ("right", "left");
     $admin_table->wrap = array ("nowrap", "nowrap");
@@ -83,36 +86,36 @@ if (isadmin()) {
 
     if ($indexinfo->time > 0) {
         $admin_table->data[] = array(get_string('createdon', 'search'), date('r', $indexinfo->time));
-    } 
+    }
     else {
         $admin_table->data[] = array(get_string('createdon', 'search'), '-');
-    } 
+    }
 
     if (!$indexinfo->valid($errors)) {
         $admin_table->data[] = array("<strong>{$errorsstr}</strong>", '&nbsp;');
         foreach ($errors as $key => $value) {
             $admin_table->data[] = array($key.' ... ', $value);
-        } 
+        }
     }
 
     print_table($admin_table);
     print_spacer(20);
     print_heading($solutionsstr);
-    
+
     unset($admin_table->data);
     if (isset($errors['dir'])) {
         $admin_table->data[] = array($checkdirstr, $checkdiradvicestr);
-    } 
+    }
     if (isset($errors['db'])) {
         $admin_table->data[] = array($checkdbstr, $checkdbadvicestr);
-    } 
-    
+    }
+
     $admin_table->data[] = array($runindexerteststr, '<a href="tests/index.php" target="_blank">tests/index.php</a>');
     $admin_table->data[] = array($runindexerstr, '<a href="indexersplash.php" target="_blank">indexersplash.php</a>');
-    
+
     print_table($admin_table);
     print_spacer(20);
-} 
+}
 
 //this is the standard summary table for normal users, shows document counts
 $table->tablealign = "center";
@@ -128,17 +131,17 @@ $table->data[] = array("<strong>{$databasestr}</strong>", "<em><strong>{$CFG->pr
 if (isadmin()) {
     //don't want to confuse users if the two totals don't match (hint: they should)
     $table->data[] = array($documentsinindexstr, $indexinfo->indexcount);
-    
+
     //*cough* they should match if deletions were actually removed from the index,
     //as it turns out, they're only marked as deleted and not returned in search results
     $table->data[] = array($deletionsinindexstr, (int)$indexinfo->indexcount - (int)$indexinfo->dbcount);
-} 
+}
 
 $table->data[] = array($documentsindatabasestr, $indexinfo->dbcount);
 
 foreach($indexinfo->types as $key => $value) {
     $table->data[] = array(get_string('documentsfor', 'search') . " '".get_string('modulenameplural', $key)."'", $value);
-} 
+}
 
 print_heading($databasestatestr);
 print_table($table);
index 2d29504181ce4fd33ec810400b75d9bbeba8d6f0..196b9454a35a5024ad2d3637b43cf6bf4d62f2aa 100644 (file)
     $strtheme = get_string("theme");
     $strthemesaved = get_string("themesaved");
 
-    print_header("$site->shortname: $strpreview", $site->fullname, "$strthemes -> $strpreview");
+    $navlinks = array();
+    $navlinks[] = array('name' => $strthemes, 'link' => null, 'type' => 'misc');
+    $navlinks[] = array('name' => $strpreview, 'link' => null, 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
+    print_header("$site->shortname: $strpreview", $site->fullname, $navigation);
 
     print_simple_box_start('center', '80%');
     print_heading($preview);
index 07adf8127d8a1663adf95463d3b06db1ff60f55a..587e83d7b7b4058450ef4ec36c7904a1577b3909 100644 (file)
@@ -1,89 +1,87 @@
-<?php  // $Id$\r
-require_once("../config.php");\r
-require_once($CFG->dirroot .'/notes/lib.php');\r
-\r
-$id    = required_param('id', PARAM_INT);              // course id\r
-$users = optional_param('userid', array(), PARAM_INT); // array of user id\r
-$contents = optional_param('contents', array(), PARAM_RAW); // array of user notes\r
-$states = optional_param('states', array(), PARAM_ALPHA); // array of notes states\r
-if (! $course = get_record('course', 'id', $id)) {\r
-    error("Course ID is incorrect");\r
-}\r
-\r
-$context = get_context_instance(CONTEXT_COURSE, $id);\r
-require_login($course->id);\r
-\r
-// to create notes the current user needs a capability\r
-require_capability('moodle/notes:manage', $context);\r
-\r
-if (!empty($users) && confirm_sesskey()) {\r
-    if (count($users) != count($contents) || count($users) != count($states)) {\r
-        error('Parameters malformation', $CFG->wwwroot.'/user/index.php?id='.$id);\r
-    }\r
-\r
-    $note = new object();\r
-    $note->courseid = $id;\r
-    $note->format = FORMAT_PLAIN;\r
-    foreach ($users as $k => $v) {\r
-        if(!$user = get_record('user', 'id', $v) || empty($contents[$k])) {\r
-            continue;\r
-        }\r
-        $note->id = 0;\r
-        $note->content = $contents[$k];\r
-        $note->publishstate = $states[$k];\r
-        $note->userid = $v;\r
-        if (note_save($note)) {\r
-            add_to_log($note->courseid, 'notes', 'add', 'index.php?course='.$note->courseid.'&amp;user='.$note->userid . '#note-' . $note->id , 'add note');\r
-        }\r
-    }\r
-    redirect("$CFG->wwwroot/user/index.php?id=$id");\r
-}\r
-\r
-/// Print headers\r
-\r
-$straddnote = get_string('addnewnote', 'notes');\r
-if ($course->id != SITEID) {\r
-    print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname,\r
-    "<a href=\"../course/view.php?id=$course->id\">$course->shortname</a> -> ".\r
-    $straddnote, "", "", true, "&nbsp;", navmenu($course));\r
-} else {\r
-    print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname,\r
-    $straddnote, "", "", true, "&nbsp;", navmenu($course));\r
-}\r
-\r
-// this will contain all available the based On select options, but we'll disable some on them on a per user basis\r
-\r
-print_heading($straddnote);\r
-echo '<form method="post" action="addnote.php">';\r
-echo '<input type="hidden" name="id" value="'.$course->id.'" />';\r
-echo '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />';\r
-$table->head  = array (get_string('fullname'), \r
-    get_string('content', 'notes') . helpbutton('writing', get_string('helpwriting'), 'moodle', true, false, '', true), \r
-    get_string('publishstate', 'notes') . helpbutton('status', get_string('publishstate', 'notes'), 'notes', true, false, '', true), \r
-    );\r
-$table->align = array ('left', 'center', 'center');\r
-$state_names = note_get_state_names();\r
-\r
-// the first time list hack\r
-if (empty($users)) {\r
-    foreach ($_POST as $k => $v) {\r
-        if (preg_match('/^user(\d+)$/',$k,$m)) {\r
-            $users[] = $m[1];\r
-        }\r
-    }\r
-}\r
-\r
-foreach ($users as $k => $v) {\r
-    if(!$user = get_record('user', 'id', $v)) {\r
-        continue;\r
-    }\r
-    $checkbox = choose_from_menu($state_names, 'states[' . $k . ']', empty($states[$k]) ? NOTES_STATE_PUBLIC : $states[$k], '', '', '0', true);\r
-    $table->data[] = array(\r
-        '<input type="hidden" name="userid['.$k.']" value="'.$v.'" />'. fullname($user, true),\r
-        '<textarea name="contents['. $k . ']" rows="2" cols="40">' . strip_tags(@$contents[$k]) . '</textarea>',\r
-        $checkbox\r
-    );\r
-}\r
-print_table($table);\r
-echo '<div style="width:100%;text-align:center;"><input type="submit" value="' . get_string('savechanges'). '" /></div></form>';\r
-print_footer($course);\r
+<?php  // $Id$
+require_once("../config.php");
+require_once($CFG->dirroot .'/notes/lib.php');
+
+$id    = required_param('id', PARAM_INT);              // course id
+$users = optional_param('userid', array(), PARAM_INT); // array of user id
+$contents = optional_param('contents', array(), PARAM_RAW); // array of user notes
+$states = optional_param('states', array(), PARAM_ALPHA); // array of notes states
+if (! $course = get_record('course', 'id', $id)) {
+    error("Course ID is incorrect");
+}
+
+$context = get_context_instance(CONTEXT_COURSE, $id);
+require_login($course->id);
+
+// to create notes the current user needs a capability
+require_capability('moodle/notes:manage', $context);
+
+if (!empty($users) && confirm_sesskey()) {
+    if (count($users) != count($contents) || count($users) != count($states)) {
+        error('Parameters malformation', $CFG->wwwroot.'/user/index.php?id='.$id);
+    }
+
+    $note = new object();
+    $note->courseid = $id;
+    $note->format = FORMAT_PLAIN;
+    foreach ($users as $k => $v) {
+        if(!$user = get_record('user', 'id', $v) || empty($contents[$k])) {
+            continue;
+        }
+        $note->id = 0;
+        $note->content = $contents[$k];
+        $note->publishstate = $states[$k];
+        $note->userid = $v;
+        if (note_save($note)) {
+            add_to_log($note->courseid, 'notes', 'add', 'index.php?course='.$note->courseid.'&amp;user='.$note->userid . '#note-' . $note->id , 'add note');
+        }
+    }
+    redirect("$CFG->wwwroot/user/index.php?id=$id");
+}
+
+/// Print headers
+
+$straddnote = get_string('addnewnote', 'notes');
+
+$navlinks = array();
+$navlinks[] = array('name' => $straddnote, 'link' => null, 'type' => 'misc');
+$navigation = build_navigation($navlinks);
+
+print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname, $navigation, "", "", true, "&nbsp;", navmenu($course));
+
+// this will contain all available the based On select options, but we'll disable some on them on a per user basis
+
+print_heading($straddnote);
+echo '<form method="post" action="addnote.php">';
+echo '<input type="hidden" name="id" value="'.$course->id.'" />';
+echo '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />';
+$table->head  = array (get_string('fullname'),
+    get_string('content', 'notes') . helpbutton('writing', get_string('helpwriting'), 'moodle', true, false, '', true),
+    get_string('publishstate', 'notes') . helpbutton('status', get_string('publishstate', 'notes'), 'notes', true, false, '', true),
+    );
+$table->align = array ('left', 'center', 'center');
+$state_names = note_get_state_names();
+
+// the first time list hack
+if (empty($users)) {
+    foreach ($_POST as $k => $v) {
+        if (preg_match('/^user(\d+)$/',$k,$m)) {
+            $users[] = $m[1];
+        }
+    }
+}
+
+foreach ($users as $k => $v) {
+    if(!$user = get_record('user', 'id', $v)) {
+        continue;
+    }
+    $checkbox = choose_from_menu($state_names, 'states[' . $k . ']', empty($states[$k]) ? NOTES_STATE_PUBLIC : $states[$k], '', '', '0', true);
+    $table->data[] = array(
+        '<input type="hidden" name="userid['.$k.']" value="'.$v.'" />'. fullname($user, true),
+        '<textarea name="contents['. $k . ']" rows="2" cols="40">' . strip_tags(@$contents[$k]) . '</textarea>',
+        $checkbox
+    );
+}
+print_table($table);
+echo '<div style="width:100%;text-align:center;"><input type="submit" value="' . get_string('savechanges'). '" /></div></form>';
+print_footer($course);
index 5b68cc6a2c65ca5a0e639a54d1331b78a5be1f29..8c593282624b8cc7cd3a5a8ee8b33faea71a0c48 100644 (file)
@@ -71,7 +71,7 @@
     //Load custom profile fields data
     profile_load_data($user);
 
-  
+
     //create form
     $userform = new user_edit_form();
     $userform->set_data($user);
 
         //update preferences
         useredit_update_user_preference($usernew);
-        
+
         //update interests
         if (!empty($CFG->usetags)) {
             useredit_update_interests($usernew, $usernew->interests);
         }
-        
+
         //update user picture
         if (!empty($CFG->gdversion) and empty($CFG->disableuserimages)) {
             useredit_update_picture($usernew, $userform);
     $streditmyprofile = get_string('editmyprofile');
     $strparticipants  = get_string('participants');
     $userfullname     = fullname($user, true);
-    if ($course->id != SITEID) {
-        print_header("$course->shortname: $streditmyprofile", "$course->fullname: $streditmyprofile",
-                     "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>
-                      -> <a href=\"index.php?id=$course->id\">$strparticipants</a>
-                      -> <a href=\"view.php?id=$user->id&amp;course=$course->id\">$userfullname</a>
-                      -> $streditmyprofile", "");
-    } else {
-        print_header("$course->shortname: $streditmyprofile", $course->fullname,
-                     "<a href=\"view.php?id=$user->id&amp;course=$course->id\">$userfullname</a>
-                      -> $streditmyprofile", "");
-    }
+
+    $navlinks = array();
+    $navlinks[] = array('name' => $strparticipants, 'link' => "index.php?id=$course->id", 'type' => 'misc');
+    $navlinks[] = array('name' => $userfullname,
+                        'link' => "view.php?id=$user->id&amp;course=$course->id",
+                        'type' => 'misc');
+    $navlinks[] = array('name' => $streditmyprofile, 'link' => null, 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
+    print_header("$course->shortname: $streditmyprofile", $course->fullname, $navigation, "");
+
     /// Print tabs at the top
     $showroles = 1;
     $currenttab = 'editprofile';
index a61b64b4369be78bb0540fa8254f551b2d83e52b..8bdcfa2d34b30d36cd21a101fd66afb90d4eaf25 100644 (file)
                     }
                 }
             }
-            
-            // MDL-9983   
+
+            // MDL-9983
             events_trigger('user_updated', $usernew);
         }
 
         $strparticipants  = get_string('participants');
         $strnewuser       = get_string('newuser');
         $userfullname     = fullname($user, true);
-        if ($course->id != SITEID) {
-            print_header("$course->shortname: $streditmyprofile", "$course->fullname: $streditmyprofile",
-                         "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a>
-                          -> <a href=\"index.php?id=$course->id\">$strparticipants</a>
-                          -> <a href=\"view.php?id=$user->id&amp;course=$course->id\">$userfullname</a>
-                          -> $streditmyprofile", "");
-        } else {
-            print_header("$course->shortname: $streditmyprofile", $course->fullname,
-                         "<a href=\"view.php?id=$user->id&amp;course=$course->id\">$userfullname</a>
-                          -> $streditmyprofile", "");
-        }
+
+        $navlinks = array();
+        $navlinks[] = array('name' => $strparticipants, 'link' => "index.php?id=$course->id", 'type' => 'misc');
+        $navlinks[] = array('name' => $userfullname,
+                            'link' => "view.php?id=$user->id&amp;course=$course->id",
+                            'type' => 'misc');
+        $navlinks[] = array('name' => $streditmyprofile, 'link' => null, 'type' => 'misc');
+        $navigation = build_navigation($navlinks);
+        print_header("$course->shortname: $streditmyprofile", $course->fullname, $navigation, "");
+
         /// Print tabs at the top
         $showroles = 1;
         $currenttab = 'editprofile';
index a13a226595ddaffafe7625a728a3f330226d651b..1adc0344bacbdf0b520ff55695b0aa8aff956529 100644 (file)
@@ -21,7 +21,7 @@ if ((count($users) > 0) and ($form = data_submitted()) and confirm_sesskey()) {
     }
 
     foreach ($form->userid as $k => $v) {
-        // find all roles this student have in this course  
+        // find all roles this student have in this course
         if ($students = get_records_sql("SELECT ra.id, ra.roleid, ra.timestart, ra.timeend
                                        FROM {$CFG->prefix}role_assignments ra
                                        WHERE userid = $v
@@ -69,7 +69,7 @@ if ((count($users) > 0) and ($form = data_submitted()) and confirm_sesskey()) {
                                     }
                                     break;
                             }
-                    } 
+                    }
                     role_assign($student->roleid, $v, 0, $context->id, $student->timestart, $student->timeend, 0);
                 }
             }
@@ -81,14 +81,11 @@ if ((count($users) > 0) and ($form = data_submitted()) and confirm_sesskey()) {
 
 /// Print headers
 
-if ($course->id != SITEID) {
-    print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname,
-    "<a href=\"../course/view.php?id=$course->id\">$course->shortname</a> -> ".
-    get_string('extendenrol'), "", "", true, "&nbsp;", navmenu($course));
-} else {
-    print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname,
-    get_string('extendenrol'), "", "", true, "&nbsp;", navmenu($course));
-}
+$navlinks = array();
+$navlinks[] = array('name' => get_string('extendenrol'), 'link' => null, 'type' => 'misc');
+$navigation = build_navigation($navlinks);
+
+print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname, $navigation, "", "", true, "&nbsp;", navmenu($course));
 
 $timeformat = get_string('strftimedate');
 $unlimited = get_string('unlimited');
@@ -126,9 +123,9 @@ $nochange = get_string('nochange');
 $notavailable = get_string('notavailable');
 foreach ($_POST as $k => $v) {
     if (preg_match('/^user(\d+)$/',$k,$m)) {
-        
-        if (!($user = get_record_sql("SELECT * FROM {$CFG->prefix}user u 
-                                    INNER JOIN {$CFG->prefix}role_assignments ra ON u.id=ra.userid 
+
+        if (!($user = get_record_sql("SELECT * FROM {$CFG->prefix}user u
+                                    INNER JOIN {$CFG->prefix}role_assignments ra ON u.id=ra.userid
                                     WHERE u.id={$m[1]} AND ra.contextid = $context->id"))) {
             continue;
         }
@@ -160,4 +157,4 @@ print_table($table);
 echo "\n<div style=\"width:100%;text-align:center;\"><input type=\"submit\" value=\"".get_string('savechanges')."\" /></div>\n</form>\n";
 
 print_footer($course);
-?>
\ No newline at end of file
+?>
index 4b88a9d1c583951e4fd642d0591d85e51d85ecf6..7c74af82f6e8035cb097e11b65054eed61e6b493 100644 (file)
@@ -1,94 +1,92 @@
-<?php  // $Id$\r
-require_once("../config.php");\r
-require_once($CFG->dirroot .'/notes/lib.php');\r
-\r
-$id    = required_param('id', PARAM_INT);              // course id\r
-$users = optional_param('userid', array(), PARAM_INT); // array of user id\r
-$content = optional_param('content', '', PARAM_RAW); // note content\r
-$state = optional_param('state', '', PARAM_ALPHA); // note publish state\r
-\r
-if (! $course = get_record('course', 'id', $id)) {\r
-    error("Course ID is incorrect");\r
-}\r
-\r
-$context = get_context_instance(CONTEXT_COURSE, $id);\r
-require_login($course->id);\r
-\r
-// to create notes the current user needs a capability\r
-require_capability('moodle/notes:manage', $context);\r
-\r
-if (!empty($users) && !empty($content) && confirm_sesskey()) {\r
-    $note = new object();\r
-    $note->courseid = $id;\r
-    $note->format = FORMAT_PLAIN;\r
-    $note->content = $content;\r
-    $note->publishstate = $state;\r
-    foreach ($users as $k => $v) {\r
-        if(!$user = get_record('user', 'id', $v)) {\r
-            continue;\r
-        }\r
-        $note->id = 0;\r
-        $note->userid = $v;\r
-        if (note_save($note)) {\r
-            add_to_log($note->courseid, 'notes', 'add', 'index.php?course='.$note->courseid.'&amp;user='.$note->userid . '#note-' . $note->id , 'add note');\r
-        }\r
-    }\r
-    \r
-    redirect("$CFG->wwwroot/user/index.php?id=$id");\r
-}\r
-\r
-/// Print headers\r
-\r
-$straddnote = get_string('groupaddnewnote', 'notes');\r
-if ($course->id != SITEID) {\r
-    print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname,\r
-    "<a href=\"../course/view.php?id=$course->id\">$course->shortname</a> -> ".\r
-    $straddnote, "", "", true, "&nbsp;", navmenu($course));\r
-} else {\r
-    print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname,\r
-    $straddnote, "", "", true, "&nbsp;", navmenu($course));\r
-}\r
-\r
-// this will contain all available the based On select options, but we'll disable some on them on a per user basis\r
-\r
-print_heading($straddnote);\r
-echo '<form method="post" action="groupaddnote.php" >';\r
-echo '<div style="width:100%;text-align:center;">';\r
-echo '<input type="hidden" name="id" value="'.$course->id.'" />';\r
-echo '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />';\r
-$state_names = note_get_state_names();\r
-\r
-// the first time list hack\r
-if (empty($users)) {\r
-    foreach ($_POST as $k => $v) {\r
-        if (preg_match('/^user(\d+)$/',$k,$m)) {\r
-            $users[] = $m[1];\r
-        }\r
-    }\r
-}\r
-\r
-$strpublishstate = get_string('publishstate', 'notes');\r
-\r
-$userlist = array();\r
-foreach ($users as $k => $v) {\r
-    if(!$user = get_record('user', 'id', $v)) {\r
-        continue;\r
-    }\r
-    echo '<input type="hidden" name="userid['.$k.']" value="'.$v.'" />';\r
-    $userlist[] = fullname($user, true);\r
-}\r
-echo '<p>';\r
-echo get_string('users'). ': ' . implode(', ', $userlist) . '.';\r
-echo '</p>';\r
-\r
-echo '<p>' . get_string('content', 'notes');\r
-helpbutton('writing', get_string('helpwriting'));\r
-echo '<br /><textarea name="content" rows="5" cols="50">' . strip_tags(@$content) . '</textarea></p>';\r
-\r
-echo '<p>' . $strpublishstate;\r
-helpbutton('status', $strpublishstate, 'notes');\r
-choose_from_menu($state_names, 'state', empty($state) ? NOTES_STATE_PUBLIC : $state, '');\r
-echo '</p>';\r
-\r
-echo '<input type="submit" value="' . get_string('savechanges'). '" /></div></form>';\r
-print_footer($course);\r
+<?php  // $Id$
+require_once("../config.php");
+require_once($CFG->dirroot .'/notes/lib.php');
+
+$id    = required_param('id', PARAM_INT);              // course id
+$users = optional_param('userid', array(), PARAM_INT); // array of user id
+$content = optional_param('content', '', PARAM_RAW); // note content
+$state = optional_param('state', '', PARAM_ALPHA); // note publish state
+
+if (! $course = get_record('course', 'id', $id)) {
+    error("Course ID is incorrect");
+}
+
+$context = get_context_instance(CONTEXT_COURSE, $id);
+require_login($course->id);
+
+// to create notes the current user needs a capability
+require_capability('moodle/notes:manage', $context);
+
+if (!empty($users) && !empty($content) && confirm_sesskey()) {
+    $note = new object();
+    $note->courseid = $id;
+    $note->format = FORMAT_PLAIN;
+    $note->content = $content;
+    $note->publishstate = $state;
+    foreach ($users as $k => $v) {
+        if(!$user = get_record('user', 'id', $v)) {
+            continue;
+        }
+        $note->id = 0;
+        $note->userid = $v;
+        if (note_save($note)) {
+            add_to_log($note->courseid, 'notes', 'add', 'index.php?course='.$note->courseid.'&amp;user='.$note->userid . '#note-' . $note->id , 'add note');
+        }
+    }
+
+    redirect("$CFG->wwwroot/user/index.php?id=$id");
+}
+
+/// Print headers
+
+$straddnote = get_string('groupaddnewnote', 'notes');
+
+$navlinks = array();
+$navlinks[] = array('name' => $straddnote, 'link' => null, 'type' => 'misc');
+$navigation = build_navigation($navlinks);
+
+print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname, $navigation, "", "", true, "&nbsp;", navmenu($course));
+
+// this will contain all available the based On select options, but we'll disable some on them on a per user basis
+
+print_heading($straddnote);
+echo '<form method="post" action="groupaddnote.php" >';
+echo '<div style="width:100%;text-align:center;">';
+echo '<input type="hidden" name="id" value="'.$course->id.'" />';
+echo '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />';
+$state_names = note_get_state_names();
+
+// the first time list hack
+if (empty($users)) {
+    foreach ($_POST as $k => $v) {
+        if (preg_match('/^user(\d+)$/',$k,$m)) {
+            $users[] = $m[1];
+        }
+    }
+}
+
+$strpublishstate = get_string('publishstate', 'notes');
+
+$userlist = array();
+foreach ($users as $k => $v) {
+    if(!$user = get_record('user', 'id', $v)) {
+        continue;
+    }
+    echo '<input type="hidden" name="userid['.$k.']" value="'.$v.'" />';
+    $userlist[] = fullname($user, true);
+}
+echo '<p>';
+echo get_string('users'). ': ' . implode(', ', $userlist) . '.';
+echo '</p>';
+
+echo '<p>' . get_string('content', 'notes');
+helpbutton('writing', get_string('helpwriting'));
+echo '<br /><textarea name="content" rows="5" cols="50">' . strip_tags(@$content) . '</textarea></p>';
+
+echo '<p>' . $strpublishstate;
+helpbutton('status', $strpublishstate, 'notes');
+choose_from_menu($state_names, 'state', empty($state) ? NOTES_STATE_PUBLIC : $state, '');
+echo '</p>';
+
+echo '<input type="submit" value="' . get_string('savechanges'). '" /></div></form>';
+print_footer($course);
index 18b6c78087fddbe00ef376e52c0235776605fe18..e941141f3825f6a4f66b2c558a21174463d1ce59 100755 (executable)
@@ -19,7 +19,7 @@ $today = make_timestamp(date('Y', $today), date('m', $today), date('d', $today),
 if ((count($users) > 0) and ($form = data_submitted()) and confirm_sesskey()) {
 
     foreach ($form->userid as $k => $v) {
-        // find all roles this student have in this course  
+        // find all roles this student have in this course
         if ($students = get_records_sql("SELECT ra.id, ra.roleid, ra.timestart, ra.timeend
                                        FROM {$CFG->prefix}role_assignments ra
                                        WHERE userid = $v
@@ -67,7 +67,7 @@ if ((count($users) > 0) and ($form = data_submitted()) and confirm_sesskey()) {
                                     }
                                     break;
                             }
-                    } 
+                    }
                     role_assign($student->roleid, $v, 0, $context->id, $student->timestart, $student->timeend, 0);
                 }
             }
@@ -79,14 +79,11 @@ if ((count($users) > 0) and ($form = data_submitted()) and confirm_sesskey()) {
 
 /// Print headers
 
-if ($course->id != SITEID) {
-    print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname,
-    "<a href=\"../course/view.php?id=$course->id\">$course->shortname</a> -> ".
-    get_string('extendenrol'), "", "", true, "&nbsp;", navmenu($course));
-} else {
-    print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname,
-    get_string('extendenrol'), "", "", true, "&nbsp;", navmenu($course));
-}
+$navlinks = array();
+$navlinks[] = array('name' => get_string('extendenrol'), 'link' => null, 'type' => 'misc');
+$navigation = build_navigation($navlinks);
+
+print_header("$course->shortname: ".get_string('extendenrol'), $course->fullname, $navigation, "", "", true, "&nbsp;", navmenu($course));
 
 $timeformat = get_string('strftimedate');
 $unlimited = get_string('unlimited');
@@ -124,9 +121,9 @@ $notavailable = get_string('notavailable');
 
 foreach ($_POST as $k => $v) {
     if (preg_match('/^user(\d+)$/',$k,$m)) {
-        
-        if (!($user = get_record_sql("SELECT * FROM {$CFG->prefix}user u 
-                                    INNER JOIN {$CFG->prefix}role_assignments ra ON u.id=ra.userid 
+
+        if (!($user = get_record_sql("SELECT * FROM {$CFG->prefix}user u
+                                    INNER JOIN {$CFG->prefix}role_assignments ra ON u.id=ra.userid
                                     WHERE u.id={$m[1]} AND ra.contextid = $context->id"))) {
             continue;
         }
@@ -158,4 +155,4 @@ echo '<input type="submit" value="'.get_string('savechanges').'" />';
 echo '</div></form>';
 
 print_footer($course);
-?>
\ No newline at end of file
+?>
index 1ccbd6d38ae5b2c2b65e2117f4b9ad2fa228aad5..865d84deba6db3533462305eec3660854e21cb4c 100644 (file)
@@ -52,9 +52,9 @@
     $avoidroles = array();
 
     if ($roles = get_roles_used_in_context($context, true)) {
-        // We should ONLY allow roles with moodle/course:view because otherwise we get little niggly issues 
+        // We should ONLY allow roles with moodle/course:view because otherwise we get little niggly issues
         // like MDL-8093
-        // We should further exclude "admin" users (those with "doanything" at site level) because 
+        // We should further exclude "admin" users (those with "doanything" at site level) because
         // Otherwise they appear in every participant list
 
         $canviewroles    = get_roles_with_capability('moodle/course:view', CAP_ALLOW, $context);
@@ -76,7 +76,7 @@
     }
 
     // no roles to display yet?
-    if (empty($rolenames)) {    
+    if (empty($rolenames)) {
         if (has_capability('moodle/user:assign', $context)) {
             redirect($CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$context->id);
         } else {
     $isseparategroups = ($course->groupmode == SEPARATEGROUPS and $course->groupmodeforce and
                          !has_capability('moodle/site:accessallgroups', $context));
 
-    if ($isseparategroups and (!$currentgroup) ) { 
-        print_header("$course->shortname: ".get_string('participants'), $course->fullname,
-                     "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> -> ".
-                     get_string('participants'), "", "", true, "&nbsp;", navmenu($course));
+    if ($isseparategroups and (!$currentgroup) ) {
+        $navlinks = array();
+        $navlinks[] = array('name' => get_string('participants'), 'link' => null, 'type' => 'misc');
+        $navigation = build_navigation($navlinks);
+
+        print_header("$course->shortname: ".get_string('participants'), $course->fullname, $navigation, "", "", true, "&nbsp;", navmenu($course));
         print_heading(get_string("notingroup", "forum"));
         print_footer($course);
         exit;
 
 /// Print headers
 
-    if ($course->id != SITEID) {
-        print_header("$course->shortname: ".get_string('participants'), $course->fullname,
-                     "<a href=\"../course/view.php?id=$course->id\">$course->shortname</a> -> ".
-                     get_string('participants'), "", "", true, "&nbsp;", navmenu($course));
-    } else {
-        print_header("$course->shortname: ".get_string('participants'), $course->fullname,
-                     get_string('participants'), "", "", true, "&nbsp;", navmenu($course));
-    }
-
+    $navlinks = array();
+    $navlinks[] = array('name' => get_string('participants'), 'link' => null, 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
 
+    print_header("$course->shortname: ".get_string('participants'), $course->fullname, $navigation, "", "", true, "&nbsp;", navmenu($course));
 
 /// setting up tags
     if ($course->id == SITEID) {
     $table->define_columns($tablecolumns);
     $table->define_headers($tableheaders);
     $table->define_baseurl($baseurl);
-    
+
     $table->sortable(true, 'lastaccess', SORT_DESC);
 
     $table->set_attribute('cellspacing', '0');
 
     $from   = "FROM {$CFG->prefix}user u INNER JOIN
     {$CFG->prefix}role_assignments r on u.id=r.userid LEFT OUTER JOIN
-    {$CFG->prefix}user_lastaccess ul on (r.userid=ul.userid and ul.courseid = $course->id)"; 
-    
-    $hiddensql = has_capability('moodle/role:viewhiddenassigns', $context)? '':' AND r.hidden = 0 ';   
+    {$CFG->prefix}user_lastaccess ul on (r.userid=ul.userid and ul.courseid = $course->id)";
+
+    $hiddensql = has_capability('moodle/role:viewhiddenassigns', $context)? '':' AND r.hidden = 0 ';
 
     // exclude users with roles we are avoiding
     if ($avoidroles) {
     } else {
         $adminroles = '';
     }
-    
+
     // join on 2 conditions
     // otherwise we run into the problem of having records in ul table, but not relevant course
     // and user record is not pulled out
 
         if (!empty($userlist))  {
             foreach ($userlist as $user) {
-                if ($user->hidden) {        
+                if ($user->hidden) {
                 // if the assignment is hidden, display icon
                     $hidden = "<img src=\"{$CFG->pixpath}/t/hide.gif\" alt=\"".get_string('hiddenassign')."\" class=\"hide-show-image\"/>";
                 } else {
-                    $hidden = '';  
+                    $hidden = '';
                 }
-                
+
                 if ($user->lastaccess) {
                     $lastaccess = format_time(time() - $user->lastaccess, $datestring);
                 } else {
                         $country = $countries[$user->country];
                     }
                 }
-                
+
                 $usercontext = get_context_instance(CONTEXT_USER, $user->id);
-                
+
                 if ($piclink = ($USER->id == $user->id || has_capability('moodle/user:viewdetails', $context) ||has_capability('moodle/user:viewdetails', $context))) {
                     $profilelink = '<strong><a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$course->id.'">'.fullname($user).'</a></strong>';
                 } else {
-                    $profilelink = '<strong>'.fullname($user).'</strong>';   
+                    $profilelink = '<strong>'.fullname($user).'</strong>';
                 }
-                               
+
                 $data = array (
                         print_user_picture($user->id, $course->id, $user->picture, false, true, $piclink),
                         $profilelink);
         }
         $displaylist['extendenrol.php'] = get_string('extendenrol');
         $displaylist['groupextendenrol.php'] = get_string('groupextendenrol');
-        
+
         helpbutton("participantswithselectedusers", get_string("withselectedusers"));
         choose_from_menu ($displaylist, "formaction", "", get_string("withselectedusers"), "if(checksubmit(this.form))this.form.submit();", "");
         echo '<input type="hidden" name="id" value="'.$course->id.'" />';
index a748189e004c10c774f8b1feb83a705e1487f985..49ee850d73b62d520e1c106932a0a687f26b3574 100644 (file)
 
     require_login();
     require_capability('moodle/site:readallmessages', get_context_instance(CONTEXT_COURSE, $id));
-    
+
     // fix for MDL-10112
     if (empty($CFG->messaging)) {
-        error("Messaging is disabled on this site");  
+        error("Messaging is disabled on this site");
     }
 
     if (empty($SESSION->emailto)) {
         $formstart = "";
     }
 
-    print_header($strtitle,$strtitle,"<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A> -> <a href=\"index.php?id=$course->id\">".get_string("participants")."</a> -> ".$strtitle,$formstart);
+    $navlinks = array();
+    $navlinks[] = array('name' => get_string('participants'), 'link' => "index.php?id=$course->id", 'type' => 'misc');
+    $navlinks[] = array('name' => $strtitle, 'link' => null, 'type' => 'misc');
+    $navigation = build_navigation($navlinks);
+
+    print_header($strtitle,$strtitle,$navigation,$formstart);
 
 
     if ($count) {
index be339d7506df4856ce89962a48d999b99a2960d6..e200d928968adc3b76233b4ba200404d989367a4 100644 (file)
@@ -33,7 +33,7 @@
     $strpolicyagreement = get_string('policyagreement');
     $strpolicyagreementclick = get_string('policyagreementclick');
 
-    print_header($strpolicyagreement, $SITE->fullname, $strpolicyagreement);
+    print_header($strpolicyagreement, $SITE->fullname, build_navigation(array(array('name'=>$strpolicyagreement, 'link'=>null, 'type'=>'misc'))));
 
     print_heading($strpolicyagreement);
 
index ddf427e281dcede83c1b336c1a229a2493ea9b1c..672acce7ac9ac6ade398827608113621dd52527f 100644 (file)
@@ -1,11 +1,11 @@
 <?PHP // $Id$
 
 //  Display profile for a particular user
-    
+
     require_once("../config.php");
     require_once($CFG->dirroot.'/user/profile/lib.php');
     require_once($CFG->dirroot.'/tag/lib.php');
-    
+
     $id      = optional_param('id',     0,      PARAM_INT);   // user id
     $course  = optional_param('course', SITEID, PARAM_INT);   // course id (defaults to Site)
     $enable  = optional_param('enable', '');                  // enable email
     }
     $usercontext   = get_context_instance(CONTEXT_USER, $user->id);       // User context
     $systemcontext = get_context_instance(CONTEXT_SYSTEM);   // SYSTEM context
-    
+
     if (!empty($CFG->forcelogin) || $course->id != SITEID) {
         // do not force parents to enrol
         if (!get_record('role_assignments', 'userid', $USER->id, 'contextid', $usercontext->id)) {
             require_login($course->id);
         }
     }
-    
+
     // make sure user can view this student's profile
-    if ($USER->id != $user->id 
-        && !has_capability('moodle/user:viewdetails', $coursecontext) 
+    if ($USER->id != $user->id
+        && !has_capability('moodle/user:viewdetails', $coursecontext)
         && !has_capability('moodle/user:viewdetails', $usercontext)) {
         error('You can not view the profile of this user');
     }
 
     $fullname = fullname($user, has_capability('moodle/site:viewfullnames', $coursecontext));
 
+    $navlinks = array();
+    $navlinks[] = array('name' => $strparticipants, 'link' => "index.php?id=$course->id", 'type' => 'misc');
+
 /// If the user being shown is not ourselves, then make sure we are allowed to see them!
 
     if (!$currentuser) {
         if ($course->id == SITEID) {  // Reduce possibility of "browsing" userbase at site level
-            if ($CFG->forceloginforprofiles and !isteacherinanycourse() and !isteacherinanycourse($user->id) and !has_capability('moodle/user:viewdetails', $usercontext)) {  // Teachers can browse and be browsed at site level. If not forceloginforprofiles, allow access (bug #4366)
-                print_header("$strpersonalprofile: ", "$strpersonalprofile: ",
-                              "<a href=\"index.php?id=$course->id\">$strparticipants</a> -> $struser",
-                              "", "", true, "&nbsp;", navmenu($course));
+            if ($CFG->forceloginforprofiles and !isteacherinanycourse()
+                    and !isteacherinanycourse($user->id)
+                    and !has_capability('moodle/user:viewdetails', $usercontext)) {  // Teachers can browse and be browsed at site level. If not forceloginforprofiles, allow access (bug #4366)
+
+                $navlinks[] = array('name' => $struser, 'link' => null, 'type' => 'misc');
+                $navigation = build_navigation($navlinks);
+
+                print_header("$strpersonalprofile: ", "$strpersonalprofile: ", $navigation, "", "", true, "&nbsp;", navmenu($course));
                 print_heading(get_string('usernotavailable', 'error'));
                 print_footer($course);
                 exit;
         } else {   // Normal course
             if (!has_capability('moodle/course:view', $coursecontext, $user->id, false)) {
                 if (has_capability('moodle/course:view', $coursecontext)) {
-                    print_header("$strpersonalprofile: ", "$strpersonalprofile: ",
-                                     "<a href=\"../course/view.php?id=$course->id\">$course->shortname</a> ->
-                                  <a href=\"index.php?id=$course->id\">$strparticipants</a> -> $fullname",
-                                  "", "", true, "&nbsp;", navmenu($course));
+                    $navlinks[] = array('name' => $fullname, 'link' => null, 'type' => 'misc');
+                    $navigation = build_navigation($navlinks);
+                    print_header("$strpersonalprofile: ", "$strpersonalprofile: ", $navigation, "", "", true, "&nbsp;", navmenu($course));
                     print_heading(get_string('notenrolled', '', $fullname));
                 } else {
-                    print_header("$strpersonalprofile: ", "$strpersonalprofile: ",
-                                     "<a href=\"../course/view.php?id=$course->id\">$course->shortname</a> ->
-                                  <a href=\"index.php?id=$course->id\">$strparticipants</a> -> $struser",
-                                  "", "", true, "&nbsp;", navmenu($course));
+                    $navlinks[] = array('name' => $struser, 'link' => null, 'type' => 'misc');
+                    $navigation = build_navigation($navlinks);
+                    print_header("$strpersonalprofile: ", "$strpersonalprofile: ", $navigation, "", "", true, "&nbsp;", navmenu($course));
                     print_heading(get_string('notenrolledprofile'));
                 }
                 print_continue($_SERVER['HTTP_REFERER']);
         // If groups are in use, make sure we can see that group
         if (groupmode($course) == SEPARATEGROUPS and !has_capability('moodle/site:accessallgroups', $coursecontext)) {
             require_login();
-    
+
             ///this is changed because of mygroupid
             $gtrue = (bool)groups_get_all_groups($course->id, $user->id);
             if (!$gtrue) {
-                print_header("$strpersonalprofile: ", "$strpersonalprofile: ",
-                             "<a href=\"../course/view.php?id=$course->id\">$course->shortname</a> ->
-                              <a href=\"index.php?id=$course->id\">$strparticipants</a>",
-                              "", "", true, "&nbsp;", navmenu($course));
+                $navigation = build_navigation($navlinks);
+                print_header("$strpersonalprofile: ", "$strpersonalprofile: ", $navigation, "", "", true, "&nbsp;", navmenu($course));
                 error(get_string("groupnotamember"), "../course/view.php?id=$course->id");
             }
         }
     }
-  
+
 
 /// We've established they can see the user's name at least, so what about the rest?
 
-    if ($course->id != SITEID) {
-        print_header("$strpersonalprofile: $fullname", "$strpersonalprofile: $fullname",
-                     "<a href=\"../course/view.php?id=$course->id\">$course->shortname</a> ->
-                      <a href=\"index.php?id=$course->id\">$strparticipants</a> -> $fullname",
-                      "", "", true, "&nbsp;", navmenu($course));
-    } else {
-        print_header("$course->fullname: $strpersonalprofile: $fullname", $course->fullname,
-                     "$fullname", "", "", true, "&nbsp;", navmenu($course));
-    }
+    $navlinks[] = array('name' => $fullname, 'link' => null, 'type' => 'misc');
+
+    $navigation = build_navigation($navlinks);
+
+    print_header("$course->fullname: $strpersonalprofile: $fullname", $course->fullname,
+                 $navigation, "", "", true, "&nbsp;", navmenu($course));
 
 
     if (($course->id != SITEID) and ! isguest() ) {   // Need to have access to a course to see that info
 
     if (is_mnet_remote_user($user)) {
         $sql = "
-             SELECT DISTINCT 
-                 h.id, 
+             SELECT DISTINCT
+                 h.id,
                  h.name,
                  h.wwwroot,
                  a.name as application,
                  a.display_name
-             FROM 
+             FROM
                  {$CFG->prefix}mnet_host h,
                  {$CFG->prefix}mnet_application a
              WHERE
                  h.name";
 
         $remotehost = get_record_sql($sql);
-        
+
         echo '<p class="errorboxcontent">'.get_string('remote'.$remotehost->application.'user')." <br />\n";
         if ($USER->id == $user->id) {
             if ($remotehost->application =='moodle') {
     }
 
     if ($user->skype && !isset($hiddenfields['skypeid'])) {
-        print_row(get_string('skypeid').':','<a href="callto:'.urlencode($user->skype).'">'.s($user->skype). 
+        print_row(get_string('skypeid').':','<a href="callto:'.urlencode($user->skype).'">'.s($user->skype).
             ' <img src="http://mystatus.skype.com/smallicon/'.urlencode($user->skype).'" alt="'.get_string('status').'" '.
             ' /></a>');
     }
         print_row(get_string("lastaccess").":", $datestring);
     }
 /// printing roles
-    
+
     if ($rolestring = get_user_roles_in_context($id, $coursecontext->id)) {
         print_row(get_string('roles').':', format_string($rolestring, false));
     }
 /// Printing Interests
        if( !empty($CFG->usetags)) {
            $interests = get_item_tags('user', $user->id);
-    
+
         $instereststr = tag_links_csv($interests);
-    
+
         if ($interests) {
             print_row(get_string('interests').": ",rtrim($instereststr));
         }
     }
-/// End of Printing Interests    
+/// End of Printing Interests
 
     echo "</table>";
 
index 865c162447a98d18fc82db58ada4c88d0c6b5cfa..72d75ea47f685db89bd9bd751dd6de6d76560bac 100644 (file)
@@ -1,6 +1,6 @@
 <?php // $Id$
       // This simple script displays all the users with pictures on one page.
-      // By default it is not linked anywhere on the site.  If you want to 
+      // By default it is not linked anywhere on the site.  If you want to
       // make it available you should link it in yourself from somewhere.
       // Remember also to comment or delete the lines restricting access
       // to administrators only (see below)
     if (!$users = get_records("user", "picture", "1", "lastaccess DESC", "id,firstname,lastname")) {
         error("no users!");
     }
-    
+
     $title = get_string("users");
-    
-    print_header($title, $title, $title);
-    
+
+    print_header($title, $title, build_navigation(array(array('name' => $title, 'link' => null, 'type' => 'misc'))));
+
     foreach ($users as $user) {
         $fullname = fullname($user);
         echo "<a href=\"$CFG->wwwroot/user/view.php?id=$user->id&amp;course=1\"".
@@ -34,7 +34,7 @@
         }
         echo "</a> \n";
     }
-    
+
     print_footer();
 
 ?>
index c423181cb59c6e5dd1567dc119effe175596367b..161499d8452febd306da0a65e80d905261af2fa3 100644 (file)
@@ -8,15 +8,15 @@
     require_login();
 
     require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM, SITEID));
-    
+
     if (!$users = get_records("user", "picture", "1", "lastaccess DESC", "id,firstname,lastname")) {
         error("no users!");
     }
-    
+
     $title = get_string("users");
-    
-    print_header($title, $title, $title);
-    
+
+    print_header($title, $title, build_navigation(array(array('name' => $title, 'link' => null, 'type' => 'misc'))));
+
     foreach ($users as $user) {
         upgrade_profile_image($user->id);
         $fullname = fullname($user);
@@ -31,7 +31,7 @@
         }
         echo "</a> \n";
     }
-    
+
     print_footer();
 
 ?>