]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-10970 Reverted changes
authornicolasconnault <nicolasconnault>
Fri, 24 Aug 2007 12:45:16 +0000 (12:45 +0000)
committernicolasconnault <nicolasconnault>
Fri, 24 Aug 2007 12:45:16 +0000 (12:45 +0000)
21 files changed:
lib/deprecatedlib.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 1141ddaa2176c3a1c23be359b3a194ca706e1469..b2525140433717ac8eb7dfb2a60087014d79feb7 100644 (file)
@@ -1457,89 +1457,4 @@ 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 ea16bba3414d5734c7aec0cb1223f5a86f11e7c7..6f70b23a8f672f7fc279bf734df1ce2d1e3bf43e 100644 (file)
@@ -3236,6 +3236,91 @@ function get_separator() {
     return ' '.link_arrow_right($text='/', $url='', $accesshide=true, 'sep').' ';
 }
 
+/**
+ * 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;
+    }
+}
+
 /**
  * This function will build the navigation string to be used by print_header
  * and others
index ad9dccf05fd07067e197028246c3064ecc306200..bde17042b34c70acce43c75bd2e6c50ae8cf1ff5 100644 (file)
@@ -37,7 +37,7 @@
     <div class="navbar clearfix">
     <?php if ($navigation) { // This is the navigation table with breadcrumbs
     ?>
-        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
+        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     <?php } ?>
     </div>
index b19236eb3bfcd7d4d91f0566822f65cf7caba023..2c83e78cfac999a8caf618ee13ecce521921f40d 100644 (file)
@@ -11,7 +11,7 @@
 
 <?php if ($navigation and false) { ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
+        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
         <div class="menu"><?php echo $menu; ?></div>
     </div>
 <?php } ?>
index e395dd211d61fd2254ccfe537fd77b3a062eeddd..ed62f59f8a4328e72d9abeead2e82d44a359378b 100644 (file)
@@ -35,7 +35,7 @@
 <?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 echo $navigation['navlinks']; ?></div>
+        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     </div>
 <?php } else if ($heading) { // If no navigation, but a heading, then print a line ?>
index 458932face6e19ec3528f6ace3b89dc6f1bc1625..ded3c3d2226bcd67aa5181680b5045688e4e1b14 100644 (file)
@@ -81,7 +81,7 @@
     <div class="navbar clearfix">
     <?php if ($navigation) { // This is the navigation table with breadcrumbs
     ?>
-        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
+        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     <?php } ?>
     </div>
index 7cac32547c9c87dde3dd2f01ba806ed9b8802fe4..ec3b78dc3514399843b71e6db9929528fa283623 100644 (file)
@@ -11,7 +11,7 @@
 
 <?php if ($navigation and false) { ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
+        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
         <div class="menu"><?php echo $menu; ?></div>
     </div>
 <?php } ?>
index cb3530aa6ab49c1645a88b906f000f204c03b480..e9f7aec151e805cdee50f4fb3f80d6dd62a1b3ab 100644 (file)
@@ -34,7 +34,7 @@
 <?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 echo $navigation['navlinks']; ?></div>
+        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     </div>
 <?php } else if ($heading) { // If no navigation, but a heading, then print a line
index 1574a66089746a462ab028480832d06b65731598..44513bba0e57d8b228e6afae1ca7fc31360e59a0 100644 (file)
@@ -33,7 +33,7 @@
     <div class="clearer">&nbsp;</div>
 <?php if ($navigation) { // This is the navigation table with breadcrumbs  ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
+        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     </div>
 <?php } else if ($heading) { // If no navigation, but a heading, then print a line
index 2a4d27a77bb3e476c1b6659508e8af22ecb8415e..8a624f989ef642081275e264a64086da10ce05fb 100644 (file)
@@ -11,7 +11,7 @@
 
 <?php if ($navigation and false) { ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
+        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
         <div class="menu"><?php echo $menu; ?></div>
     </div>
 <?php } ?>
index a13996235f338ffba2317a351d287a728f68529d..7da27b4cf97571d460c9b434ddfe39e8bbfc398b 100644 (file)
@@ -34,7 +34,7 @@
 <?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 echo $navigation['navlinks']; ?></div>
+        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     </div>
 <?php } else if ($heading) { // If no navigation, but a heading, then print a line
index f3691b1dc7e40c3f9dc5e312b0bd930889e67c6a..c333e877d011bbfeef4f84cdfba94042bc4d922d 100644 (file)
@@ -36,7 +36,7 @@
 <?php if ($navigation) { // This is the navigation table with breadcrumbs
 ?>
     <div class="navbar">
-        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
+        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     </div>
 <?php } ?>
index f3691b1dc7e40c3f9dc5e312b0bd930889e67c6a..c333e877d011bbfeef4f84cdfba94042bc4d922d 100644 (file)
@@ -36,7 +36,7 @@
 <?php if ($navigation) { // This is the navigation table with breadcrumbs
 ?>
     <div class="navbar">
-        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
+        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     </div>
 <?php } ?>
index 8fe83abb0d2d11928570bd3d330fb2fdf3eaacf8..231fcb4db5e64b1aec0c29a72d7e05fad2fdf110 100644 (file)
@@ -11,7 +11,7 @@
 
 <?php if ($navigation and false) { ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
+        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
         <div class="menu"><?php echo $menu; ?></div>
     </div>
 <?php } ?>
index a13996235f338ffba2317a351d287a728f68529d..7da27b4cf97571d460c9b434ddfe39e8bbfc398b 100644 (file)
@@ -34,7 +34,7 @@
 <?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 echo $navigation['navlinks']; ?></div>
+        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     </div>
 <?php } else if ($heading) { // If no navigation, but a heading, then print a line
index a13996235f338ffba2317a351d287a728f68529d..7da27b4cf97571d460c9b434ddfe39e8bbfc398b 100644 (file)
@@ -34,7 +34,7 @@
 <?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 echo $navigation['navlinks']; ?></div>
+        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     </div>
 <?php } else if ($heading) { // If no navigation, but a heading, then print a line
index a13996235f338ffba2317a351d287a728f68529d..7da27b4cf97571d460c9b434ddfe39e8bbfc398b 100644 (file)
@@ -34,7 +34,7 @@
 <?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 echo $navigation['navlinks']; ?></div>
+        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     </div>
 <?php } else if ($heading) { // If no navigation, but a heading, then print a line
index 09efc11dd5e069af231eb0a50cdeb7c0d398084a..a5e54080673ff79b6d5ca5984d87d5d31f93b528 100644 (file)
@@ -54,7 +54,7 @@
 <?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 echo $navigation['navlinks']; ?></div>
+        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     </div>
 <?php } else if ($heading) { // If no navigation, but a heading, then print a line
index a13996235f338ffba2317a351d287a728f68529d..7da27b4cf97571d460c9b434ddfe39e8bbfc398b 100644 (file)
@@ -34,7 +34,7 @@
 <?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 echo $navigation['navlinks']; ?></div>
+        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     </div>
 <?php } else if ($heading) { // If no navigation, but a heading, then print a line
index 1a577264b27fda3cf949533ef0cd8f9d35e139d2..1e6ae252bdb7ed79f9f6effdf1a8c2d7e1cd6557 100644 (file)
@@ -34,7 +34,7 @@
 <?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 echo $navigation['navlinks']; ?></div>
+        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     </div>
 <?php } else if ($heading) { // If no navigation, but a heading, then print a line
index 6f5a1cb1c0a1486286f31188e36274f194c58fca..41e8a5509e17d845a5073d795d2616df9dd82fc7 100644 (file)
@@ -32,7 +32,7 @@
 <?php } ?>
 <?php if ($navigation) { // This is the navigation table with breadcrumbs  ?>
     <div class="navbar clearfix">
-        <div class="breadcrumb"><?php echo $navigation['navlinks']; ?></div>
+        <div class="breadcrumb"><?php print_navigation($navigation); ?></div>
         <div class="navbutton"><?php echo $button; ?></div>
     </div>
 <?php } else if ($heading) { // If no navigation, but a heading, then print a line