]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-10723 Removed all uses of print_navigation() throughout moodle, the function...
authornicolasconnault <nicolasconnault>
Fri, 24 Aug 2007 04:22:30 +0000 (04:22 +0000)
committernicolasconnault <nicolasconnault>
Fri, 24 Aug 2007 04:22:30 +0000 (04:22 +0000)
23 files changed:
index.php
lib/deprecatedlib.php
lib/moodlelib.php
lib/weblib.php
theme/chameleon/header.html
theme/cornflower/footer.html
theme/cornflower/header.html
theme/custom_corners/header.html
theme/formal_white/footer.html
theme/formal_white/header.html
theme/metal/header.html
theme/oceanblue/footer.html
theme/oceanblue/header.html
theme/orangewhite/header.html
theme/orangewhitepda/header.html
theme/standard/footer.html
theme/standard/header.html
theme/standardblue/header.html
theme/standardgreen/header.html
theme/standardlogo/header.html
theme/standardred/header.html
theme/standardwhite/header.html
theme/wood/header.html

index bd2706abf34d365485a5426859b991a437c8254c..a9aaa38ca37eed7c83cbb2362256afa4e346b6fe 100644 (file)
--- a/index.php
+++ b/index.php
     require_once('config.php');
     require_once($CFG->dirroot .'/course/lib.php');
     require_once($CFG->dirroot .'/lib/blocklib.php');
-    
+
     if (!empty($THEME->customcorners)) {
         require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
     }
-    
+
     if (empty($SITE)) {
         redirect($CFG->wwwroot .'/'. $CFG->admin .'/index.php');
     }
@@ -81,7 +81,7 @@
     }
 
 
-    if (get_moodle_cookie() == '') {   
+    if (get_moodle_cookie() == '') {
         set_moodle_cookie('nobody');   // To help search for cookies on login page
     }
 
     $PAGE       = page_create_object(PAGE_COURSE_VIEW, SITEID);
     $pageblocks = blocks_setup($PAGE);
     $editing    = $PAGE->user_is_editing();
-    $preferred_width_left  = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),  
+    $preferred_width_left  = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),
                                             BLOCK_L_MAX_WIDTH);
-    $preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), 
+    $preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]),
                                             BLOCK_R_MAX_WIDTH);
 
-    print_header($SITE->fullname, $SITE->fullname, 'home', '',
+    $navigation = build_navigation(array(array('name' => get_string('home'), 'link'=> null, 'type' => 'misc')));
+    print_header($SITE->fullname, $SITE->fullname, $navigation, '',
                  '<meta name="description" content="'. s(strip_tags($SITE->summary)) .'" />',
                  true, '', user_login_string($SITE).$langmenu);
 
 
             get_all_mods($SITE->id, $mods, $modnames, $modnamesplural, $modnamesused);
             print_section($SITE, $section, $mods, $modnamesused, true);
-    
+
             if ($editing) {
                 print_section_add_menus($SITE, $section->section, $modnames);
             }
index 6fdf860bebded7edf4b088a3b13f66f7690215ff..1141ddaa2176c3a1c23be359b3a194ca706e1469 100644 (file)
@@ -119,8 +119,8 @@ function isadmin($userid=0) {
         return record_exists('user_admins', 'userid', $userid);
     }
 
-    $context = get_context_instance(CONTEXT_SYSTEM, SITEID);  
-    
+    $context = get_context_instance(CONTEXT_SYSTEM, SITEID);
+
     return has_capability('moodle/legacy:admin', $context, $userid, false);
 }
 
