From 30373899cf29faecd17f305e2cf4e622faf3c8cb Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 26 Dec 2006 00:29:27 +0000 Subject: [PATCH] - Updated printer_navigation.php to get BSPrinterNavigation, however this will be changing to become a more well-suited system - Added realm support to BSPrinter, and by extension BSPrinterRootElementPage --- Printer.php | 28 ++++++++++++++++++++++++ PrinterRootElementPage.php | 8 +++---- printer_navigation.php | 44 ++++++++++++-------------------------- 3 files changed, 46 insertions(+), 34 deletions(-) diff --git a/Printer.php b/Printer.php index 945859d..cd64c07 100644 --- a/Printer.php +++ b/Printer.php @@ -67,6 +67,12 @@ class BSPrinter */ private $stylesheet; + /** + * Realm; the extra bit added to the title + * @var string + */ + private $realm = 'BSPrinterOutput'; + // ################################################################### /** * Constructor (private) @@ -88,6 +94,28 @@ class BSPrinter return self::$instance; } + // ################################################################### + /** + * Returns the realm + * + * @return string Realm + */ + public static function GetRealm() + { + return self::_Instance()->realm; + } + + // ################################################################### + /** + * Sets the realm + * + * @param string Realm + */ + public static function SetRealm($realm) + { + self::_Instance()->realm = $realm; + } + // ################################################################### /** * Returns the language array diff --git a/PrinterRootElementPage.php b/PrinterRootElementPage.php index 7158a4c..7db6f67 100644 --- a/PrinterRootElementPage.php +++ b/PrinterRootElementPage.php @@ -51,7 +51,7 @@ class BSPrinterRootElementPage extends BSPrinterRootElement /** * Constructor * - * @param string Page title + * @param string Page title */ function __construct($title) { @@ -249,21 +249,21 @@ class BSPrinterRootElementPage extends BSPrinterRootElement echo "\n"; echo "\n"; - echo "\n\t" . sprintf(_('%1$s - %2$s'), BSRegister::GetApplication(), $this->title) . ""; + echo "\n\t" . sprintf(_('%1$s - %2$s - %3$s'), BSRegister::GetApplication(), BSPrinter::GetRealm(), $this->title) . ""; echo "\n\t"; echo "\n\t"; echo "\n\n\n"; if (BSRegister::GetType('PrinterNavigation') AND (!defined('ISSO_PRINTER_NO_NAVIGATION') OR !constant('ISSO_PRINTER_NO_NAVIGATION'))) { - echo BSRegister::GetType('PrinterNavigation')->generate_header_html(); + echo BSRegister::GetType('PrinterNavigation')->constructHeaderHtml(); } echo $this->_paintChildren(); if (BSRegister::GetType('PrinterNavigation') AND (!defined('ISSO_PRINTER_NO_NAVIGATION') OR !constant('ISSO_PRINTER_NO_NAVIGATION'))) { - echo BSRegister::GetType('PrinterNavigation')->generate_footer_html(); + echo BSRegister::GetType('PrinterNavigation')->constructFooterHtml(); } $copyright = "\n
\n

\n\t" . BSRegister::GetApplication() . ' ' . BSRegister::GetAppVersion() . ", ©2002 - " . gmdate('Y') . " Blue Static\n

"; diff --git a/printer_navigation.php b/printer_navigation.php index 02e0440..c623905 100644 --- a/printer_navigation.php +++ b/printer_navigation.php @@ -20,34 +20,27 @@ \*=====================================================================*/ /** -* Printer - Navigation Generator -* printer_navigation.php +* Printer: Navigation Generator (PrinterNavigation.php) * * @package ISSO */ /** -* Printer - Navigation Generator +* Printer: Navigation Generator * -* This framework works in conjunction with ISSO.Printer to generate a page header +* This framework works in conjunction with BSPrinter to generate a page header * and sidebar to be used for navigation. You set the navigation array and then can * specify a given key to highlight elements. Elements are broken into three types: * tabs (top of the page), groups (blocks of link actions), and links * * @author Blue Static -* @copyright Copyright ©2002 - [#]year[#], Blue Static +* @copyright Copyright (c)2002 - [#]year[#], Blue Static * @version $Revision$ * @package ISSO * */ -class Printer_Navigation +class BSPrinterNavigation { - /** - * Framework registry object - * @var object - */ - private $registry = null; - /** * Global links that are used for admin home, logout, etc. * @var array @@ -78,15 +71,6 @@ class Printer_Navigation */ private $focus = array('tab' => null, 'link' => null); - // ################################################################### - /** - * Constructor - */ - public function __construct(&$registry) - { - $this->registry =& $registry; - } - // ################################################################### /** * Adds a global link to the array; these cannot be removed once added @@ -94,7 +78,7 @@ class Printer_Navigation * @param string Link text * @param string HREF of the URL */ - public function add_top_link($text, $href) + public function addTopLink($text, $href) { $this->toplinks["$href"] = $text; } @@ -120,7 +104,7 @@ class Printer_Navigation * @param string Text to display (usually localized) * @param string URL to go to when text is clicked */ - public function add_component($scope, $key, $parent, $text, $url) + public function addComponent($scope, $key, $parent, $text, $url) { if ($scope == 'tab') { @@ -144,7 +128,7 @@ class Printer_Navigation * @param string Unique key in scope * @param string Parent operator (links only) */ - public function set_focus($scope, $key, $parent) + public function setFocus($scope, $key, $parent) { if ($scope == 'tab') { @@ -170,18 +154,18 @@ class Printer_Navigation } else { - trigger_error('Printer_Navigation::set_focus() only allows setting of focus for tab and link scopes'); + trigger_error('BSPrinterNavigation::setFocus() only allows setting of focus for tab and link scopes'); } } // ################################################################### /** - * Generates the header HTML that is called in ISSO.Printer->page_start() + * Generates the header HTML that is called in BSPrinterRootElementPage * to setup the navigation frame * * @return string Generated HTML content */ - public function generate_header_html() + public function constructHeaderHtml() { $output = '' . "\n\n"; @@ -194,7 +178,7 @@ class Printer_Navigation } $output .= "\n" . ''; @@ -249,12 +233,12 @@ class Printer_Navigation // ################################################################### /** - * Generates the HTML that is inserted in ISSO.Printer->page_end() that + * Generates the HTML that is inserted in BSPrinterRootElementPage that * closes all of the navigation HTML stuff * * @return string Generated HTML content */ - public function generate_footer_html() + public function constructFooterHtml() { $output = ''; -- 2.22.5