) * @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

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

"; if (!defined('ISSO_PRINTER_HIDE_SETUP')) { echo "\n$copyright"; echo $this->registry->construct_debug_block(false); } echo "\n\n\n"; exit; } // ------------------------------------------------------------------- // ################################################################### /** * Opens a tag with styling * * @param bool Whether to add a
before the table * @param string Value of the width attribute */ public function table_start($break = true, $width = '90%') { if ($break) { echo '
'; } echo "\n
\n"; } // ################################################################### /** * Adds a table row that is sued to head the entire table * * @param string Title string * @param integer Colspan attribute value */ public function table_head($title, $colspan = 2) { echo "\n\t\n\n"; } // ################################################################### /** * Creates column headings; useful for a grid-style page. This uses a * different styling than table_head() and is usually used directly * after a table header. * * @param array Array of titles to print */ public function table_column_head($columnarray) { if (is_array($columnarray)) { $render = "\n"; foreach ($columnarray AS $header) { $render .= "\t\n"; } $render .= "\n"; echo $render; } } // ################################################################### /** * Closes a
$title
$header
tag */ public function table_end() { echo "\n
\n"; } // ------------------------------------------------------------------- // ################################################################### /** * Starts a
tag and adds the DO hidden input field * * @param string Action/name of the file to action to * @param string Value of the DO parameter; used to do-branch * @param bool Enctype attribute; used for mime/multi-part * @param string Name of the form; this only matters for DOM access * @param string Method to action as; POST or GET (default is POST) */ public function form_start($action, $do, $enctype = false, $name = 'inputform', $submitmethod = 'post') { echo "\n\n\n"; if ($do !== null) { $this->form_hidden_field('do', $do); } } // ################################################################### /** * Adds a hidden field at the current location * * @param string Name of the field * @param string Value of the field */ public function form_hidden_field($name, $value) { echo "\n"; } // ################################################################### /** * Closes a tag */ public function form_end() { echo "
\n\n"; } // ------------------------------------------------------------------- // ################################################################### /** * Creates a table row that has more than two columns; this is used in * conjunction with table_column_head() usually; it takes an array of * values * * @param array Array of values in form value => alignment key (c for center, l for left, and r for right) */ public function row_multi_item($row_array) { BSFunctions::SwapCssClasses(); foreach ($row_array AS $item => $align) { $row_data["$align"][] = $item; } echo ""; foreach ($row_data AS $align_key => $item_array) { if ($align_key == 'c') { $align = 'center'; } else if ($align_key == 'l') { $align = 'left'; } else if ($align_key == 'r') { $align = 'right'; } foreach ($item_array AS $value) { echo "\n\t$value"; } } echo "\n\n"; } // ################################################################### /** * Generic row creation function that has two columns: label and value; * this is used for many other form functions, but can also be used for * non-editable fields * * @param string Label text * @param string HTML or text to place in the value column * @param string Vertical align (valign attribute) for the row * @param integer Colspan attribute * @param string Class to style the row with; default is to alternate */ public function row_text($label, $value = ' ', $valign = 'top', $colspan = 2, $class = -1) { global $IS_SETTINGS; if ($class == -1) { if (!$IS_SETTINGS) { BSFunctions::SwapCssClasses(); $row_class = BSFunctions::$cssClass; } else { $row_class = 'alt2'; } } else { $row_class = $class; } echo ""; echo "\n\t$label"; echo "\n\t$value"; echo "\n\n"; } // ################################################################### /** * Creates a table row with a ", 'top', $colspan); } // ################################################################### /** * Creates an upload row; you need to specify some other paramaters in * form_start() for this to work * * @param string Label text * @param string Upload name * @param integer Colspan attribute */ public function row_upload($label, $name, $colspan = 2) { $this->row_text($label, "", 'top', $colspan); } // ################################################################### /** * Adds a name-value pair to an array that is constructed into a * table row from list_item() items * * @param string Label text * @param string Name of the $optionlist\n" . ($is_jump ? "\n" : '') . "\n", $colspan); } // ################################################################### /** * Assembles a list of checkboxes from list_item() items * * @param string Label text * @param string Name of the s * @param integer Colspan attribute */ public function row_checkbox($label, $name, $colspan = 2) { global $listitem; foreach ($listitem AS $value => $box) { $optionlist[] = "\n\t $box[name]"; } $listitem = array(); $this->row_text($label, "\n" . implode('
', $optionlist) . "\n", $colspan); } // ################################################################### /** * Creates a row with two radio buttons: yes and now * * @param string Label text * @param string Name of the BOOL flag * @param bool TRUE to select the YES by default; FALSE for NO * @param integer Colspan attribute */ public function row_yesno($label, $name, $value, $colspan = 2) { $this->row_text($label, " " . _('Yes') . " " . _('No'), $colspan); } } /*=====================================================================*\ || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>