[FEATURE] Exclude doktypes from pagetree 20/21520/4
authorSoren Malling <soren.malling@gmail.com>
Thu, 20 Jun 2013 08:32:39 +0000 (10:32 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sun, 23 Jun 2013 12:15:09 +0000 (14:15 +0200)
Exclude specific doktypes from the pagetree by setting
a configuration in a user/group TSconfig

Example: Exclude "Folder" pages
  options.pageTree.excludeDoktypes = 254

Example: Exclude "Folder" and "Standard" pages
  options.pageTree.excludeDoktypes = 254,1

Resolves: #49279
Releases: 6.2
Change-Id: I806c9892b07382ce424f656234b6992b349885f1
Reviewed-on: https://review.typo3.org/21520
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/backend/Classes/Tree/Pagetree/DataProvider.php

index a17a877..bfe9b13 100644 (file)
@@ -411,6 +411,13 @@ class DataProvider extends \TYPO3\CMS\Backend\Tree\AbstractTreeDataProvider {
                if (is_numeric($id) && $id >= 0) {
                        $where .= ' AND pid= ' . $GLOBALS['TYPO3_DB']->fullQuoteStr(intval($id), 'pages');
                }
+
+               $excludedDoktypes = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.excludeDoktypes');
+               if (!empty($excludedDoktypes)) {
+                       $excludedDoktypes = $GLOBALS['TYPO3_DB']->fullQuoteArray(GeneralUtility::intExplode(',', $excludedDoktypes), 'pages');
+                       $where .= ' AND doktype NOT IN (' . implode(',', $excludedDoktypes) . ')';
+               }
+
                if ($searchFilter !== '') {
                        if (is_numeric($searchFilter) && $searchFilter > 0) {
                                $searchWhere .= 'uid = ' . intval($searchFilter) . ' OR ';