@@ -145,7 +145,7 @@ function isteacher($courseid=0, $userid=0, $obsolete_includeadmin=true) {
     if ($courseid) {
         $context = get_context_instance(CONTEXT_COURSE, $courseid);
     } else {
-        $context = get_context_instance(CONTEXT_SYSTEM, SITEID);  
+        $context = get_context_instance(CONTEXT_SYSTEM, SITEID);
     }
 
     return (has_capability('moodle/legacy:teacher', $context, $userid, false)
@@ -199,7 +199,7 @@ function isteacherinanycourse($userid=0, $includeadmin=true) {
 
 /// Include admins if required
     if ($includeadmin) {
-        $context = get_context_instance(CONTEXT_SYSTEM, SITEID);  
+        $context = get_context_instance(CONTEXT_SYSTEM, SITEID);
         if (has_capability('moodle/legacy:admin', $context, $userid, false)) {
             return true;
         }
@@ -223,7 +223,7 @@ function isteacheredit($courseid, $userid=0, $obsolete_ignorestudentview=false)
     }
 
     if (empty($courseid)) {
-        $context = get_context_instance(CONTEXT_SYSTEM, SITEID);  
+        $context = get_context_instance(CONTEXT_SYSTEM, SITEID);
     } else {
         $context = get_context_instance(CONTEXT_COURSE, $courseid);
     }
@@ -245,7 +245,7 @@ function iscreator ($userid=0) {
         return false;
     }
 
-    $context = get_context_instance(CONTEXT_SYSTEM, SITEID);  
+    $context = get_context_instance(CONTEXT_SYSTEM, SITEID);
 
     return (has_capability('moodle/legacy:coursecreator', $context, $userid, false)
          or has_capability('moodle/legacy:admin', $context, $userid, false));
@@ -271,7 +271,7 @@ function isstudent($courseid=0, $userid=0) {
     }
 
     if ($courseid == 0) {
-        $context = get_context_instance(CONTEXT_SYSTEM, SITEID);  
+        $context = get_context_instance(CONTEXT_SYSTEM, SITEID);
     } else {
         $context = get_context_instance(CONTEXT_COURSE, $courseid);
     }
@@ -292,7 +292,7 @@ function isguest($userid=0) {
         return false;
     }
 
-    $context = get_context_instance(CONTEXT_SYSTEM);  
+    $context = get_context_instance(CONTEXT_SYSTEM);
 
     return has_capability('moodle/legacy:guest', $context, $userid, false);
 }
@@ -341,7 +341,7 @@ function enrol_student($userid, $courseid, $timestart=0, $timeend=0, $enrol='man
  */
 function unenrol_student($userid, $courseid=0) {
     global $CFG;
-    
+
     $status = true;
 
     if ($courseid) {
@@ -376,7 +376,7 @@ function unenrol_student($userid, $courseid=0) {
 }
 
 /**
- * Add a teacher to a given course  
+ * Add a teacher to a given course
  *
  * @param int $userid The id of the user that is being tested against. Set this to 0 if you would just like to test against the currently logged in user.
  * @param int $courseid The id of the course that is being viewed, if any
@@ -536,7 +536,7 @@ function get_teacher($courseid) {
 function get_recent_enrolments($courseid, $timestart) {
 
     global $CFG;
-    
+
     $context = get_context_instance(CONTEXT_COURSE, $courseid);
 
     return get_records_sql("SELECT DISTINCT u.id, u.firstname, u.lastname, l.time
@@ -581,9 +581,9 @@ function get_course_students($courseid, $sort='ul.timeaccess', $dir='', $page=''
     // make sure it works on the site course
     $context = get_context_instance(CONTEXT_COURSE, $courseid);
 
-    /// For the site course, old way was to check if $CFG->allusersaresitestudents was set to true. 
+    /// For the site course, old way was to check if $CFG->allusersaresitestudents was set to true.
     /// The closest comparible method using roles is if the $CFG->defaultuserroleid is set to the legacy
-    /// student role. This function should be replaced where it is used with something more meaningful. 
+    /// student role. This function should be replaced where it is used with something more meaningful.
     if (($courseid == SITEID) && !empty($CFG->defaultuserroleid) && empty($CFG->nodefaultuserrolelists)) {
         if ($roles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW, $context)) {
             $hascap = false;
@@ -604,15 +604,15 @@ function get_course_students($courseid, $sort='ul.timeaccess', $dir='', $page=''
                     $sort = $sort .' '. $dir;
                 }
                 // Now we have to make sure site teachers are excluded
-        
+
                 if ($teachers = get_course_teachers(SITEID)) {
                     foreach ($teachers as $teacher) {
                         $exceptions .= ','. $teacher->userid;
                     }
-                    $exceptions = ltrim($exceptions, ','); 
-                  
-                }        
-        
+                    $exceptions = ltrim($exceptions, ',');
+
+                }
+
                 return get_users(true, $search, true, $exceptions, $sort, $firstinitial, $lastinitial,
                                   $page, $recordsperpage, $fields ? $fields : '*');
             }
@@ -629,7 +629,7 @@ function get_course_students($courseid, $sort='ul.timeaccess', $dir='', $page=''
         // If not site, require specific course
         $select.= "c.instanceid=$courseid AND ";
     }
-    $select.="rc.capability='moodle/legacy:student' AND rc.permission=".CAP_ALLOW." AND "; 
+    $select.="rc.capability='moodle/legacy:student' AND rc.permission=".CAP_ALLOW." AND ";
 
     $select .= ' u.deleted = \'0\' ';
 
@@ -675,7 +675,7 @@ function get_course_students($courseid, $sort='ul.timeaccess', $dir='', $page=''
                                      {$CFG->prefix}context c ON c.id=ra.contextid LEFT OUTER JOIN
                                      {$CFG->prefix}user_lastaccess ul on ul.userid=ra.userid
                                      $groupmembers
-                                WHERE $select $search $sort $dir", $page, $recordsperpage); 
+                                WHERE $select $search $sort $dir", $page, $recordsperpage);
 
     return $students;
 }
@@ -685,10 +685,10 @@ function get_course_students($courseid, $sort='ul.timeaccess', $dir='', $page=''
  *
  * @param object $course The course in question as a course object.
  * @param string $search ?
- * @param string $firstinitial ? 
+ * @param string $firstinitial ?
  * @param string $lastinitial ?
  * @param ? $group ?
- * @param string $exceptions ? 
+ * @param string $exceptions ?
  * @return int
  * @todo Finish documenting this function
  */
@@ -709,21 +709,21 @@ function count_course_students($course, $search='', $firstinitial='', $lastiniti
  * @uses $CFG
  * @param int $courseid The course in question.
  * @param string $sort ?
- * @param string $exceptions ? 
+ * @param string $exceptions ?
  * @return object
  * @todo Finish documenting this function
  */
 function get_course_teachers($courseid, $sort='t.authority ASC', $exceptions='') {
 
     global $CFG;
-    
+
     $sort = 'ul.timeaccess DESC';
-    
+
     $context = get_context_instance(CONTEXT_COURSE, $courseid);
 
     /// For the site course, if the $CFG->defaultuserroleid is set to the legacy teacher role, then all
-    /// users are teachers. This function should be replaced where it is used with something more 
-    /// meaningful. 
+    /// users are teachers. This function should be replaced where it is used with something more
+    /// meaningful.
     if (($courseid == SITEID) && !empty($CFG->defaultuserroleid) && empty($CFG->nodefaultuserrolelists)) {
         if ($roles = get_roles_with_capability('moodle/legacy:teacher', CAP_ALLOW, $context)) {
             $hascap = false;
@@ -771,7 +771,7 @@ function get_course_users($courseid, $sort='ul.timeaccess DESC', $exceptions='',
     $context = get_context_instance(CONTEXT_COURSE, $courseid);
 
     /// If the course id is the SITEID, we need to return all the users if the "defaultuserroleid"
-    /// has the capbility of accessing the site course. $CFG->nodefaultuserrolelists set to true can 
+    /// has the capbility of accessing the site course. $CFG->nodefaultuserrolelists set to true can
     /// over-rule using this.
     if (($courseid == SITEID) && !empty($CFG->defaultuserroleid) && empty($CFG->nodefaultuserrolelists)) {
         if ($roles = get_roles_with_capability('moodle/course:view', CAP_ALLOW, $context)) {
@@ -803,7 +803,7 @@ function get_course_users($courseid, $sort='ul.timeaccess DESC', $exceptions='',
  * @return object (changed to groupids)
  */
 function get_group_students($groupids, $sort='ul.timeaccess DESC') {
-    
+
     if (is_array($groupids)){
         $groups = $groupids;
         // all groups must be from one course anyway...
@@ -850,7 +850,7 @@ function get_group_teachers($courseid, $groupid) {
 
 /**
  * Print a message in a standard themed box.
- * This old function used to implement boxes using tables.  Now it uses a DIV, but the old 
+ * This old function used to implement boxes using tables.  Now it uses a DIV, but the old
  * parameters remain.  If possible, $align, $width and $color should not be defined at all.
  * Preferably just use print_box() in weblib.php
  *
@@ -878,7 +878,7 @@ function print_simple_box($message, $align='', $width='', $color='', $padding=5,
 
 
 /**
- * This old function used to implement boxes using tables.  Now it uses a DIV, but the old 
+ * This old function used to implement boxes using tables.  Now it uses a DIV, but the old
  * parameters remain.  If possible, $align, $width and $color should not be defined at all.
  * Even better, please use print_box_start() in weblib.php
  *
@@ -1078,7 +1078,7 @@ function groups_members_from_sql() {
  * @param group ID, optional to include a test for this in the SQL.
  * @return SQL string.
  */
-function groups_members_join_sql($groupid=false) {    
+function groups_members_join_sql($groupid=false) {
     $sql = ' JOIN '.groups_members_from_sql().' ON u.id = gm.userid ';
     if ($groupid) {
         $sql = "AND gm.groupid = '$groupid' ";
@@ -1090,7 +1090,7 @@ function groups_members_join_sql($groupid=false) {
 
 /**
  * Returns SQL for a WHERE clause testing the group ID.
- * Optionally test the member's ID against another table's user ID column. 
+ * Optionally test the member's ID against another table's user ID column.
  * @param groupid
  * @param userid_sql Optional user ID column selector, example "mdl_user.id", or false.
  * @return SQL string.
@@ -1162,7 +1162,7 @@ function mygroupid($courseid) {
 }
 
 /**
- * Add a user to a group, return true upon success or if user already a group 
+ * Add a user to a group, return true upon success or if user already a group
  * member
  *
  * @param int $groupid  The group id to add user to
@@ -1187,7 +1187,7 @@ function add_user_to_group($groupid, $userid) {
  * @return object
  * @todo Finish documenting this function
  */
-function get_group_users($groupid, $sort='u.lastaccess DESC', $exceptions='', 
+function get_group_users($groupid, $sort='u.lastaccess DESC', $exceptions='',
                          $fields='u.*') {
     global $CFG;
     if (!empty($exceptions)) {
@@ -1212,7 +1212,7 @@ function get_group_users($groupid, $sort='u.lastaccess DESC', $exceptions='',
 
 /**
  * Returns the current group mode for a given course or activity module
- * 
+ *
  * Could be false, SEPARATEGROUPS or VISIBLEGROUPS    (<-- Martin)
  */
 function groupmode($course, $cm=null) {
@@ -1226,11 +1226,11 @@ function groupmode($course, $cm=null) {
 
 /**
  * Sets the current group in the session variable
- * When $SESSION->currentgroup[$courseid] is set to 0 it means, show all groups. 
+ * When $SESSION->currentgroup[$courseid] is set to 0 it means, show all groups.
  * Sets currentgroup[$courseid] in the session variable appropriately.
- * Does not do any permission checking. 
+ * Does not do any permission checking.
  * @uses $SESSION
- * @param int $courseid The course being examined - relates to id field in 
+ * @param int $courseid The course being examined - relates to id field in
  * 'course' table.
  * @param int $groupid The group being examined.
  * @return int Current group id which was set by this function
@@ -1242,13 +1242,13 @@ function set_current_group($courseid, $groupid) {
 
 
 /**
- * Gets the current group - either from the session variable or from the database. 
+ * Gets the current group - either from the session variable or from the database.
  *
  * @uses $USER
  * @uses $SESSION
- * @param int $courseid The course being examined - relates to id field in 
+ * @param int $courseid The course being examined - relates to id field in
  * 'course' table.
- * @param bool $full If true, the return value is a full record object. 
+ * @param bool $full If true, the return value is a full record object.
  * If false, just the id of the record.
  */
 function get_current_group($courseid, $full = false) {
@@ -1297,7 +1297,7 @@ function get_current_group($courseid, $full = false) {
  */
 function get_and_set_current_group($course, $groupmode, $groupid=-1) {
 
-    // Sets to the specified group, provided the current user has view permission 
+    // Sets to the specified group, provided the current user has view permission
     if (!$groupmode) {   // Groups don't even apply
         return false;
     }
@@ -1457,4 +1457,89 @@ function print_group_menu($groups, $groupmode, $currentgroup, $urlroot, $showall
 
 }
 
+/**
+ * Prints breadcrumb trail of links, called in theme/-/header.html
+ *
+ * @uses $CFG
+ * @param mixed $navigation The breadcrumb navigation string to be printed
+ * @param string $separator The breadcrumb trail separator. The default 0 leads to the use
+ *  of $THEME->rarrow, themes could use '&rarr;', '/', or '' for a style-sheet solution.
+ * @param boolean $return False to echo the breadcrumb string (default), true to return it.
+ */
+function print_navigation ($navigation, $separator=0, $return=false) {
+    global $CFG, $THEME;
+    $output = '';
+
+    if (0 === $separator) {
+        $separator = get_separator();
+    }
+    else {
+        $separator = '<span class="sep">'. $separator .'</span>';
+    }
+
+    if ($navigation) {
+
+        if (is_newnav($navigation)) {
+            if ($return) {
+                return($navigation['navlinks']);
+            } else {
+                echo $navigation['navlinks'];
+                return;
+            }
+        } else {
+            debugging('Navigation needs to be updated to use build_navigation()', DEBUG_DEVELOPER);
+        }
+
+        if (!is_array($navigation)) {
+            $ar = explode('->', $navigation);
+            $navigation = array();
+
+            foreach ($ar as $a) {
+                if (strpos($a, '</a>') === false) {
+                    $navigation[] = array('title' => $a, 'url' => '');
+                } else {
+                    if (preg_match('/<a.*href="([^"]*)">(.*)<\/a>/', $a, $matches)) {
+                        $navigation[] = array('title' => $matches[2], 'url' => $matches[1]);
+                    }
+                }
+            }
+        }
+
+        if (! $site = get_site()) {
+            $site = new object();
+            $site->shortname = get_string('home');
+        }
+
+        //Accessibility: breadcrumb links now in a list, &raquo; replaced with a 'silent' character.
+        $nav_text = get_string('youarehere','access');
+        $output .= '<h2 class="accesshide">'.$nav_text."</h2><ul>\n";
+
+        $output .= '<li class="first">'."\n".'<a '.$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
+               .$CFG->wwwroot.((!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))
+                                 && !empty($USER->id) && !empty($CFG->mymoodleredirect) && !isguest())
+                                 ? '/my' : '') .'/">'. format_string($site->shortname) ."</a>\n</li>\n";
+
+
+        foreach ($navigation as $navitem) {
+            $title = trim(strip_tags(format_string($navitem['title'], false)));
+            $url   = $navitem['url'];
+
+            if (empty($url)) {
+                $output .= '<li class="first">'."$separator $title</li>\n";
+            } else {
+                $output .= '<li class="first">'."$separator\n<a ".$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
+                           .$url.'">'."$title</a>\n</li>\n";
+            }
+        }
+
+        $output .= "</ul>\n";
+    }
+
+    if ($return) {
+        return $output;
+    } else {
+        echo $output;
+    }
+}
+
 ?>
index d3419cdea175fa92cb004b4171034a13fa44c7b3..443e375a371dc09c1aecfdc664aeac960428b0a5 100644 (file)
@@ -7116,80 +7116,6 @@ function setup_lang_from_browser() {
 
 
 ////////////////////////////////////////////////////////////////////////////////
-/**
- * This function will build the navigation string to be used by print_header
- * and others
- * @uses $CFG
- * @uses $THEME
- * @param $extranavlinks - array of associative arrays, keys: name, link, type
- * @return $navigation as an object so it can be differentiated from old style
- * navigation strings.
- */
-function build_navigation($extranavlinks) {
-    global $CFG, $COURSE;
-
-    $navigation = '';
-    $navlinks = array();
-
-    //Site name
-    if ($site = get_site()) {
-        $navlinks[] = array('name' => format_string($site->shortname),
-                            'link' => "$CFG->wwwroot/",
-                            'type' => 'home');
-    }
-
-
-    if ($COURSE) {
-        if ($COURSE->id != SITEID) {
-            //Course
-            $navlinks[] = array('name' => format_string($COURSE->shortname),
-                                'link' => "$CFG->wwwroot/course/view.php?id=$COURSE->id",
-                                'type' => 'course');
-        }
-    }
-
-    //Merge in extra navigation links
-    $navlinks = array_merge($navlinks, $extranavlinks);
-
-    //Construct an unordered list from $navlinks
-    //Accessibility: heading hidden from visual browsers by default.
-    $navigation = '<h2 class="accesshide">'.get_string('youarehere','access')."</h2> <ul>\n";
-    $countlinks = count($navlinks);
-    $i = 0;
-    foreach ($navlinks as $navlink) {
-        if ($i >= $countlinks || !is_array($navlink)) {
-            continue;
-        }
-        // Check the link type to see if this link should appear in the trail
-        $cap = has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_COURSE, $COURSE->id));
-        $hidetype_is2 = $CFG->hideactivitytypenavlink == 2;
-        $hidetype_is1 = $CFG->hideactivitytypenavlink == 1;
-
-        if ($navlink['type'] == 'activity' &&
-            $i+1 < $countlinks  &&
-            ($hidetype_is2 || ($hidetype_is1 && !$cap))) {
-            continue;
-        }
-        $navigation .= '<li class="first">';
-        if ($i > 0) {
-            $navigation .= get_separator();
-        }
-        if ($navlink['link'] && $i+1 < $countlinks) {
-            $navigation .= "<a onclick=\"this.target='$CFG->framename'\" href=\"{$navlink['link']}\">";
-        }
-        $navigation .= "{$navlink['name']}";
-        if ($navlink['link'] && $i+1 < $countlinks) {
-            $navigation .= "</a>";
-        }
-
-        $navigation .= "</li>";
-        $i++;
-    }
-
-    $navigation .= "</ul>";
-
-    return(array('newnav' => true, 'navlinks' => $navigation));
-}
 
 function is_newnav($navigation) {
     if (is_array($navigation) && $navigation['newnav']) {
index 952d0f5cfcba2c078933cd89fbcc2bd47d039453..ea16bba3414d5734c7aec0cb1223f5a86f11e7c7 100644 (file)
@@ -2267,6 +2267,11 @@ function print_header ($title='', $heading='', $navigation='', $focus='',
 
     global $USER, $CFG, $THEME, $SESSION, $ME, $SITE, $COURSE;
 
+    if (gettype($navigation) == 'string' && strlen($navigation) != 0) {
+        debugging("print_header() was sent a string as 3rd ($navigation) parameter. "
+                . "This is deprecated in favour of an array built by build_navigation(). Please upgrade your code.");
+    }
+
     $heading = format_string($heading); // Fix for MDL-8582
 
 /// This makes sure that the header is never repeated twice on a page
@@ -3231,93 +3236,82 @@ function get_separator() {
     return ' '.link_arrow_right($text='/', $url='', $accesshide=true, 'sep').' ';
 }
 
-
-
 /**
- * Prints breadcrumb trail of links, called in theme/-/header.html
- *
+ * This function will build the navigation string to be used by print_header
+ * and others
  * @uses $CFG
- * @param mixed $navigation The breadcrumb navigation string to be printed
- * @param string $separator The breadcrumb trail separator. The default 0 leads to the use
- *  of $THEME->rarrow, themes could use '&rarr;', '/', or '' for a style-sheet solution.
- * @param boolean $return False to echo the breadcrumb string (default), true to return it.
+ * @uses $THEME
+ * @param $extranavlinks - array of associative arrays, keys: name, link, type
+ * @return $navigation as an object so it can be differentiated from old style
+ * navigation strings.
  */
-function print_navigation ($navigation, $separator=0, $return=false) {
-    global $CFG, $THEME;
-    $output = '';
+function build_navigation($extranavlinks) {
+    global $CFG, $COURSE;
 
-    if (0 === $separator) {
-        $separator = get_separator();
-    }
-    else {
-        $separator = '<span class="sep">'. $separator .'</span>';
+    $navigation = '';
+    $navlinks = array();
+
+    //Site name
+    if ($site = get_site()) {
+        $navlinks[] = array('name' => format_string($site->shortname),
+                            'link' => "$CFG->wwwroot/",
+                            'type' => 'home');
     }
 
-    if ($navigation) {
 
-        if (is_newnav($navigation)) {
-            if ($return) {
-                return($navigation['navlinks']);
-            } else {
-                echo $navigation['navlinks'];
-                return;
-            }
-        } else {
-            debugging('Navigation needs to be updated to use build_navigation()', DEBUG_DEVELOPER);
+    if ($COURSE) {
+        if ($COURSE->id != SITEID) {
+            //Course
+            $navlinks[] = array('name' => format_string($COURSE->shortname),
+                                'link' => "$CFG->wwwroot/course/view.php?id=$COURSE->id",
+                                'type' => 'course');
         }
+    }
 
-        if (!is_array($navigation)) {
-            $ar = explode('->', $navigation);
-            $navigation = array();
+    //Merge in extra navigation links
+    $navlinks = array_merge($navlinks, $extranavlinks);
 
-            foreach ($ar as $a) {
-                if (strpos($a, '</a>') === false) {
-                    $navigation[] = array('title' => $a, 'url' => '');
-                } else {
-                    if (preg_match('/<a.*href="([^"]*)">(.*)<\/a>/', $a, $matches)) {
-                        $navigation[] = array('title' => $matches[2], 'url' => $matches[1]);
-                    }
-                }
-            }
+    //Construct an unordered list from $navlinks
+    //Accessibility: heading hidden from visual browsers by default.
+    $navigation = '<h2 class="accesshide">'.get_string('youarehere','access')."</h2> <ul>\n";
+    $countlinks = count($navlinks);
+    $i = 0;
+    foreach ($navlinks as $navlink) {
+        if ($i >= $countlinks || !is_array($navlink)) {
+            continue;
         }
+        // Check the link type to see if this link should appear in the trail
+        $cap = has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_COURSE, $COURSE->id));
+        $hidetype_is2 = $CFG->hideactivitytypenavlink == 2;
+        $hidetype_is1 = $CFG->hideactivitytypenavlink == 1;
 
-        if (! $site = get_site()) {
-            $site = new object();
-            $site->shortname = get_string('home');
+        if ($navlink['type'] == 'activity' &&
+            $i+1 < $countlinks  &&
+            ($hidetype_is2 || ($hidetype_is1 && !$cap))) {
+            continue;
         }
-
-        //Accessibility: breadcrumb links now in a list, &raquo; replaced with a 'silent' character.
-        $nav_text = get_string('youarehere','access');
-        $output .= '<h2 class="accesshide">'.$nav_text."</h2><ul>\n";
-
-        $output .= '<li class="first">'."\n".'<a '.$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
-               .$CFG->wwwroot.((!has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM))
-                                 && !empty($USER->id) && !empty($CFG->mymoodleredirect) && !isguest())
-                                 ? '/my' : '') .'/">'. format_string($site->shortname) ."</a>\n</li>\n";
-
-
-        foreach ($navigation as $navitem) {
-            $title = trim(strip_tags(format_string($navitem['title'], false)));
-            $url   = $navitem['url'];
-
-            if (empty($url)) {
-                $output .= '<li class="first">'."$separator $title</li>\n";
-            } else {
-                $output .= '<li class="first">'."$separator\n<a ".$CFG->frametarget.' onclick="this.target=\''.$CFG->framename.'\'" href="'
-                           .$url.'">'."$title</a>\n</li>\n";
-            }
+        $navigation .= '<li class="first">';
+        if ($i > 0) {
+            $navigation .= get_separator();
+        }
+        if ($navlink['link'] && $i+1 < $countlinks) {
+            $navigation .= "<a onclick=\"this.target='$CFG->framename'\" href=\"{$navlink['link']}\">";
+        }
+        $navigation .= "{$navlink['name']}";
+        if ($navlink['link'] && $i+1 < $countlinks) {
+            $navigation .= "</a>";
         }
 
-        $output .= "</ul>\n";
+        $navigation .= "</li>";
+        $i++;
     }
 
-    if ($return) {
-        return $output;
-    } else {
-        echo $output;
-    }
+    $navigation .= "</ul>";
+
+    return(array('newnav' => true, 'navlinks' => $navigation));
 }
 
+
 /**
  * Prints a string in a specified size  (retained for backward compatibility)
  *
index 37f0dbb7dde4b39c6950c224a5e24148d979e5c6..ad9dccf05fd07067e197028246c3064ecc306200 100644 (file)
@@ -5,7 +5,7 @@
     <meta name="keywords" content="moodle, <?php echo $title ?> " />
     <title><?php echo $title ?></title>
     <link rel="shortcut icon" href="<?php echo $CFG->themewww .'/'. current_theme() ?>/favicon.ico" />
-    
+
     <?php include('ui/chameleon.php'); ?>
     <?php include("$CFG->javascript"); ?>
 </head>
         echo " onload=\"setfocus()\"";
     };
     ?>>
-    
+
 <div id="page">
-    
-<?php if ($home) {  // This is what gets printed on the home page only  
+
+<?php if ($home) {  // This is what gets printed on the home page only
 ?>
     <div id="header-home" class="clearfix">
       <h1 class="headermain"><?php echo $heading ?></h1>
       <div class="headermenu"><?php echo $menu ?></div>
     </div>
     <div class="navbar clearfix">
-        &nbsp;      
+        &nbsp;
     </div>
-<?php } else {  // This is what gets printed on any other page with a heading 
+<?php } else {  // This is what gets printed on any other page with a heading
 ?>
     <div id="header" class="clearfix">
       <h1 class="headermain"><?php echo $heading ?></h1>
@@ -37,7 +37,7 @@
     <div class="navbar clearfix">
     <?php if ($navigation) { // This is the navigation table with breadcrumbs
     ?>
-        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
+        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     <?php } ?>
     </div>
index 2c83e78cfac999a8caf618ee13ecce521921f40d..b19236eb3bfcd7d4d91f0566822f65cf7caba023 100644 (file)
@@ -11,7 +11,7 @@
 
 <?php if ($navigation and false) { ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
+        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
         <div class="menu"><?php echo $menu; ?></div>
     </div>
 <?php } ?>
index a147503a4e17fdda18bba3ccb99f0cde37ae6cd1..e395dd211d61fd2254ccfe537fd77b3a062eeddd 100644 (file)
@@ -24,7 +24,7 @@
         <h1 class="headermain"><img alt="[ REPLACE ME ]" src="<?php echo $CFG->wwwroot.'/theme/'.current_theme() ?>/images/logo.jpg" width="457" height="64" /></h1>
         <div class="headermenu"><?php echo $menu ?></div>
     </div>
-<?php } else if ($heading) {  // This is what gets printed on any other page with a heading 
+<?php } else if ($heading) {  // This is what gets printed on any other page with a heading
 ?>
     <div id="header-home">
         <h1 class="headermain"><img alt="[ REPLACE ME ]" src="<?php echo $CFG->wwwroot.'/theme/'.current_theme() ?>/images/logo.jpg" width="457" height="64" /></h1>
@@ -35,9 +35,9 @@
 <?php //Accessibility: breadcrumb trail/navbar now a DIV, not a table.
       if ($navigation) { // This is the navigation bar with breadcrumbs  ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
+        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
-    </div>   
+    </div>
 <?php } else if ($heading) { // If no navigation, but a heading, then print a line ?>
 
 <?php }  ?>
index 3ce57de833d8443997650a753b1edfe87748a580..458932face6e19ec3528f6ace3b89dc6f1bc1625 100644 (file)
@@ -28,7 +28,7 @@
         $excludelist = array('mod-chat-view', 'mod-data-view', 'mod-quiz-view',
             'my-index');
 
-        if (!empty($PAGE) && (in_array($PAGE->type, $excludelist)) && 
+        if (!empty($PAGE) && (in_array($PAGE->type, $excludelist)) &&
             (strstr($bodytags, ' nocoursepage'))) {
             $bodytags = str_replace(' nocoursepage', '', $bodytags);
         }
@@ -81,7 +81,7 @@
     <div class="navbar clearfix">
     <?php if ($navigation) { // This is the navigation table with breadcrumbs
     ?>
-        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
+        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     <?php } ?>
     </div>
index ec3b78dc3514399843b71e6db9929528fa283623..7cac32547c9c87dde3dd2f01ba806ed9b8802fe4 100644 (file)
@@ -11,7 +11,7 @@
 
 <?php if ($navigation and false) { ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
+        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
         <div class="menu"><?php echo $menu; ?></div>
     </div>
 <?php } ?>
index 28065c917e3ab6847b192bd85852384076dc4107..cb3530aa6ab49c1645a88b906f000f204c03b480 100644 (file)
@@ -14,7 +14,7 @@
         echo " onload=\"setfocus()\"";
     }
     ?>>
-      
+
 <div id="page">
 
 <?php //Accessibility: warning: ALT text will need editing if logo changes. 'headermain' is now H1, see theme/standard/styles_layout.css: .headermain
@@ -24,7 +24,7 @@
         <h1 class="headermain"><img alt='Moodle' src='<?php echo $CFG->httpsthemewww .'/'. current_theme() ?>/logo.jpg' /></h1>
         <div class="headermenu"><?php echo $menu ?></div>
     </div>
-<?php } else if ($heading) {  // This is what gets printed on any other page with a heading 
+<?php } else if ($heading) {  // This is what gets printed on any other page with a heading
 ?>
     <div id="header" class="clearfix">
         <h1 class="headermain"><img alt='Moodle' src='<?php echo $CFG->httpsthemewww .'/'. current_theme() ?>/logo_small.jpg' /></h1>
 <?php //Accessibility: breadcrumb trail/navbar now a DIV, not a table.
       if ($navigation) { // This is the navigation bar with breadcrumbs  ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
+        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     </div>
-<?php } else if ($heading) { // If no navigation, but a heading, then print a line  
+<?php } else if ($heading) { // If no navigation, but a heading, then print a line
 ?>
        <hr />
 <?php } ?>
index 9ecc61ca3b1f9f27d4b5e2eb02af348fc817c9c8..1574a66089746a462ab028480832d06b65731598 100644 (file)
         echo " onload=\"setfocus()\"";
     }
     ?>>
-    
+
 <div id="page">
 
-<?php if ($home) {  // This is what gets printed on the home page only  
+<?php if ($home) {  // This is what gets printed on the home page only
 ?>
     <div id="header-home">
         <h1 class="headermain"><?php echo $heading ?></h1>
         <div class="headermenu"><?php echo $menu ?></div>
     </div>
-<?php } else if ($heading) {  // This is what gets printed on any other page with a heading 
+<?php } else if ($heading) {  // This is what gets printed on any other page with a heading
 ?>
     <div id="header">
         <h1 class="headermain"><?php echo $heading ?></h1>
     <div class="clearer">&nbsp;</div>
 <?php if ($navigation) { // This is the navigation table with breadcrumbs  ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
+        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     </div>
-<?php } else if ($heading) { // If no navigation, but a heading, then print a line  
+<?php } else if ($heading) { // If no navigation, but a heading, then print a line
 ?>
        <hr />
 <?php } ?>
index 8a624f989ef642081275e264a64086da10ce05fb..2a4d27a77bb3e476c1b6659508e8af22ecb8415e 100644 (file)
@@ -11,7 +11,7 @@
 
 <?php if ($navigation and false) { ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
+        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
         <div class="menu"><?php echo $menu; ?></div>
     </div>
 <?php } ?>
index eb96bddde93f3d6ccc497d3c1e1dd3b847c81188..a13996235f338ffba2317a351d287a728f68529d 100644 (file)
@@ -14,7 +14,7 @@
         echo " onload=\"setfocus()\"";
     }
     ?>>
-    
+
 <div id="page">
 
 <?php //Accessibility: 'headermain' is now H1, see theme/standard/styles_layout.css: .headermain
@@ -24,7 +24,7 @@
         <h1 class="headermain"><?php echo $heading ?></h1>
         <div class="headermenu"><?php echo $menu ?></div>
     </div>
-<?php } else if ($heading) {  // This is what gets printed on any other page with a heading 
+<?php } else if ($heading) {  // This is what gets printed on any other page with a heading
 ?>
     <div id="header" class="clearfix">
         <h1 class="headermain"><?php echo $heading ?></h1>
 <?php //Accessibility: breadcrumb trail/navbar now a DIV, not a table.
       if ($navigation) { // This is the navigation bar with breadcrumbs  ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
+        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
-    </div>   
-<?php } else if ($heading) { // If no navigation, but a heading, then print a line  
+    </div>
+<?php } else if ($heading) { // If no navigation, but a heading, then print a line
 ?>
         <hr />
 <?php } ?>
index 7f703301e6f5d4794e31f410b7128a1386e11f68..f3691b1dc7e40c3f9dc5e312b0bd930889e67c6a 100644 (file)
         echo " onload=\"setfocus()\"";
     };
     ?>>
-    
+
 <div id="page">
 
-<?php if ($home) {  // This is what gets printed on the home page only  
+<?php if ($home) {  // This is what gets printed on the home page only
 ?>
     <div id="header-home">
         <h1 class="headermain"><?php echo $heading ?></h1>
@@ -25,7 +25,7 @@
     </div>
     <div class="navbar">
     </div>
-<?php } else if ($heading) {  // This is what gets printed on any other page with a heading 
+<?php } else if ($heading) {  // This is what gets printed on any other page with a heading
 ?>
     <div id="header">
         <h1 class="headermain"><?php echo $heading ?></h1>
@@ -36,7 +36,7 @@
 <?php if ($navigation) { // This is the navigation table with breadcrumbs
 ?>
     <div class="navbar">
-        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
+        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     </div>
 <?php } ?>
index 7f703301e6f5d4794e31f410b7128a1386e11f68..f3691b1dc7e40c3f9dc5e312b0bd930889e67c6a 100644 (file)
         echo " onload=\"setfocus()\"";
     };
     ?>>
-    
+
 <div id="page">
 
-<?php if ($home) {  // This is what gets printed on the home page only  
+<?php if ($home) {  // This is what gets printed on the home page only
 ?>
     <div id="header-home">
         <h1 class="headermain"><?php echo $heading ?></h1>
@@ -25,7 +25,7 @@
     </div>
     <div class="navbar">
     </div>
-<?php } else if ($heading) {  // This is what gets printed on any other page with a heading 
+<?php } else if ($heading) {  // This is what gets printed on any other page with a heading
 ?>
     <div id="header">
         <h1 class="headermain"><?php echo $heading ?></h1>
@@ -36,7 +36,7 @@
 <?php if ($navigation) { // This is the navigation table with breadcrumbs
 ?>
     <div class="navbar">
-        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
+        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     </div>
 <?php } ?>
index 231fcb4db5e64b1aec0c29a72d7e05fad2fdf110..8fe83abb0d2d11928570bd3d330fb2fdf3eaacf8 100644 (file)
@@ -11,7 +11,7 @@
 
 <?php if ($navigation and false) { ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
+        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
         <div class="menu"><?php echo $menu; ?></div>
     </div>
 <?php } ?>
index eb96bddde93f3d6ccc497d3c1e1dd3b847c81188..a13996235f338ffba2317a351d287a728f68529d 100644 (file)
@@ -14,7 +14,7 @@
         echo " onload=\"setfocus()\"";
     }
     ?>>
-    
+
 <div id="page">
 
 <?php //Accessibility: 'headermain' is now H1, see theme/standard/styles_layout.css: .headermain
@@ -24,7 +24,7 @@
         <h1 class="headermain"><?php echo $heading ?></h1>
         <div class="headermenu"><?php echo $menu ?></div>
     </div>
-<?php } else if ($heading) {  // This is what gets printed on any other page with a heading 
+<?php } else if ($heading) {  // This is what gets printed on any other page with a heading
 ?>
     <div id="header" class="clearfix">
         <h1 class="headermain"><?php echo $heading ?></h1>
 <?php //Accessibility: breadcrumb trail/navbar now a DIV, not a table.
       if ($navigation) { // This is the navigation bar with breadcrumbs  ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
+        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
-    </div>   
-<?php } else if ($heading) { // If no navigation, but a heading, then print a line  
+    </div>
+<?php } else if ($heading) { // If no navigation, but a heading, then print a line
 ?>
         <hr />
 <?php } ?>
index eb96bddde93f3d6ccc497d3c1e1dd3b847c81188..a13996235f338ffba2317a351d287a728f68529d 100644 (file)
@@ -14,7 +14,7 @@
         echo " onload=\"setfocus()\"";
     }
     ?>>
-    
+
 <div id="page">
 
 <?php //Accessibility: 'headermain' is now H1, see theme/standard/styles_layout.css: .headermain
@@ -24,7 +24,7 @@
         <h1 class="headermain"><?php echo $heading ?></h1>
         <div class="headermenu"><?php echo $menu ?></div>
     </div>
-<?php } else if ($heading) {  // This is what gets printed on any other page with a heading 
+<?php } else if ($heading) {  // This is what gets printed on any other page with a heading
 ?>
     <div id="header" class="clearfix">
         <h1 class="headermain"><?php echo $heading ?></h1>
 <?php //Accessibility: breadcrumb trail/navbar now a DIV, not a table.
       if ($navigation) { // This is the navigation bar with breadcrumbs  ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
+        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
-    </div>   
-<?php } else if ($heading) { // If no navigation, but a heading, then print a line  
+    </div>
+<?php } else if ($heading) { // If no navigation, but a heading, then print a line
 ?>
         <hr />
 <?php } ?>
index eb96bddde93f3d6ccc497d3c1e1dd3b847c81188..a13996235f338ffba2317a351d287a728f68529d 100644 (file)
@@ -14,7 +14,7 @@
         echo " onload=\"setfocus()\"";
     }
     ?>>
-    
+
 <div id="page">
 
 <?php //Accessibility: 'headermain' is now H1, see theme/standard/styles_layout.css: .headermain
@@ -24,7 +24,7 @@
         <h1 class="headermain"><?php echo $heading ?></h1>
         <div class="headermenu"><?php echo $menu ?></div>
     </div>
-<?php } else if ($heading) {  // This is what gets printed on any other page with a heading 
+<?php } else if ($heading) {  // This is what gets printed on any other page with a heading
 ?>
     <div id="header" class="clearfix">
         <h1 class="headermain"><?php echo $heading ?></h1>
 <?php //Accessibility: breadcrumb trail/navbar now a DIV, not a table.
       if ($navigation) { // This is the navigation bar with breadcrumbs  ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
+        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
-    </div>   
-<?php } else if ($heading) { // If no navigation, but a heading, then print a line  
+    </div>
+<?php } else if ($heading) { // If no navigation, but a heading, then print a line
 ?>
         <hr />
 <?php } ?>
index 2c2bb03c7de4c40f3276327a70ee87b4e9f5e419..09efc11dd5e069af231eb0a50cdeb7c0d398084a 100644 (file)
         echo " onload=\"setfocus()\"";
     }
     ?>>
-    
+
 <div id="page">
 
-<?php if ($home) {  // This is what gets printed on the home page only  
+<?php if ($home) {  // This is what gets printed on the home page only
       if (file_exists($CFG->dirroot.'/logo.jpg')) {
           $standardlogo = $CFG->httpswwwroot.'/logo.jpg';
       } else if (file_exists($CFG->dirroot.'/logo.gif')) {
       } else {
           $standardlogo = $CFG->httpsthemewww .'/'. current_theme().'/logo.gif';
       }
-      
+
       //Accessibility: warning: ALT text will need editing if logo changes. 'headermain' is now H1.
 ?>
     <div id="header-home" class="clearfix">
         <h1 class="headermain"><img alt="Moodle" src="<?php echo $standardlogo ?>" /></h1>
         <div class="headermenu"><?php echo $menu ?></div>
     </div>
-<?php } else if ($heading) {  // This is what gets printed on any other page with a heading 
+<?php } else if ($heading) {  // This is what gets printed on any other page with a heading
 ?>
     <div id="header" class="clearfix">
         <h1 class="headermain"><?php echo $heading ?></h1>
 <?php //Accessibility: breadcrumb trail/navbar now a DIV, not a table.
       if ($navigation) { // This is the navigation table with breadcrumbs  ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
+        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     </div>
-<?php } else if ($heading) { // If no navigation, but a heading, then print a line  
+<?php } else if ($heading) { // If no navigation, but a heading, then print a line
 ?>
         <hr />
 <?php } ?>
index eb96bddde93f3d6ccc497d3c1e1dd3b847c81188..a13996235f338ffba2317a351d287a728f68529d 100644 (file)
@@ -14,7 +14,7 @@
         echo " onload=\"setfocus()\"";
     }
     ?>>
-    
+
 <div id="page">
 
 <?php //Accessibility: 'headermain' is now H1, see theme/standard/styles_layout.css: .headermain
@@ -24,7 +24,7 @@
         <h1 class="headermain"><?php echo $heading ?></h1>
         <div class="headermenu"><?php echo $menu ?></div>
     </div>
-<?php } else if ($heading) {  // This is what gets printed on any other page with a heading 
+<?php } else if ($heading) {  // This is what gets printed on any other page with a heading
 ?>
     <div id="header" class="clearfix">
         <h1 class="headermain"><?php echo $heading ?></h1>
 <?php //Accessibility: breadcrumb trail/navbar now a DIV, not a table.
       if ($navigation) { // This is the navigation bar with breadcrumbs  ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
+        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
-    </div>   
-<?php } else if ($heading) { // If no navigation, but a heading, then print a line  
+    </div>
+<?php } else if ($heading) { // If no navigation, but a heading, then print a line
 ?>
         <hr />
 <?php } ?>
index 3fdad6ad510e47c6014d4b9b0a9ff5ceb574386f..1a577264b27fda3cf949533ef0cd8f9d35e139d2 100644 (file)
@@ -14,7 +14,7 @@
         echo " onload=\"setfocus()\"";
     }
     ?>>
-    
+
 <div id="page">
 
 <?php //Accessibility: 'headermain' is now H1, see theme/standard/styles_layout.css: .headermain
@@ -24,7 +24,7 @@
         <h1 class="headermain"><?php echo $heading ?></h1>
         <div class="headermenu"><?php echo $menu ?></div>
     </div>
-<?php } else if ($heading) {  // This is what gets printed on any other page with a heading 
+<?php } else if ($heading) {  // This is what gets printed on any other page with a heading
 ?>
     <div id="header" class="clearfix">
         <h1 class="headermain"><?php echo $heading ?></h1>
 <?php //Accessibility: breadcrumb trail/navbar now a DIV, not a table.
       if ($navigation) { // This is the navigation bar with breadcrumbs  ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
+        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
-    </div>   
-<?php } else if ($heading) { // If no navigation, but a heading, then print a line  
+    </div>
+<?php } else if ($heading) { // If no navigation, but a heading, then print a line
 ?>
         <hr />
 <?php } ?>
index 76166a67bf1353e0769219896040835ec3d77e45..6f5a1cb1c0a1486286f31188e36274f194c58fca 100644 (file)
         echo " onload=\"setfocus()\"";
     }
     ?>>
-    
+
 <div id="page">
 
-<?php if ($home) {  // This is what gets printed on the home page only  
+<?php if ($home) {  // This is what gets printed on the home page only
 ?>
     <div id="header-home" class="clearfix">
         <h1 class="headermain"><?php echo $heading ?></h1>
         <div class="headermenu"><?php echo $menu ?></div>
     </div>
-<?php } else if ($heading) {  // This is what gets printed on any other page with a heading 
+<?php } else if ($heading) {  // This is what gets printed on any other page with a heading
 ?>
     <div id="header" class="clearfix">
         <h1 class="headermain"><?php echo $heading ?></h1>
 <?php } ?>
 <?php if ($navigation) { // This is the navigation table with breadcrumbs  ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
+        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     </div>
-<?php } else if ($heading) { // If no navigation, but a heading, then print a line  
+<?php } else if ($heading) { // If no navigation, but a heading, then print a line
 ?>
         <hr />
 <?php } ?>