[TASK] Streamline page tree in Export module 34/41234/2
authorBenjamin Mack <benni@typo3.org>
Tue, 14 Jul 2015 18:47:27 +0000 (20:47 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 14 Jul 2015 18:59:36 +0000 (20:59 +0200)
Resolves: #68137
Releases: master
Change-Id: Id254bfc0ab5608212af7e92863edefa2b09e270a
Reviewed-on: http://review.typo3.org/41234
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Build/Resources/Public/Less/TYPO3/_element_tree.less
typo3/sysext/backend/Classes/Tree/View/PageTreeView.php
typo3/sysext/compatibility6/Migrations/Code/ClassAliasMap.php
typo3/sysext/compatibility6/Migrations/Code/LegacyClassesForIde.php
typo3/sysext/impexp/Classes/Controller/ImportExportController.php
typo3/sysext/impexp/Classes/LocalPageTree.php [deleted file]
typo3/sysext/impexp/Classes/View/ExportPageTreeView.php [new file with mode: 0644]
typo3/sysext/t3skin/Resources/Public/Css/visual/t3skin.css

index 60a9189..2bcc082 100644 (file)
@@ -155,6 +155,16 @@ ul#treeRoot {
 body#ext-backend-Modules-FileSystemNavigationFrame-index-php ul#treeRoot li:last-child:before {
        background-color: #f5f5f5;
 }
+
+body#imp-exp-mod ul#treeRoot {
+       > li:first-child {
+               padding-left: 0;
+       }
+       ul li:last-child:before {
+               background-color: #f1f1f1;
+       }
+}
+
 //
 // Configuration trees, used in Admin Tools => Configuration
 //
