openrat-cms

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

commit 1fe712426180b66293bbc8853cd266b33b78ad77
parent e110b8830bbb47e224595e63c99b1abf3620413b
Author: Jan Dankert <devnull@localhost>
Date:   Fri, 22 Feb 2013 19:26:45 +0100

Fix: Verschieben von Ordnern wieder aktivieren.

Diffstat:
action/FolderAction.class.php | 4+++-
model/Folder.class.php | 10++++++----
2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/action/FolderAction.class.php b/action/FolderAction.class.php @@ -613,6 +613,8 @@ class FolderAction extends ObjectAction $f = new Folder( $id ); $allsubfolders = $f->getAllSubFolderIds(); + // Plausibilisierungsprüfung: + // // Wenn // - Das Zielverzeichnis sich nicht in einem Unterverzeichnis des zu verschiebenen Ordners liegt // und @@ -621,7 +623,7 @@ class FolderAction extends ObjectAction if ( !in_array($targetObjectId,$allsubfolders) && $id != $targetObjectId ) { $this->addNotice($o->getType(),$o->name,'MOVED','ok'); - //$o->setParentId( $targetObjectId ); + $o->setParentId( $targetObjectId ); } else { diff --git a/model/Folder.class.php b/model/Folder.class.php @@ -704,10 +704,13 @@ SQL return $db->getAssoc( $sql ); } + - // Ermitteln aller Unterordner (rekursives Absteigen) - // + /** + * Ermitteln aller Unterordner (rekursives Absteigen). + * + */ function getAllSubFolderIds() { global $SESS; @@ -716,20 +719,19 @@ SQL foreach( $this->getSubFolderIds() as $id ) { -// echo "durchlaufe $id"; $ids[] = $id; $f = new Folder( $id ); if ( !empty($this->projectid) ) $f->projectid = $this->projectid; + // Rekursiver Aufruf für alle Unterordner foreach( $f->getAllSubFolderIds() as $xid ) { $ids[] = $xid; } } -// print_r( $ids ); return $ids; }