Adding toplink stuff
[isso.git] / printer_navigation.php
1 <?php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Iris Studios Shared Object Framework [#]issoversion[#]
5 || # Copyright ©2002-[#]year[#] Iris Studios, Inc.
6 || #
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
10 || #
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 || # more details.
15 || #
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
21
22 /**
23 * Printer - Navigation Generator
24 * printer_navigation.php
25 *
26 * @package ISSO
27 */
28
29 /**
30 * Printer - Navigation Generator
31 *
32 * This framework works in conjunction with ISSO.Printer to generate a page header
33 * and sidebar to be used for navigation. You set the navigation array and then can
34 * specify a given key to highlight elements. Elements are broken into three types:
35 * tabs (top of the page), groups (blocks of link actions), and links
36 *
37 * @author Iris Studios, Inc.
38 * @copyright Copyright ©2002 - [#]year[#], Iris Studios, Inc.
39 * @version $Revision$
40 * @package ISSO
41 *
42 */
43 class Printer_Navigation
44 {
45 /**
46 * Framework registry object
47 * @var object
48 * @access private
49 */
50 var $registry = null;
51
52 /**
53 * Global links that are used for admin home, logout, etc.
54 * @var array
55 * @access private
56 */
57 var $toplinks = array();
58
59 /**
60 * Navigational structure
61 * @var array
62 * @access private
63 */
64 var $structure = array();
65
66 // ###################################################################
67 /**
68 * Constructor
69 */
70 function __construct(&$registry)
71 {
72 $this->registry =& $registry;
73 }
74
75 // ###################################################################
76 /**
77 * (PHP 4) Constructor
78 */
79 function Printer_Navigation(&$registry)
80 {
81 $this->__construct($registry);
82 }
83
84 // ###################################################################
85 /**
86 * Adds a global link to the array; these cannot be removed once added
87 *
88 * @access public
89 *
90 * @param string Link text
91 * @param string HREF of the URL
92 */
93 function add_top_link($text, $href)
94 {
95 $this->toplinks["$href"] = $text;
96 }
97
98 // ###################################################################
99 /**
100 * Generates the header HTML that is called in ISSO.Printer->page_start()
101 * to setup the navigation frame
102 *
103 * @access public
104 *
105 * @return string Generated HTML content
106 */
107 function generate_header_html()
108 {
109 $output = '<!-- navigation start -->' . "\n\n";
110
111 $output2 = array();
112 foreach ($this->toplinks AS $href => $text)
113 {
114 $output2[] = '<a href="' . $href . '" class="nav_toplink">' . $text . '</a>';
115 }
116
117 $output .= implode(' &bull; ', $output2);
118
119 return $output;
120 }
121 }
122
123 /*=====================================================================*\
124 || ###################################################################
125 || # $HeadURL$
126 || # $Id$
127 || ###################################################################
128 \*=====================================================================*/
129 ?>