[TASK] "t3-table" (Web>List) & tree sprites (AbstractTreeView)
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Tree / View / PageTreeView.php
1 <?php
2 namespace TYPO3\CMS\Backend\Tree\View;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 1999-2013 Kasper Skårhøj (kasperYYYY@typo3.com)
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 * A copy is found in the text file GPL.txt and important notices to the license
19 * from the author is found in LICENSE.txt distributed with these scripts.
20 *
21 *
22 * This script is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * This copyright notice MUST APPEAR in all copies of the script!
28 ***************************************************************/
29 /**
30 * Generate a page-tree, non-browsable.
31 *
32 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
33 * @coauthor René Fritz <r.fritz@colorcube.de>
34 */
35 class PageTreeView extends \TYPO3\CMS\Backend\Tree\View\AbstractTreeView {
36
37 /**
38 * @todo Define visibility
39 */
40 public $fieldArray = array(
41 'uid',
42 'title',
43 'doktype',
44 'php_tree_stop',
45 't3ver_id',
46 't3ver_state'
47 );
48
49 /**
50 * @todo Define visibility
51 */
52 public $defaultList = 'uid,pid,tstamp,sorting,deleted,perms_userid,perms_groupid,perms_user,perms_group,perms_everybody,crdate,cruser_id';
53
54 /**
55 * @todo Define visibility
56 */
57 public $setRecs = 0;
58
59 /**
60 * Init function
61 * REMEMBER to feed a $clause which will filter out non-readable pages!
62 *
63 * @param string $clause Part of where query which will filter out non-readable pages.
64 * @param string $orderByFields Record ORDER BY field
65 * @return void
66 * @todo Define visibility
67 */
68 public function init($clause = '', $orderByFields = '') {
69 parent::init(' AND deleted=0 ' . $clause, 'sorting');
70 if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms')) {
71 $this->fieldArray = array_merge($this->fieldArray, array(
72 'hidden',
73 'starttime',
74 'endtime',
75 'fe_group',
76 'module',
77 'extendToSubpages',
78 'nav_hide'
79 ));
80 }
81 $this->table = 'pages';
82 $this->treeName = 'pages';
83 }
84
85 /**
86 * Returns TRUE/FALSE if the next level for $id should be expanded - and all levels should, so we always return 1.
87 *
88 * @param integer $id ID (uid) to test for (see extending classes where this is checked againts session data)
89 * @return boolean
90 * @todo Define visibility
91 */
92 public function expandNext($id) {
93 return 1;
94 }
95
96 /**
97 * Generate the plus/minus icon for the browsable tree.
98 * In this case, there is no plus-minus icon displayed.
99 *
100 * @param array $row Record for the entry
101 * @param integer $a The current entry number
102 * @param integer $c The total number of entries. If equal to $a, a 'bottom' element is returned.
103 * @param integer $nextCount The number of sub-elements to the current element.
104 * @param boolean $exp The element was expanded to render subelements if this flag is set.
105 * @return string Image tag with the plus/minus icon.
106 * @access private
107 * @see AbstarctTreeView::PMicon()
108 * @todo Define visibility
109 */
110 public function PMicon($row, $a, $c, $nextCount, $exp) {
111 $PM = 'join';
112 $BTM = $a == $c ? 'bottom' : '';
113 $icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('treeline-' . $PM . $BTM);
114 return $icon;
115 }
116
117 /**
118 * Get stored tree structure AND updating it if needed according to incoming PM GET var.
119 * - Here we just set it to nothing since we want to just render the tree, nothing more.
120 *
121 * @return void
122 * @access private
123 * @todo Define visibility
124 */
125 public function initializePositionSaving() {
126 $this->stored = array();
127 }
128
129 }