From 3d3b42c53f42edf020b87f73d6443918056298d3 Mon Sep 17 00:00:00 2001 From: cajus Date: Mon, 12 Nov 2007 10:13:13 +0000 Subject: [PATCH] Used uniqid instead of microtime. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-playground@7770 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_ObjectListViewport.inc | 59 +++++++++++++++++----------- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/include/class_ObjectListViewport.inc b/include/class_ObjectListViewport.inc index 3ec96e995..f46744c73 100644 --- a/include/class_ObjectListViewport.inc +++ b/include/class_ObjectListViewport.inc @@ -28,13 +28,14 @@ class ObjectListViewport { /* Internal variable for color alternation */ protected $colorAlternator= 0; - /* Dummy here ----> */ private $headline; private $footer; private $entryFormat; + + /* Dummy here ----> */ private $attributes= array('cn', '_icon', '_actions', 'dn'); - /* <---- Dummy here */ + private $displayHeaderFlag= TRUE; private $displayFooterFlag= TRUE; private $numberOfCols= 0; @@ -53,6 +54,7 @@ class ObjectListViewport { /*! \brief ID used to identify objects of same list */ private $id = ""; + /*! \brief ObjectListViewport constructor @@ -60,10 +62,14 @@ class ObjectListViewport { \param config Config section that is used to configure this ObjectListViewport */ - public function __construct($config, $multiselect= TRUE){ + public function __construct($config, $multiselect= TRUE, $displayHeader= TRUE, $displayFooter= FALSE){ - $this->multiselect= $multiselect; - /* Dummy here */ + /* Transfer initialization values */ + $this->displayFooterFlag= $displayFooter; + $this->displayHeaderFlag= $displayHeader; + $this->multiselect= $multiselect; + + /* Load list configuration from ConfigManager */ $cr= Registry::getInstance("ConfigManager"); $cr->setSection($config); $this->parseHeadline($cr->getValue("headline")); @@ -74,9 +80,10 @@ class ObjectListViewport { $this->objects= new ObjectList($config); /* generate an unique id */ - $this->id = preg_replace("/[^0-9]/","",microtime()); + $this->id= uniqid(); } + /*! \brief Handles _POST / _GET events Processes the list of registered plugins to do their eventHandler and adapt @@ -88,6 +95,19 @@ class ObjectListViewport { } + /*! \brief Processes post events + + Processes all post events and acts as needed. + + \return bool for if changes are present or not + */ + private function process(){ + + /* TODO: process input */ + return FALSE; + } + + /*! \brief Renders headline into a string Gets the headline description from the ObjectList object and renders it. @@ -96,8 +116,8 @@ class ObjectListViewport { */ private function renderHeadline(){ $tpl =" - - +
+ {content} @@ -120,7 +140,7 @@ class ObjectListViewport { */ private function renderFooter(){ $buffer =" -