From 4e8d404168b181ee60f61ba91722e6a842014a48 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 24 Jan 2008 16:55:33 -0500 Subject: [PATCH] Renaming all the classes for the Printer to match the name of the file --- Printer.php | 14 +++--- PrinterAbstract.php | 4 +- PrinterElement.php | 8 ++-- PrinterElementLabel.php | 6 +-- PrinterElementTable.php | 94 ++++++++++++++++++++--------------------- PrinterNavigation.php | 4 +- PrinterRootAbstract.php | 10 ++--- PrinterRootForm.php | 12 +++--- PrinterRootPage.php | 60 +++++++++++++------------- PrinterRootTable.php | 18 ++++---- 10 files changed, 115 insertions(+), 115 deletions(-) diff --git a/Printer.php b/Printer.php index e40fc33..21f8452 100644 --- a/Printer.php +++ b/Printer.php @@ -25,14 +25,14 @@ * @package ISSO */ +require_once(ISSO . '/PrinterAbstract.php'); require_once(ISSO . '/PrinterElement.php'); -require_once(ISSO . '/PrinterBaseElement.php'); -require_once(ISSO . '/PrinterLabelElement.php'); -require_once(ISSO . '/PrinterRootElement.php'); -require_once(ISSO . '/PrinterRootElementPage.php'); -require_once(ISSO . '/PrinterRootElementTable.php'); -require_once(ISSO . '/PrinterRootElementForm.php'); -require_once(ISSO . '/PrinterTableElement.php'); +require_once(ISSO . '/PrinterElementLabel.php'); +require_once(ISSO . '/PrinterElementTable.php'); +require_once(ISSO . '/PrinterRootAbstract.php'); +require_once(ISSO . '/PrinterRootForm.php'); +require_once(ISSO . '/PrinterRootPage.php'); +require_once(ISSO . '/PrinterRootTable.php'); require_once(ISSO . '/PrinterNavigation.php'); /** diff --git a/PrinterAbstract.php b/PrinterAbstract.php index 38c9d7c..6e9d12a 100644 --- a/PrinterAbstract.php +++ b/PrinterAbstract.php @@ -20,7 +20,7 @@ \*=====================================================================*/ /** -* Printer Element Abstract Class (PrinterElement.php) +* Printer Element Abstract Class (PrinterAbstract.php) * * @package ISSO */ @@ -36,7 +36,7 @@ * @package ISSO * */ -abstract class BSPrinterElement +abstract class BSPrinterAbstract { /** * Style information diff --git a/PrinterElement.php b/PrinterElement.php index 438d709..7ed95d6 100644 --- a/PrinterElement.php +++ b/PrinterElement.php @@ -25,7 +25,7 @@ * @package ISSO */ -require_once(ISSO . '/PrinterElement.php'); +require_once(ISSO . '/PrinterAbstract.php'); /** * Base Printer Element @@ -39,7 +39,7 @@ require_once(ISSO . '/PrinterElement.php'); * @package ISSO * */ -class BSPrinterBaseElement extends BSPrinterElement +class BSPrinterElement extends BSPrinterAbstract { /** * The name of the element @@ -116,7 +116,7 @@ class BSPrinterBaseElement extends BSPrinterElement { if (!in_array($this->type, array('checkbox', 'radio', 'option'))) { - throw new Exception('BSPrinterBaseElement::setActive() can only be used on elements of type checkbox, radio, or option'); + throw new Exception('BSPrinterElement::setActive() can only be used on elements of type checkbox, radio, or option'); } $this->active = $active; } @@ -225,7 +225,7 @@ class BSPrinterBaseElement extends BSPrinterElement case 'textarea': if (!isset($this->style['height']) || !isset($this->style['width'])) { - throw new Exception('BSPrinterBaseElement of type "textarea" require a "height" and "width" style attribute'); + throw new Exception('BSPrinterElement of type "textarea" require a "height" and "width" style attribute'); } return '_prepareStyle() . $accesskey . '>' . $this->value . ''; diff --git a/PrinterElementLabel.php b/PrinterElementLabel.php index 05fe979..d422c77 100644 --- a/PrinterElementLabel.php +++ b/PrinterElementLabel.php @@ -20,12 +20,12 @@ \*=====================================================================*/ /** -* Printer Label Element (PrinterLabelElement.php) +* Printer Label Element (PrinterElementLabel.php) * * @package ISSO */ -require_once(ISSO . '/PrinterElement.php'); +require_once(ISSO . '/PrinterAbstract.php'); /** * Printer Label Element @@ -38,7 +38,7 @@ require_once(ISSO . '/PrinterElement.php'); * @package ISSO * */ -class BSPrinterLabelElement extends BSPrinterElement +class BSPrinterElementLabel extends BSPrinterAbstract { /** * The value to print diff --git a/PrinterElementTable.php b/PrinterElementTable.php index c7515cb..5cc65d4 100644 --- a/PrinterElementTable.php +++ b/PrinterElementTable.php @@ -20,13 +20,13 @@ \*=====================================================================*/ /** -* Printer Table Element (PrinterTableElement.php) +* Printer Table Element (PrinterElementTable.php) * * @package ISSO */ -require_once(ISSO . '/PrinterRootElementTable.php'); -require_once(ISSO . '/PrinterBaseElement.php'); +require_once(ISSO . '/PrinterRootTable.php'); +require_once(ISSO . '/PrinterElement.php'); /** * Printer Table Element @@ -38,7 +38,7 @@ require_once(ISSO . '/PrinterBaseElement.php'); * @package ISSO * */ -class BSPrinterTableElement extends BSPrinterElement +class BSPrinterElementTable extends BSPrinterAbstract { /** * Array of child nodes @@ -57,7 +57,7 @@ class BSPrinterTableElement extends BSPrinterElement * Creates a table element; takes a variable number of arguments which * are added as children in the order passed * - * @param BSPrinterTableElement... Variable number (or no) children + * @param BSPrinterElementTable... Variable number (or no) children */ public function __construct() { @@ -87,14 +87,14 @@ class BSPrinterTableElement extends BSPrinterElement * @param string Label (left side) * @param string Value (right side) * - * @return BSPrinterTableElement Table row element + * @return BSPrinterElementTable Table row element */ public static function row_label($label, $value) { - $tr = new BSPrinterTableElement(); + $tr = new BSPrinterElementTable(); - $tr->addChild(new BSPrinterLabelElement($label)); - $tr->addChild(new BSPrinterLabelElement($value)); + $tr->addChild(new BSPrinterElementLabel($label)); + $tr->addChild(new BSPrinterElementLabel($value)); return $tr; } @@ -112,10 +112,10 @@ class BSPrinterTableElement extends BSPrinterElement */ public static function row_text($label, $name, $value = null, $password = false) { - $tr = new BSPrinterTableElement(); + $tr = new BSPrinterElementTable(); - $tr->addChild(new BSPrinterLabelElement($label)); - $tr->addChild(new BSPrinterBaseElement(($password ? 'password' : 'text'), $name, $value)); + $tr->addChild(new BSPrinterElementLabel($label)); + $tr->addChild(new BSPrinterElement(($password ? 'password' : 'text'), $name, $value)); return $tr; } @@ -128,7 +128,7 @@ class BSPrinterTableElement extends BSPrinterElement * @param string Save button text * @param string Reset button text * - * @return BSPrinterTableElement Table row element + * @return BSPrinterElementTable Table row element */ public static function row_submit(Array $children = null, $save = ':submit:', $reset = ':reset:') { @@ -146,20 +146,20 @@ class BSPrinterTableElement extends BSPrinterElement if (!is_null($save)) { - $elm = new BSPrinterBaseElement('submit', '__submit__', " $save "); + $elm = new BSPrinterElement('submit', '__submit__', " $save "); $elm->setAccessKey('s'); $build .= "\n\t\t\t" . $elm->paint(); } if (!is_null($reset)) { - $elm = new BSPrinterBaseElement('reset', '__reset__', " $reset "); + $elm = new BSPrinterElement('reset', '__reset__', " $reset "); $elm->setAccessKey('r'); $build .= "\n\t\t\t" . $elm->paint() . "\n\t\t"; } - $tr = new BSPrinterTableElement(); - $tr->addChild(new BSPrinterLabelElement($build)); + $tr = new BSPrinterElementTable(); + $tr->addChild(new BSPrinterElementLabel($build)); $tr->setCssClass('tfoot'); return $tr; @@ -167,13 +167,13 @@ class BSPrinterTableElement extends BSPrinterElement // ################################################################### /** - * Constructs a row from an array of BSPrinterElement's * * @param string Label * @param string Name - * @param array Array of BSPrinterBaseElement[option]'s + * @param array Array of BSPrinterElement[option]'s * - * @return BSPrinterTableElement Table row + * @return BSPrinterElementTable Table row */ public static function row_list($label, $name, Array $options) { @@ -186,27 +186,27 @@ class BSPrinterTableElement extends BSPrinterElement } else { - throw new Exception('Only BSPrinterBaseElement\'s of type "option" are allowed in BSPrinterTableElement::row_list()'); + throw new Exception('Only BSPrinterElement\'s of type "option" are allowed in BSPrinterElementTable::row_list()'); } } - $tr = new BSPrinterTableElement(); + $tr = new BSPrinterElementTable(); - $tr->addChild(new BSPrinterLabelElement($label)); - $tr->addChild(new BSPrinterBaseElement('select', $name, $build)); + $tr->addChild(new BSPrinterElementLabel($label)); + $tr->addChild(new BSPrinterElement('select', $name, $build)); return $tr; } // ################################################################### /** - * Constructs a row from an array of BSPrinterBaseElement's of checkboxes + * Constructs a row from an array of BSPrinterElement's of checkboxes * * @param string Label * @param string Name - * @param array Array of BSPrinterBaseElement[checkbox]'s that follow array(box label => BSPrinterBaseElement) + * @param array Array of BSPrinterElement[checkbox]'s that follow array(box label => BSPrinterElement) * - * @return BSPrinterTableElement Table row + * @return BSPrinterElementTable Table row */ public static function row_checkbox($label, $name, Array $boxes) { @@ -223,14 +223,14 @@ class BSPrinterTableElement extends BSPrinterElement } else { - throw new Exception('Only BSPrinterBaseElement\'s of type "checkbox" are allowed in BSPrinterTableElement::row_checkbox()'); + throw new Exception('Only BSPrinterElement\'s of type "checkbox" are allowed in BSPrinterElementTable::row_checkbox()'); } } - $tr = new BSPrinterTableElement(); + $tr = new BSPrinterElementTable(); - $tr->addChild(new BSPrinterLabelElement($label)); - $tr->addChild(new BSPrinterLabelElement($build)); + $tr->addChild(new BSPrinterElementLabel($label)); + $tr->addChild(new BSPrinterElementLabel($build)); return $tr; } @@ -243,14 +243,14 @@ class BSPrinterTableElement extends BSPrinterElement * @param string Label for the element * @param string Name of the * - * @return BSPrinterTableElement Upload form + * @return BSPrinterElementTable Upload form */ public static function row_upload($label, $name) { - $tr = new BSPrinterTableElement(); + $tr = new BSPrinterElementTable(); - $tr->addChild(new BSPrinterLabelElement($label)); - $tr->addChild(new BSPrinterBaseElement('upload', $name)); + $tr->addChild(new BSPrinterElementLabel($label)); + $tr->addChild(new BSPrinterElement('upload', $name)); return $tr; } @@ -263,23 +263,23 @@ class BSPrinterTableElement extends BSPrinterElement * @param string Name of the radio buttons * @param bool Yes is selected? (if false, No is selected) * - * @return BSPrinterTableElement Yes-No row + * @return BSPrinterElementTable Yes-No row */ public static function row_yes_no($label, $name, $yes) { - $elm = new BSPrinterBaseElement('radio', $name, 1); + $elm = new BSPrinterElement('radio', $name, 1); $elm->setActive($yes); $build = $elm->paint() . ' ' . _('Yes') . ' '; - $elm = new BSPrinterBaseElement('radio', $name, 0); + $elm = new BSPrinterElement('radio', $name, 0); $elm->setActive(!$yes); $build .= $elm->paint() . ' ' . _('No'); - $tr = new BSPrinterTableElement(); - $tr->addChild(new BSPrinterLabelElement($label)); - $tr->addChild(new BSPrinterLabelElement($build)); + $tr = new BSPrinterElementTable(); + $tr->addChild(new BSPrinterElementLabel($label)); + $tr->addChild(new BSPrinterElementLabel($build)); return $tr; } @@ -291,14 +291,14 @@ class BSPrinterTableElement extends BSPrinterElement * @param string Textarea name * @param string Value to fill with * - * @return BSPrinterTableElement Table row + * @return BSPrinterElementTable Table row */ public static function row_textarea($label, $name, $value = null) { - $tr = new BSPrinterTableElement(); + $tr = new BSPrinterElementTable(); - $tr->addChild(new BSPrinterLabelElement($label)); - $tr->addChild(new BSPrinterBaseElement('textarea', $name, $value)); + $tr->addChild(new BSPrinterElementLabel($label)); + $tr->addChild(new BSPrinterElement('textarea', $name, $value)); return $tr; } @@ -318,11 +318,11 @@ class BSPrinterTableElement extends BSPrinterElement /** * Adds a child node to the element * - * @param BSPrinterElement A child element + * @param BSPrinterAbstract A child element * * @return fluent interface */ - public function addChild(BSPrinterElement $child) + public function addChild(BSPrinterAbstract $child) { $this->children[] = $child; return $this; diff --git a/PrinterNavigation.php b/PrinterNavigation.php index 7a7e33c..ee0fb1a 100644 --- a/PrinterNavigation.php +++ b/PrinterNavigation.php @@ -98,7 +98,7 @@ class BSPrinterNavigation } /** - * Generates the header HTML that is called in BSPrinterRootElementPage + * Generates the header HTML that is called in BSPrinterRootPage * to setup the navigation frame * * @return string Generated HTML content @@ -213,7 +213,7 @@ class BSPrinterNavigation } /** - * Generates the HTML that is inserted in BSPrinterRootElementPage that + * Generates the HTML that is inserted in BSPrinterRootPage that * closes all of the navigation HTML stuff * * @return string Generated HTML content diff --git a/PrinterRootAbstract.php b/PrinterRootAbstract.php index de30f39..0f45699 100644 --- a/PrinterRootAbstract.php +++ b/PrinterRootAbstract.php @@ -20,12 +20,12 @@ \*=====================================================================*/ /** -* Printer Root Element (PrinterRootElement.php) +* Printer Root Element (PrinterRootAbstract.php) * * @package ISSO */ -require_once(ISSO . '/PrinterElement.php'); +require_once(ISSO . '/PrinterAbstract.php'); /** * Printer Root Element @@ -39,7 +39,7 @@ require_once(ISSO . '/PrinterElement.php'); * @package ISSO * */ -abstract class BSPrinterRootElement extends BSPrinterElement +abstract class BSPrinterRootAbstract extends BSPrinterAbstract { /** * Child elements @@ -56,11 +56,11 @@ abstract class BSPrinterRootElement extends BSPrinterElement /** * Adds a child node to the element * - * @param BSPrinterElement A child element + * @param BSPrinterAbstract A child element * * @return fluent interface */ - public function addChild(BSPrinterElement $child) + public function addChild(BSPrinterAbstract $child) { $this->children[] = $child; return $this; diff --git a/PrinterRootForm.php b/PrinterRootForm.php index d059585..c04dacf 100644 --- a/PrinterRootForm.php +++ b/PrinterRootForm.php @@ -20,12 +20,12 @@ \*=====================================================================*/ /** -* Printer Root Element: Form (PrinterRootElementForm.php) +* Printer Root Element: Form (PrinterRootForm.php) * * @package ISSO */ -require_once(ISSO . '/PrinterRootElement.php'); +require_once(ISSO . '/PrinterRootAbstract.php'); /** * Printer Root Element: Form @@ -38,7 +38,7 @@ require_once(ISSO . '/PrinterRootElement.php'); * @package ISSO * */ -class BSPrinterRootElementForm extends BSPrinterRootElement +class BSPrinterRootForm extends BSPrinterRootAbstract { /** * The form's action (or the controller to respond to) @@ -105,11 +105,11 @@ class BSPrinterRootElementForm extends BSPrinterRootElement /** * Adds a table row into the child list * - * @param BSPrinterElement Table element + * @param BSPrinterAbstract Table element * * @return fluent interface */ - public function addChild(BSPrinterElement $tr) + public function addChild(BSPrinterAbstract $tr) { $this->children[] = $tr; return $this; @@ -141,7 +141,7 @@ class BSPrinterRootElementForm extends BSPrinterRootElement */ public function paint() { - array_push($this->children, new BSPrinterBaseElement('hidden', 'action', $this->action)); + array_push($this->children, new BSPrinterElement('hidden', 'action', $this->action)); return "\n
name . "\" action=\"" . $this->controller . "\" method=\"post\"" . ($this->upload ? ' enctype="mime/multi-part"' : '') . ">\n" . $this->_paintChildren() . "\n
"; } diff --git a/PrinterRootPage.php b/PrinterRootPage.php index 33c29ab..f236594 100644 --- a/PrinterRootPage.php +++ b/PrinterRootPage.php @@ -20,12 +20,12 @@ \*=====================================================================*/ /** -* Printer Root Element: Page (PrinterRootElementPage.php) +* Printer Root Element: Page (PrinterRootPage.php) * * @package ISSO */ -require_once(ISSO . '/PrinterRootElement.php'); +require_once(ISSO . '/PrinterRootAbstract.php'); /** * Printer Root Element: Page @@ -38,7 +38,7 @@ require_once(ISSO . '/PrinterRootElement.php'); * @package ISSO * */ -class BSPrinterRootElementPage extends BSPrinterRootElement +class BSPrinterRootPage extends BSPrinterRootAbstract { /** * The page title @@ -115,9 +115,9 @@ class BSPrinterRootElementPage extends BSPrinterRootElement define('ISSO_PRINTER_NO_NAVIGATION', 1); } - $page = new BSPrinterRootElementPage(_('Redirect')); + $page = new BSPrinterRootPage(_('Redirect')); - $page->addChild(new BSPrinterLabelElement(' + $page->addChild(new BSPrinterElementLabel('