) * @var string */ private $realm = '[UNDEFINED REALM]'; /** * CSS to place in the page * @var string */ private $css = ''; /** * Extra code to place * @var sring */ private $code = ''; /** * Page-start hooko * @var string */ private $page_start_hook = ':=NO METHOD=:'; /** * Language information array: ('langcode' =>, 'direction' =>, 'charset' =>) * @var array */ private $language = array('langcode' => 'en_US', 'direction' => 'ltr', 'charset' => 'utf-8'); // ################################################################### /** * Sets the realm (or title) of the printed output * * @param string Title/realm */ public function setRealm($realm) { $this->realm = $realm; } // ################################################################### /** * Sets the language array information * * @param array Language array */ public function setLanguageInformation($lang) { $this->language = $lang; } // ################################################################### /** * Creates a redirect to another page; constructs the header and footer * (therefore execution stops) * * @param string Location to redirect to * @param string Redirect message to be shown * @param array An aray of POST variables to send through on the redirect */ public function redirect($location, $message = null, $postvars = array()) { $js = ' '; if (!defined('ISSO_PRINTER_NO_NAVIGATION')) { define('ISSO_PRINTER_NO_NAVIGATION', 1); } $this->page_start(_('Redirect')); if ($postvars) { $this->form_start($location, null, false, 'postvars'); foreach ($postvars AS $key => $value) { $this->form_hidden_field($key, $value); } $this->form_end(); } $redir = sprintf(_('Please wait to be redirected. If you are not redirected in a few seconds, click here.'), $location); $override = false; if ($message == null) { $showmessage = $redir; } else { $showmessage = '
' . $message . ''; $showmessage .= "\n
" . $redir . "
"; $override = true; } $this->page_message(_('Redirect'), $showmessage, $override); $this->page_code($js); $this->page_end(); } // ################################################################### /** * Produces an entire page layout that asks the user whether or not * they want to perform X action and provides a link to the YES and NO * action * * @param string Message that asks if they want to do X * @param string Location to go for YES * @param string DO action to pass * @param array Hidden parameters to pass to the next page */ public function confirm($message, $location, $action, $params) { if (!defined('ISSO_PRINTER_NO_NAVIGATION')) { define('ISSO_PRINTER_NO_NAVIGATION', 1); } $this->page_start(_('Confirm')); $this->form_start($location, $action); foreach ($params AS $key => $value) { $this->form_hidden_field($key, $value); } $this->table_start(true, '75%'); $this->table_head(_('Confirm'), 1); $this->row_span("$message", ':swap:', 'left', 1); $this->row_submit('', _('Yes'), ''); $this->table_end(); $this->form_end(); $this->page_end(); } // ################################################################### /** * Throws a fatal error; constructs the header and footer * * @param string Error messsage text */ public function error($message) { if (!defined('ISSO_PRINTER_NO_NAVIGATION')) { define('ISSO_PRINTER_NO_NAVIGATION', 1); } $this->page_start(_('Error')); $this->page_message(_('Error'), $message); $this->page_end(); exit; } // ################################################################### /** * Links CSS to the page from a given relative path * * @param string Relative path to the CSS file */ public function css_link($path) { $this->css .= "\n\t"; } // ################################################################### /** * Imbeds actual CSS information into the page in "; } // ################################################################### /** * Places raw HTML code directly into the documet at the current * position * * @param string HTML code */ public function page_code($code) { if (defined('ISSO_PRINTER_DONE_HEADER')) { echo "\n\n$code\n\n"; } else { $this->code .= "\n\n$code\n\n"; } } // ################################################################### /** * A block function that produces a table with a message in it. This * does not print the header and footer. * * @param string The title of the message (appears at the top of the block) * @param string Content of the message * @param bool Override the message: control the entire output (no
)? */ public function page_message($title, $message, $overridemessage = false) { $this->table_start(true, '75%'); $this->table_head($title, 1); $this->row_span(($overridemessage ? $message : "$message"), ':swap:', 'left', 1); $this->table_end(); } // ################################################################### /** * Closes the HTML document structure an adds the copyright; this also * stops execution of the page */ public function page_end() { if (BSRegister::GetDebug() AND isset($_GET['query'])) { ob_clean(); ob_end_clean(); if (is_array($this->registry->modules[ISSO_DB_LAYER]->history)) { foreach ($this->registry->modules[ISSO_DB_LAYER]->history AS $query) { echo $this->registry->modules[ISSO_DB_LAYER]->construct_query_debug($query); } } exit; } if ($this->registry->is_loaded('printer_navigation') AND (!defined('ISSO_PRINTER_NO_NAVIGATION') OR (defined('ISSO_PRINTER_NO_NAVIGATION') AND constant('ISSO_PRINTER_NO_NAVIGATION') != true))) { echo $this->registry->modules['printer_navigation']->generate_footer_html(); } $copyright = "\n
\n"; if (!defined('ISSO_PRINTER_HIDE_SETUP')) { echo "\n$copyright"; echo $this->registry->construct_debug_block(false); } echo "\n\n