From b667dacfec19e59968c7d89c639d209222a26684 Mon Sep 17 00:00:00 2001 From: cajus Date: Mon, 12 Nov 2007 16:11:37 +0000 Subject: [PATCH] Updated class hirachy git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-playground@7781 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/autoload-data.inc | 3 ++- include/class_GOsaGuiElement.inc | 27 +++++++++++++++++++ include/class_ObjectListViewport.inc | 26 +++++++++--------- ...> interface_GOsaGuiElementInteraction.inc} | 9 +++++-- update-gosa | 4 +++ 5 files changed, 53 insertions(+), 16 deletions(-) create mode 100644 include/class_GOsaGuiElement.inc rename include/{interface_GOsaGuiElement.inc => interface_GOsaGuiElementInteraction.inc} (78%) diff --git a/include/autoload-data.inc b/include/autoload-data.inc index e034a84da..e28b621b1 100644 --- a/include/autoload-data.inc +++ b/include/autoload-data.inc @@ -6,12 +6,13 @@ $class_mapping= array( "AutoloadException" => "include/autoload.inc", "ObjectListException" => "include/class_ObjectList.inc", "ObjectList" => "include/class_ObjectList.inc", + "GOsaGuiElement" => "include/class_GOsaGuiElement.inc", "ObjectListFilterIterator" => "include/class_ObjectListFilterIterator.inc", "ObjectListViewportException" => "include/class_ObjectListViewport.inc", "ObjectListViewport" => "include/class_ObjectListViewport.inc", "ObjectListIterator" => "include/class_ObjectListIterator.inc", - "GOsaGuiElement" => "include/interface_GOsaGuiElement.inc", "ObjectListEntryFilter" => "include/interface_ObjectListEntryFilter.inc", + "GOsaGuiElementInteraction" => "include/interface_GOsaGuiElementInteraction.inc", "ObjectListEntryFilter_uppercase" => "include/class_ObjectListEntryFilter_uppercase.inc", ); ?> \ No newline at end of file diff --git a/include/class_GOsaGuiElement.inc b/include/class_GOsaGuiElement.inc new file mode 100644 index 000000000..d8284f2c6 --- /dev/null +++ b/include/class_GOsaGuiElement.inc @@ -0,0 +1,27 @@ +errorMessage) { + return "
\n".$this->__render()."
\n"; + } else { + return $this->__render(); + } + } + + public function process() { + return $this->__process(); + } + + abstract protected function __render(); + + abstract protected function __process(); +} + +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: +?> diff --git a/include/class_ObjectListViewport.inc b/include/class_ObjectListViewport.inc index 3a7deac50..91a0d3e40 100644 --- a/include/class_ObjectListViewport.inc +++ b/include/class_ObjectListViewport.inc @@ -23,37 +23,37 @@ class ObjectListViewportException extends Exception { \sa ObjectList */ -class ObjectListViewport implements GOsaGuiElement { +class ObjectListViewport extends GOsaGuiElement { /* Internal variable for color alternation */ - protected $colorAlternator= 0; + private $colorAlternator= 0; - private $headline; - private $footer; - private $entryFormat; + protected $headline; + protected $footer; + protected $entryFormat; /* Dummy here ----> */ private $attributes= array('cn', '_icon', '_actions', 'dn'); /* <---- Dummy here */ - private $displayHeaderFlag= TRUE; - private $displayFooterFlag= TRUE; - private $numberOfCols= 0; + protected $displayHeaderFlag= TRUE; + protected $displayFooterFlag= TRUE; + protected $numberOfCols= 0; /*! \brief Container for objects This variable stores the ObjectList object to be displayed. */ - private $objects; + protected $objects; /*! \brief Switch to handle multiselect or not */ - private $multiselect; + protected $multiselect; /*! \brief ID used to identify objects of same list */ - private $id = ""; + protected $id = ""; /*! \brief ObjectListViewport constructor @@ -101,7 +101,7 @@ class ObjectListViewport implements GOsaGuiElement { \return bool for if changes are present or not */ - public function process(){ + protected function __process(){ /* TODO: process input */ return FALSE; @@ -245,7 +245,7 @@ class ObjectListViewport implements GOsaGuiElement { \return HTML rendered list */ - public function render() { + protected function __render() { /* Apply current filter */ $entries = ""; diff --git a/include/interface_GOsaGuiElement.inc b/include/interface_GOsaGuiElementInteraction.inc similarity index 78% rename from include/interface_GOsaGuiElement.inc rename to include/interface_GOsaGuiElementInteraction.inc index 3859ca6ce..70f496ba4 100644 --- a/include/interface_GOsaGuiElement.inc +++ b/include/interface_GOsaGuiElementInteraction.inc @@ -13,11 +13,16 @@ interface GOsaGuiElementInteraction { /** * Allows the GOsaGuiElement to process all _POST events that are * related to itself. - * @param string $class - * @return obj $$class + * + * @return TRUE if something has changed */ public function process(); + + /** + * Allows the GOsaGuiElement to render themselves depending on several + * parameters. + */ public function render(); } diff --git a/update-gosa b/update-gosa index 5d631efb7..083fffa79 100755 --- a/update-gosa +++ b/update-gosa @@ -45,6 +45,10 @@ function get_classes($folder= ".") $class= preg_replace('/^\s*class\s*(\w+).*$/', '\1', $line); $result[$class]= preg_replace("%$base_dir/%", "", "$currdir/$folder/$file"); } + if (preg_match('/^\s*abstract\s*class\s*\w.*$/', $line)){ + $class= preg_replace('/^\s*abstract\s*class\s*(\w+).*$/', '\1', $line); + $result[$class]= preg_replace("%$base_dir/%", "", "$currdir/$folder/$file"); + } if (preg_match('/^\s*interface\s*\w.*$/', $line)){ $class= preg_replace('/^\s*interface\s*(\w+).*$/', '\1', $line); $result[$class]= preg_replace("%$base_dir/%", "", "$currdir/$folder/$file"); -- 2.30.2