d01bc392605f57c34552900d4bad7861b69f52f0
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Tree / View / PageTreeView.php
1 <?php
2 namespace TYPO3\CMS\Backend\Tree\View;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * Generate a page-tree, non-browsable.
19 *
20 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
21 * @coauthor René Fritz <r.fritz@colorcube.de>
22 */
23 class PageTreeView extends \TYPO3\CMS\Backend\Tree\View\AbstractTreeView {
24
25 /**
26 * @var array
27 */
28 public $fieldArray = array(
29 'uid',
30 'title',
31 'doktype',
32 'mount_pid',
33 'php_tree_stop',
34 't3ver_id',
35 't3ver_state'
36 );
37
38 /**
39 * @var string
40 */
41 public $defaultList = 'uid,pid,tstamp,sorting,deleted,perms_userid,perms_groupid,perms_user,perms_group,perms_everybody,crdate,cruser_id';
42
43 /**
44 * @var int
45 */
46 public $setRecs = 0;
47
48 /**
49 * Init function
50 * REMEMBER to feed a $clause which will filter out non-readable pages!
51 *
52 * @param string $clause Part of where query which will filter out non-readable pages.
53 * @param string $orderByFields Record ORDER BY field
54 * @return void
55 */
56 public function init($clause = '', $orderByFields = '') {
57 parent::init(' AND deleted=0 ' . $clause, 'sorting');
58 $this->fieldArray = array_merge($this->fieldArray, array(
59 'hidden',
60 'starttime',
61 'endtime',
62 'fe_group',
63 'module',
64 'extendToSubpages',
65 'nav_hide'
66 ));
67 $this->table = 'pages';
68 $this->treeName = 'pages';
69 }
70
71 /**
72 * Returns TRUE/FALSE if the next level for $id should be expanded - and all levels should, so we always return 1.
73 *
74 * @param int $id ID (uid) to test for (see extending classes where this is checked against session data)
75 * @return bool
76 */
77 public function expandNext($id) {
78 return 1;
79 }
80
81 /**
82 * Generate the plus/minus icon for the browsable tree.
83 * In this case, there is no plus-minus icon displayed.
84 *
85 * @param array $row Record for the entry
86 * @param int $a The current entry number
87 * @param int $c The total number of entries. If equal to $a, a 'bottom' element is returned.
88 * @param int $nextCount The number of sub-elements to the current element.
89 * @param bool $exp The element was expanded to render subelements if this flag is set.
90 * @return string Image tag with the plus/minus icon.
91 * @access private
92 * @see AbstarctTreeView::PMicon()
93 */
94 public function PMicon($row, $a, $c, $nextCount, $exp) {
95 $PM = 'join';
96 $BTM = $a == $c ? 'bottom' : '';
97 $icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('treeline-' . $PM . $BTM);
98 return $icon;
99 }
100
101 /**
102 * Get stored tree structure AND updating it if needed according to incoming PM GET var.
103 * - Here we just set it to nothing since we want to just render the tree, nothing more.
104 *
105 * @return void
106 * @access private
107 */
108 public function initializePositionSaving() {
109 $this->stored = array();
110 }
111
112 }