Instead of using the registry to get the PrinterNavigation system, add methods to...
authorRobert Sesek <rsesek@bluestatic.org>
Mon, 14 Jan 2008 19:58:38 +0000 (14:58 -0500)
committerRobert Sesek <rsesek@bluestatic.org>
Mon, 14 Jan 2008 19:58:38 +0000 (14:58 -0500)
* PrinterRootElementPage.php:
(BSPrinterRootElementPage::setNavigator): New method
(BSPrinterRootElementPage::getNavigator): New method

PrinterRootElementPage.php

index d75676b5808a4912ab495379c5b2cd9be8873a27..14e622f1c354f1b5b11e583a54347b93761b2d4d 100644 (file)
@@ -46,6 +46,12 @@ class BSPrinterRootElementPage extends BSPrinterRootElement
        */
        private $title;
        
+       /**
+        * Navigation object
+        * @var BSPrinterNavigation
+        */
+       private $navigator;
+       
        // ###################################################################
        /**
        * Constructor
@@ -69,6 +75,26 @@ class BSPrinterRootElementPage extends BSPrinterRootElement
                return $obj->newInstanceArgs($args);
        }
        
+       /**
+        * Sets the navigation object
+        *
+        * @param       BSPrinterNavigation Navigator
+        */
+       public function setNavigation(BSPrinterNavigation $nav)
+       {
+               $this->navigator = $nav;
+       }
+       
+       /**
+        * Returns the printer navigation object
+        *
+        * @return      BSPrinterNavigation     Navigation object
+        */
+       public function getNavigation()
+       {
+               return $this->navigatior;
+       }
+       
        // ###################################################################
        /**
        * Creates a redirect to another page; constructs the header and footer
@@ -265,16 +291,16 @@ class BSPrinterRootElementPage extends BSPrinterRootElement
                echo "\n\t<link rel=\"stylesheet\" href=\"" . BSPrinter::get_stylesheet() . "\" />";
                echo "\n</head>\n<body>\n";
                
-               if (BSApp::GetType('PrinterNavigation') AND (!defined('ISSO_PRINTER_NO_NAVIGATION') OR !constant('ISSO_PRINTER_NO_NAVIGATION')))
+               if ($this->navigator AND (!defined('ISSO_PRINTER_NO_NAVIGATION') OR !constant('ISSO_PRINTER_NO_NAVIGATION')))
                {
-                       echo BSApp::GetType('PrinterNavigation')->constructHeaderHtml();
+                       echo $this->navigator->constructHeaderHtml();
                }
                
                echo $this->_paintChildren();
                
-               if (BSApp::GetType('PrinterNavigation') AND (!defined('ISSO_PRINTER_NO_NAVIGATION') OR !constant('ISSO_PRINTER_NO_NAVIGATION')))
+               if ($this->navigator AND (!defined('ISSO_PRINTER_NO_NAVIGATION') OR !constant('ISSO_PRINTER_NO_NAVIGATION')))
                {
-                       echo BSApp::GetType('PrinterNavigation')->constructFooterHtml();
+                       echo $this->navigator->constructFooterHtml();
                }
                
                $copyright = "\n<br />\n<p align=\"center\" class=\"copyright\">\n\t" . BSPrinter::get_copyright() . "\n</p>";