[!!!][TASK] Move non-namespaced classes into correct places
[Packages/TYPO3.CMS.git] / typo3 / sysext / recordlist / Classes / Tree / View / ElementBrowserPageTreeView.php
1 <?php
2 namespace TYPO3\CMS\Recordlist\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 class for the TBE record browser
19 */
20 class ElementBrowserPageTreeView extends \TYPO3\CMS\Backend\Tree\View\ElementBrowserPageTreeView {
21
22 /**
23 * Returns TRUE if a doktype can be linked (which is always the case here).
24 *
25 * @param int $doktype Doktype value to test
26 * @param int $uid uid to test.
27 * @return bool
28 */
29 public function ext_isLinkable($doktype, $uid) {
30 return TRUE;
31 }
32
33 /**
34 * Wrapping the title in a link, if applicable.
35 *
36 * @param string $title Title, ready for output.
37 * @param array $v The record
38 * @param bool $ext_pArrPages If set, pages clicked will return immediately, otherwise reload page.
39 * @return string Wrapping title string.
40 */
41 public function wrapTitle($title, $v, $ext_pArrPages) {
42 if ($ext_pArrPages) {
43 $ficon = \TYPO3\CMS\Backend\Utility\IconUtility::getIcon('pages', $v);
44 $onClick = 'return insertElement(\'pages\', \'' . $v['uid'] . '\', \'db\', ' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($v['title']) . ', \'\', \'\', \'' . $ficon . '\',\'\',1);';
45 } else {
46 $onClick = 'return jumpToUrl(' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($this->getThisScript() . 'act=' . $GLOBALS['SOBE']->browser->act . '&mode=' . $GLOBALS['SOBE']->browser->mode . '&expandPage=' . $v['uid']) . ');';
47 }
48 return '<a href="#" onclick="' . htmlspecialchars($onClick) . '">' . $title . '</a>';
49 }
50
51 }