null, 'link' => null); // ################################################################### /** * Constructor */ function __construct(&$registry) { $this->registry =& $registry; } // ################################################################### /** * (PHP 4) Constructor */ function Printer_Navigation(&$registry) { $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; } // ################################################################### /** * Adds to the structure array. The following is the global structure * of the array, but you can specify any entry point. When you add onto * the structure, it will go at the bottom * array( * 'unique_key' => array( * '
unique_key' => array( * 'unique_key' => array('text', 'url') * ) * ) * ) * * Note that the portion in brackets is called the "scope" * * @access public * * @param string Scope to add to * @param string Unique key for the scope * @param string Parent key to add to * @param string Text to display (usually localized) * @param string URL to go to when text is clicked */ function add_component($scope, $key, $parent, $text, $url) { if ($scope == 'tab') { $this->tabs["$key"] = array($text, $url); } else if ($scope == 'section') { $this->sections["$parent"]["$key"] = $text; } else if ($scope == 'link') { $this->links["$parent"]["$key"] = array($text, $url); } } // ################################################################### /** * Sets the focus for either a tab or link * * @access public * * @param string Scope operator * @param string Unique key in scope * @param string Parent operator (links only) */ function set_focus($scope, $key, $parent) { if ($scope == 'tab') { if (isset($this->tabs["$key"])) { $this->focus["$scope"] = $key; } else { trigger_error('Invalid key for scope', E_USER_WARNING); } } else if ($scope == 'link') { if (isset($this->links["$parent"]["$key"])) { $this->focus["$scope"] = $key; } else { trigger_error('Invalid key for scope', E_USER_WARNING); } } else { trigger_error('Printer_Navigation::set_focus() only allows setting of focus for tab and link scopes', E_USER_ERROR); } } // ################################################################### /** * Generates the header HTML that is called in ISSO.Printer->page_start() * to setup the navigation frame * * @access public * * @return string Generated HTML content */ function generate_header_html() { $output = '' . "\n\n"; // ------------------------------------------------------------------- $output2 = array(); foreach ($this->toplinks AS $href => $text) { $output2[] = '' . $text . ''; } $language = $this->registry->modules['printer']->getLanguageInformation(); $output .= "\n" . ''; // ------------------------------------------------------------------- $output .= "\n\n" . '
'; // ------------------------------------------------------------------- $output .= "\n" . '
'; foreach ($this->tabs AS $key => $content) { $link = "\n\t" . 'focus['tab'] == $key) { $link .= ' id="focustab"'; } $link .= '>' . $content[0] . ''; $output .= $link; } $output .= "\n" . '
'; // ------------------------------------------------------------------- $output .= "\n\n" . ''; $output .= "\n" . ''; // ------------------------------------------------------------------- $output .= "\n" . ''; // ------------------------------------------------------------------- $output .= "\n" . ''; $output .= "\n" . ''; $output .= "\n\n" . '
'; $output .= "\n\n" . '' . "\n"; return $output; } // ################################################################### /** * Generates the HTML that is inserted in ISSO.Printer->page_end() that * closes all of the navigation HTML stuff * * @access public * * @return string Generated HTML content */ function generate_footer_html() { $output = ''; $output .= "\n" . '' . "\n"; $output .= "\n" . '
'; $output .= "\n\n" . '
'; return $output; } } /*=====================================================================*\ || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>