index 21de639..6356bcd 100644 (file)
@@ -86,13 +86,13 @@ class PageTreeView extends AbstractTreeView {
         * @param int $a The current entry number
         * @param int $c The total number of entries. If equal to $a, a 'bottom' element is returned.
         * @param int $nextCount The number of sub-elements to the current element.
-        * @param bool $exp The element was expanded to render subelements if this flag is set.
+        * @param bool $isExpand The element was expanded to render subelements if this flag is set.
         * @return string Image tag with the plus/minus icon.
         * @access private
-        * @see AbstarctTreeView::PMicon()
+        * @see AbstractTreeView::PMicon()
         */
-       public function PMicon($row, $a, $c, $nextCount, $exp) {
-               return \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('treeline-join' . ($a == $c ? 'bottom' : ''));
+       public function PMicon($row, $a, $c, $nextCount, $isExpand) {
+               return '<i class="fa"></i>';
        }
 
        /**
index 585ae96..592d995 100644 (file)
@@ -1019,7 +1019,7 @@ return array(
        'tx_impexp_clickmenu' => \TYPO3\CMS\Impexp\Clickmenu::class,
        'SC_mod_tools_log_index' => \TYPO3\CMS\Impexp\Controller\ImportExportController::class,
        'tx_impexp' => \TYPO3\CMS\Impexp\ImportExport::class,
-       'tx_impexp_localPageTree' => \TYPO3\CMS\Impexp\LocalPageTree::class,
+       'tx_impexp_localPageTree' => \TYPO3\CMS\Impexp\View\ExportPageTreeView::class,
        'tx_impexp_task' => \TYPO3\CMS\Impexp\Task\ImportExportTask::class,
        'Tx_IndexedSearch_Domain_Repository_IndexSearchRepository' => \TYPO3\CMS\IndexedSearch\Domain\Repository\IndexSearchRepository::class,
        'tx_indexedsearch_files' => \TYPO3\CMS\IndexedSearch\Hook\CrawlerFilesHook::class,
index a0d96ab..a6c5e45 100644 (file)
@@ -5079,7 +5079,7 @@ class tx_impexp extends \TYPO3\CMS\Impexp\ImportExport {}
 /**
  * @deprecated since 6.0, removed since 7.0
  */
-class tx_impexp_localPageTree extends \TYPO3\CMS\Impexp\LocalPageTree {}
+class tx_impexp_localPageTree extends \TYPO3\CMS\Impexp\View\ExportPageTreeView {}
 
 /**
  * @deprecated since 6.0, removed since 7.0
index ed902d9..09c3a51 100644 (file)
@@ -276,7 +276,7 @@ class ImportExportController extends \TYPO3\CMS\Backend\Module\BaseScriptClass {
                        // Based on click-expandable tree
                        $idH = NULL;
                        if ($inData['pagetree']['levels'] == -1) {
-                               $pagetree = GeneralUtility::makeInstance(\TYPO3\CMS\Impexp\LocalPageTree::class);
+                               $pagetree = GeneralUtility::makeInstance(\TYPO3\CMS\Impexp\View\ExportPageTreeView::class);
                                $tree = $pagetree->ext_tree($inData['pagetree']['id'], $this->filterPageIds($this->export->excludeMap));
                                $this->treeHTML = $pagetree->printTree($tree);
                                $idH = $pagetree->buffer_idH;
@@ -309,7 +309,7 @@ class ImportExportController extends \TYPO3\CMS\Backend\Module\BaseScriptClass {
                                        if (!empty($tree->buffer_idH)) {
                                                $idH[$pid]['subrow'] = $tree->buffer_idH;
                                        }
-                                       $pagetree = GeneralUtility::makeInstance(\TYPO3\CMS\Impexp\LocalPageTree::class);
+                                       $pagetree = GeneralUtility::makeInstance(\TYPO3\CMS\Impexp\View\ExportPageTreeView::class);
                                        $this->treeHTML = $pagetree->printTree($tree->tree);
                                }
                        }
diff --git a/typo3/sysext/impexp/Classes/LocalPageTree.php b/typo3/sysext/impexp/Classes/LocalPageTree.php
deleted file mode 100644 (file)
index 0ad7080..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-<?php
-namespace TYPO3\CMS\Impexp;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-use TYPO3\CMS\Backend\Utility\IconUtility;
-
-/**
- * Extension of the page tree class. Used to get the tree of pages to export.
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- */
-class LocalPageTree extends \TYPO3\CMS\Backend\Tree\View\BrowseTreeView {
-
-       /**
-        * Initialization
-        */
-       public function __construct() {
-               $this->init();
-       }
-
-       /**
-        * Wrapping title from page tree.
-        *
-        * @param string $title Title to wrap
-        * @param mixed $v (See parent class)
-        * @return string Wrapped title
-        */
-       public function wrapTitle($title, $v) {
-               return trim($title) === '' ? '<em>[' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title', TRUE) . ']</em>' : htmlspecialchars($title);
-       }
-
-       /**
-        * Wrapping Plus/Minus icon
-        *
-        * @param string $icon Icon HTML
-        * @param mixed $cmd (See parent class)
-        * @param mixed $bMark (See parent class)
-        * @param bool $isOpen
-        * @return string Icon HTML
-        */
-       public function PM_ATagWrap($icon, $cmd, $bMark = '', $isOpen = '') {
-               return $icon;
-       }
-
-       /**
-        * Wrapping Icon
-        *
-        * @param string $icon Icon HTML
-        * @param array $row Record row (page)
-        * @return string Icon HTML
-        */
-       public function wrapIcon($icon, $row) {
-               return $icon;
-       }
-
-       /**
-        * Tree rendering
-        *
-        * @param int $pid PID value
-        * @param string $clause Additional where clause
-        * @return array Array of tree elements
-        */
-       public function ext_tree($pid, $clause = '') {
-               // Initialize:
-               $this->init(' AND ' . $this->BE_USER->getPagePermsClause(1) . $clause);
-               // Get stored tree structure:
-               $this->stored = unserialize($this->BE_USER->uc['browseTrees']['browsePages']);
-               $treeArr = array();
-               $idx = 0;
-               // Set first:
-               $this->bank = $idx;
-               $isOpen = $this->stored[$idx][$pid] || $this->expandFirst;
-               // save ids
-               $curIds = $this->ids;
-               $this->reset();
-               $this->ids = $curIds;
-               $firstHtml = '<img' . IconUtility::skinImg($this->backPath, ('gfx/ol/' . ($isOpen ? 'minus' : 'plus') . 'only.gif'), 'width="18" height="16"') . ' align="top" alt="" />';
-               if ($pid > 0) {
-                       $rootRec = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordWSOL('pages', $pid);
-                       $firstHtml .= IconUtility::getSpriteIconForRecord('pages', $rootRec);
-               } else {
-                       $rootRec = array(
-                               'title' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'],
-                               'uid' => 0
-                       );
-                       $firstHtml .= $this->getRootIcon($rootRec);
-               }
-               $this->tree[] = array('HTML' => $firstHtml, 'row' => $rootRec);
-               if ($isOpen) {
-                       // Set depth:
-                       $depthD = '<img' . IconUtility::skinImg($this->backPath, 'gfx/ol/blank.gif', 'width="18" height="16"') . ' align="top" alt="" />';
-                       if ($this->addSelfId) {
-                               $this->ids[] = $pid;
-                       }
-                       $this->getTree($pid, 999, $depthD);
-                       $idH = array();
-                       $idH[$pid]['uid'] = $pid;
-                       if (!empty($this->buffer_idH)) {
-                               $idH[$pid]['subrow'] = $this->buffer_idH;
-                       }
-                       $this->buffer_idH = $idH;
-               }
-               // Add tree:
-               $treeArr = array_merge($treeArr, $this->tree);
-               return $treeArr;
-       }
-
-}
diff --git a/typo3/sysext/impexp/Classes/View/ExportPageTreeView.php b/typo3/sysext/impexp/Classes/View/ExportPageTreeView.php
new file mode 100644 (file)
index 0000000..a7f22d3
--- /dev/null
@@ -0,0 +1,116 @@
+<?php
+namespace TYPO3\CMS\Impexp\View;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+use TYPO3\CMS\Backend\Utility\IconUtility;
+
+/**
+ * Extension of the page tree class. Used to get the tree of pages to export.
+ *
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
+ */
+class ExportPageTreeView extends \TYPO3\CMS\Backend\Tree\View\BrowseTreeView {
+
+       /**
+        * Initialization
+        */
+       public function __construct() {
+               $this->init();
+       }
+
+       /**
+        * Wrapping title from page tree.
+        *
+        * @param string $title Title to wrap
+        * @param mixed $v (See parent class)
+        * @return string Wrapped title
+        */
+       public function wrapTitle($title, $v) {
+               return trim($title) === '' ? '<em>[' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title', TRUE) . ']</em>' : htmlspecialchars($title);
+       }
+
+       /**
+        * Wrapping Plus/Minus icon
+        *
+        * @param string $icon Icon HTML
+        * @param mixed $cmd (See parent class)
+        * @param mixed $bMark (See parent class)
+        * @param bool $isOpen
+        * @return string Icon HTML
+        */
+       public function PM_ATagWrap($icon, $cmd, $bMark = '', $isOpen = '') {
+               return $icon;
+       }
+
+       /**
+        * Wrapping Icon
+        *
+        * @param string $icon Icon HTML
+        * @param array $row Record row (page)
+        * @return string Icon HTML
+        */
+       public function wrapIcon($icon, $row) {
+               return $icon;
+       }
+
+       /**
+        * Tree rendering
+        *
+        * @param int $pid PID value
+        * @param string $clause Additional where clause
+        * @return array Array of tree elements
+        */
+       public function ext_tree($pid, $clause = '') {
+               // Initialize:
+               $this->init(' AND ' . $this->BE_USER->getPagePermsClause(1) . $clause);
+               // Get stored tree structure:
+               $this->stored = unserialize($this->BE_USER->uc['browseTrees']['browsePages']);
+               $treeArr = array();
+               $idx = 0;
+               // Set first:
+               $this->bank = $idx;
+               $isOpen = $this->stored[$idx][$pid] || $this->expandFirst;
+               // save ids
+               $curIds = $this->ids;
+               $this->reset();
+               $this->ids = $curIds;
+               if ($pid > 0) {
+                       $rootRec = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordWSOL('pages', $pid);
+                       $firstHtml = IconUtility::getSpriteIconForRecord('pages', $rootRec);
+               } else {
+                       $rootRec = array(
+                               'title' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'],
+                               'uid' => 0
+                       );
+                       $firstHtml = $this->getRootIcon($rootRec);
+               }
+               $this->tree[] = array('HTML' => $firstHtml, 'row' => $rootRec, 'hasSub' => $isOpen);
+               if ($isOpen) {
+                       // Set depth:
+                       if ($this->addSelfId) {
+                               $this->ids[] = $pid;
+                       }
+                       $this->getTree($pid, 999, '');
+                       $idH = array();
+                       $idH[$pid]['uid'] = $pid;
+                       if (!empty($this->buffer_idH)) {
+                               $idH[$pid]['subrow'] = $this->buffer_idH;
+                       }
+                       $this->buffer_idH = $idH;
+               }
+               // Add tree:
+               return array_merge($treeArr, $this->tree);
+       }
+
+}
index b2cb95b..abe7f02 100644 (file)
@@ -10844,6 +10844,12 @@ ul#treeRoot > li {
 body#ext-backend-Modules-FileSystemNavigationFrame-index-php ul#treeRoot li:last-child:before {
   background-color: #f5f5f5;
 }
+body#imp-exp-mod ul#treeRoot > li:first-child {
+  padding-left: 0;
+}
+body#imp-exp-mod ul#treeRoot ul li:last-child:before {
+  background-color: #f1f1f1;
+}
 table.t3-tree-config {
   background: #ececec;
   background-image: linear-gradient(center top, #ffffff 0px, #ececec 100px);