]> git.mjollnir.org Git - moodle.git/commitdiff
navigation MDL-20833 Moved has_navbar from OUTPUT to PAGE as it is logic
authorSam Hemelryk <sam@moodle.com>
Mon, 16 Nov 2009 01:12:16 +0000 (01:12 +0000)
committerSam Hemelryk <sam@moodle.com>
Mon, 16 Nov 2009 01:12:16 +0000 (01:12 +0000)
lib/outputrenderers.php
lib/pagelib.php
theme/standard/layout-popup.php
theme/standard/layout-topframe.php
theme/standard/layout.php

index 2bfe56be4b3dfcd60e5d7702972ff4e8d003ac58..04e2264f654fc0740f6d8fd7d4d6ba4a092267ec 100644 (file)
@@ -742,7 +742,7 @@ class moodle_core_renderer extends moodle_renderer_base {
         $COURSE = $this->page->course;
 
         // Required for legacy template uses
-        $navigation = $this->has_navbar();
+        $navigation = $this->page->has_navbar();
 
         ob_start();
         include($templatefile);
@@ -789,7 +789,7 @@ class moodle_core_renderer extends moodle_renderer_base {
         $course = $this->page->course;
         $performanceinfo = self::PERFORMANCE_INFO_TOKEN;
 
-        $navigation = $this->has_navbar();
+        $navigation = $this->page->has_navbar();
         if (!$menu && $navigation) {
             $menu = $loggedinas;
         }
@@ -2373,15 +2373,7 @@ class moodle_core_renderer extends moodle_renderer_base {
     public function navbar() {
         return $this->page->navbar->content();
     }
-
-    /**
-     * Checks to see if there are any items on the navbar object
-     * @return bool true if there are, false if not
-     */
-    public function has_navbar() {
-        return $this->page->navbar->has_items();
     }
-}
 
 
 /// RENDERERS
index 4cba5a38e1dda72aae844927acb9a14ae18337c1..a6316560449dfb009db43abbf4efeee4cfdf0170 100644 (file)
@@ -475,6 +475,17 @@ class moodle_page {
         return $this->_navbar;
     }
 
+    /**
+     * Checks to see if there are any items on the navbar object
+     * @return bool true if there are, false if not
+     */
+    public function has_navbar() {
+        if ($this->_navbar === null) {
+            $this->_navbar = new navbar($this);
+        }
+        return $this->_navbar->has_items();
+    }
+
     /**
      * Returns the settings navigation object
      * @return settings_navigation
index 9089fcb32c0655da6527bce40ffedf06aec4a929..8eaf1d9be3c292a2b59c858ef929ea5c6e2a1d7b 100644 (file)
@@ -17,7 +17,7 @@
     </div>
 <?php } ?>
 
-<?php if ($OUTPUT->has_navbar()) { // This is the navigation bar with breadcrumbs  ?>
+<?php if ($PAGE->has_navbar()) { // This is the navigation bar with breadcrumbs  ?>
     <div class="navbar clearfix">
         <div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
         <div class="navbutton"><?php echo $PAGE->button; ?></div>
index 9089fcb32c0655da6527bce40ffedf06aec4a929..8eaf1d9be3c292a2b59c858ef929ea5c6e2a1d7b 100644 (file)
@@ -17,7 +17,7 @@
     </div>
 <?php } ?>
 
-<?php if ($OUTPUT->has_navbar()) { // This is the navigation bar with breadcrumbs  ?>
+<?php if ($PAGE->has_navbar()) { // This is the navigation bar with breadcrumbs  ?>
     <div class="navbar clearfix">
         <div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
         <div class="navbutton"><?php echo $PAGE->button; ?></div>
index d328d110a9d8bdf03b282ac7cfd8f0fba9359c83..c379ee32bcccadd99a932e25b1fa108c0277a412 100644 (file)
@@ -17,7 +17,7 @@
     </div>
 <?php } ?>
 
-<?php if ($OUTPUT->has_navbar()) { // This is the navigation bar with breadcrumbs  ?>
+<?php if ($PAGE->has_navbar()) { // This is the navigation bar with breadcrumbs  ?>
     <div class="navbar clearfix">
         <div class="breadcrumb"><?php echo $OUTPUT->navbar(); ?></div>
         <div class="navbutton"><?php echo $PAGE->button; ?></div>