openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit a31ea59cdb549d26f309fa8a8b96db4155130e59
parent fe5e05ffbf61ef996cd2301f86b076369a628553
Author: dankert <devnull@localhost>
Date:   Wed, 31 Oct 2007 22:18:52 +0100

Pfade mit nur 1 Element sofort weiter ?ffnen.

Diffstat:
serviceClasses/AbstractTree.class.php | 16+++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/serviceClasses/AbstractTree.class.php b/serviceClasses/AbstractTree.class.php @@ -64,8 +64,11 @@ class AbstractTree * @param elementName der Name des Elementes, welches zu oeffnen ist */ function open( $elementId ) - { - $funcName = $this->elements[$elementId]->type; + { + $funcName = $this->elements[$elementId]->type; + if ( empty($funcName) ) + return; + $this->$funcName( $this->elements[$elementId]->internalId ); // Wenn keine Unterelemente gefunden, dann die ?ffnen-Funktion deaktivieren @@ -77,8 +80,15 @@ class AbstractTree $this->maxId++; $this->elements[$elementId]->subElementIds[] = $this->maxId; $this->elements[$this->maxId] = $treeElement; - $this->tempElements = array(); } + + if ( count($this->tempElements)==1 ) + { + $this->tempElements = array(); + $this->open($this->maxId); + } + + $this->tempElements = array(); }