From: cajus Date: Mon, 12 Nov 2007 16:11:37 +0000 (+0000) Subject: Updated class hirachy X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b667dacfec19e59968c7d89c639d209222a26684;p=gosa.git Updated class hirachy git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-playground@7781 594d385d-05f5-0310-b6e9-bd551577e9d8 --- 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_GOsaGuiElement.inc deleted file mode 100644 index 3859ca6ce..000000000 --- a/include/interface_GOsaGuiElement.inc +++ /dev/null @@ -1,26 +0,0 @@ - - \version 1.00 - \date 2007/11/02 - - This interface describes what we need to display an element in the GUI - for use with list objects. - */ -interface GOsaGuiElementInteraction { - - /** - * Allows the GOsaGuiElement to process all _POST events that are - * related to itself. - * @param string $class - * @return obj $$class - */ - public function process(); - - public function render(); - -} - -// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: -?> diff --git a/include/interface_GOsaGuiElementInteraction.inc b/include/interface_GOsaGuiElementInteraction.inc new file mode 100644 index 000000000..70f496ba4 --- /dev/null +++ b/include/interface_GOsaGuiElementInteraction.inc @@ -0,0 +1,31 @@ + + \version 1.00 + \date 2007/11/02 + + This interface describes what we need to display an element in the GUI + for use with list objects. + */ +interface GOsaGuiElementInteraction { + + /** + * Allows the GOsaGuiElement to process all _POST events that are + * related to itself. + * + * @return TRUE if something has changed + */ + public function process(); + + + /** + * Allows the GOsaGuiElement to render themselves depending on several + * parameters. + */ + public function render(); + +} + +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: +?> 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");