Removed unused cruft from printNav.
authorjollytoad <jollytoad>
Tue, 31 Aug 2004 08:39:03 +0000 (08:39 +0000)
committerjollytoad <jollytoad>
Tue, 31 Aug 2004 08:39:03 +0000 (08:39 +0000)
Added printTitleNav - to being cleanup of page titles.

classes/Misc.php

index 5fd01aa3ebdb9eb8f5e8c0d9191a20691f1ef562..19e83f6e4d95b94e9f25ba0f23fc8eebd56bd4b5 100644 (file)
@@ -2,7 +2,7 @@
        /**
         * Class to hold various commonly used functions
         *
-        * $Id: Misc.php,v 1.87 2004/08/26 08:29:56 jollytoad Exp $
+        * $Id: Misc.php,v 1.88 2004/08/31 08:39:03 jollytoad Exp $
         */
         
        class Misc {
                 * Display a navigation tab bar.
                 * @param $section The name of the tab bar.
                 * @param $activetab The tab to highlight and set as default for the bar.
-                * @param $trail A bread crumb trail, or true for default trail, false for no trail.
                 */
-               function printNav($section, $activetab, $trail = true) {
+               function printNav($section, $activetab) {
                        global $data;
                        
                        echo "<div class=\"nav\">\n";
                        
-                       if ($trail === true) {
-                               $this->printTrail($this->getTrail($section));
-                       }
-                       elseif (is_string($trail)) {
-                               $this->printTrail($this->getTrail($trail));
-                       }
-                       elseif (is_array($trail)) {
-                               $this->printTrail($trail);
-                       }
+                       $this->printTrail($this->getTrail($section));
                        
                        switch ($section) {
                                case 'database':
                        echo "</div>\n";
                }
 
+               function printTitleNav($section, $title, $help = null) {
+                       global $data, $lang;
+                       
+                       echo "<div class=\"nav\">\n";
+                       
+                       $this->printTrail($this->getTrail($section));
+                       
+                       echo "<div class=\"trail\"><span class=\"title\">{$title}</span>";
+                       
+                       if (!is_null($help) && isset($data->help_page[$help])) {
+                               echo "<a class=\"help\" href=\"";
+                               echo htmlspecialchars($data->help_base . $data->help_page[$help]);
+                               echo "\" title=\"{$lang['strhelp']}\">?</a>";
+                       }
+                       
+                       echo "</div>\n</div>\n";
+               }
+               
                /**
                 * Get the URL for the last active tab of a particular tab bar.
                 */