Fixed bug #12384: Mount points are not taken into account in element-list
authortolleiv <tolleiv@743128fe-103e-dd11-99c4-001b210b3e58>
Fri, 21 Jan 2011 09:33:43 +0000 (09:33 +0000)
committertolleiv <tolleiv@743128fe-103e-dd11-99c4-001b210b3e58>
Fri, 21 Jan 2011 09:33:43 +0000 (09:33 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/CoreProjects/workspaces/workspaces/trunk@3911 743128fe-103e-dd11-99c4-001b210b3e58

typo3/sysext/workspaces/ChangeLog
typo3/sysext/workspaces/Classes/Service/Workspaces.php

index fb324ac..7ed5211 100644 (file)
@@ -1,5 +1,6 @@
 2011-01-21  Tolleiv Nietsch <typo3@tolleiv.de>
 
 2011-01-21  Tolleiv Nietsch <typo3@tolleiv.de>
 
+       * Fixed bug #12384: Mount points are not taken into account in element-list
        * Fixed bug #12325: Hide icons that don't work in the current context
        * Fixed bug #11539: Split view
 
        * Fixed bug #12325: Hide icons that don't work in the current context
        * Fixed bug #11539: Split view
 
index 92469eb..37d843b 100644 (file)
@@ -346,10 +346,22 @@ class tx_Workspaces_Service_Workspaces {
                 **/
                $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
                $searchObj = t3lib_div::makeInstance('t3lib_fullsearch');
                 **/
                $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
                $searchObj = t3lib_div::makeInstance('t3lib_fullsearch');
-               $pageList = $searchObj->getTreeList($pageId, $recursionLevel, 0, $perms_clause);
-
+               $pageList = FALSE;
+               if ($pageId > 0) {
+                       $pageList = $searchObj->getTreeList($pageId, $recursionLevel, 0, $perms_clause);
+               } else {
+                       $mountPoints = $GLOBALS['BE_USER']->uc['pageTree_temporaryMountPoint'];
+                       if (!is_array($mountPoints) || empty($mountPoints)) {
+                               $mountPoints = array_map('intval', $GLOBALS['BE_USER']->returnWebmounts());
+                               $mountPoints = array_unique($mountPoints);
+                       }
+                       $newList = array();
+                       foreach($mountPoints as $mountPoint) {
+                               $newList[] = $searchObj->getTreeList($mountPoint, $recursionLevel, 0, $perms_clause);
+                       }
+                       $pageList = implode(',', $newList);
+               }
                unset($searchObj);
                unset($searchObj);
-
                if (intval($GLOBALS['TCA']['pages']['ctrl']['versioningWS']) === 2 && $pageList) {
                        if ($pageList) {
                                        // Remove the "subbranch" if a page was moved away
                if (intval($GLOBALS['TCA']['pages']['ctrl']['versioningWS']) === 2 && $pageList) {
                        if ($pageList) {
                                        // Remove the "subbranch" if a page was moved away
@@ -377,6 +389,9 @@ class tx_Workspaces_Service_Workspaces {
 
                        $newList = array();
                        $pageIds = t3lib_div::intExplode(',', $pageList, TRUE);
 
                        $newList = array();
                        $pageIds = t3lib_div::intExplode(',', $pageList, TRUE);
+                       if (!in_array($pageId, $pageIds)) {
+                               $pageIds[] = $pageId;
+                       }
                        foreach ($pageIds as $pageId) {
                                if (intval($pages[$pageId]['t3ver_move_id']) > 0) {
                                        $newList[] = intval($pages[$pageId]['t3ver_move_id']);
                        foreach ($pageIds as $pageId) {
                                if (intval($pages[$pageId]['t3ver_move_id']) > 0) {
                                        $newList[] = intval($pages[$pageId]['t3ver_move_id']);