[!!!][TASK] Move non-namespaced classes into correct places
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Tree / View / NewRecordPageTreeView.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 * Extension for the tree class that generates the tree of pages in the page-wizard mode
19 * see typo3/db_new.php
20 */
21 class NewRecordPageTreeView extends PageTreeView {
22
23 /**
24 * Inserting uid-information in title-text for an icon
25 *
26 * @param string $icon Icon image
27 * @param array $row Item row
28 * @return string Wrapping icon image.
29 */
30 public function wrapIcon($icon, $row) {
31 return $this->addTagAttributes($icon, ' title="id=' . htmlspecialchars($row['uid']) . '"');
32 }
33
34 /**
35 * Determines whether to expand a branch or not.
36 * Here the branch is expanded if the current id matches the global id for the listing/new
37 *
38 * @param int $id The ID (page id) of the element
39 * @return bool Returns TRUE if the IDs matches
40 */
41 public function expandNext($id) {
42 return $id == $GLOBALS['SOBE']->id ? 1 : 0;
43 }
44 }