Adding toplink stuff
authorRobert Sesek <rsesek@bluestatic.org>
Sat, 1 Apr 2006 05:49:55 +0000 (05:49 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Sat, 1 Apr 2006 05:49:55 +0000 (05:49 +0000)
printer_navigation.php

index 2d398f84c179fb4c32487953b586acb6fffbd24c..0cfe891a5cff0891eb6f9479682302c4a46122b0 100644 (file)
@@ -49,6 +49,20 @@ class Printer_Navigation
        */
        var $registry = null;
        
+       /**
+       * Global links that are used for admin home, logout, etc.
+       * @var  array
+       * @access       private
+       */
+       var $toplinks = array();
+       
+       /**
+       * Navigational structure
+       * @var  array
+       * @access       private
+       */
+       var $structure = array();
+       
        // ###################################################################
        /**
        * Constructor
@@ -67,6 +81,20 @@ class Printer_Navigation
                $this->__construct($registry);
        }
        
+       // ###################################################################
+       /**
+       * Adds a global link to the array; these cannot be removed once added
+       *
+       * @access       public
+       *
+       * @param        string  Link text
+       * @param        string  HREF of the URL
+       */
+       function add_top_link($text, $href)
+       {
+               $this->toplinks["$href"] = $text;
+       }
+       
        // ###################################################################
        /**
        * Generates the header HTML that is called in ISSO.Printer->page_start()
@@ -78,6 +106,16 @@ class Printer_Navigation
        */
        function generate_header_html()
        {
+               $output = '<!-- navigation start -->' . "\n\n";
+               
+               $output2 = array();
+               foreach ($this->toplinks AS $href => $text)
+               {
+                       $output2[] = '<a href="' . $href . '" class="nav_toplink">' . $text . '</a>';
+               }
+               
+               $output .= implode(' &bull; ', $output2);
+               
                return $output;
        }
 }