[TASK] Use fully qualified name resolution in PHP 5.5
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / layout / db_layout.php
1 <?php
2 /**
3 * This file is part of the TYPO3 CMS project.
4 *
5 * It is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License, either version 2
7 * of the License, or any later version.
8 *
9 * For the full copyright and license information, please read the
10 * LICENSE.txt file that was distributed with this source code.
11 *
12 * The TYPO3 project - inspiring people to share!
13 */
14
15 /**
16 * Module: Web>Page
17 *
18 * This module lets you view a page in a more Content Management like style than the ordinary record-list
19 *
20 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
21 */
22 unset($MCONF);
23 require __DIR__ . '/conf.php';
24 require $BACK_PATH . 'init.php';
25 $LANG->includeLLFile('EXT:cms/layout/locallang.xlf');
26
27 $BE_USER->modAccess($MCONF, 1);
28 // Will open up records locked by current user. It's assumed that the locking should end if this script is hit.
29 \TYPO3\CMS\Backend\Utility\BackendUtility::lockRecords();
30 /**
31 * Local extension of position map class
32 *
33 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
34 */
35 class ext_posMap extends \TYPO3\CMS\Backend\Tree\View\PagePositionMap {
36
37 /**
38 * @var bool
39 */
40 public $dontPrintPageInsertIcons = 1;
41
42 /**
43 * @var string
44 */
45 public $l_insertNewRecordHere = 'newContentElement';
46
47 /**
48 * Wrapping the title of the record.
49 *
50 * @param string $str The title value.
51 * @param array $row The record row.
52 * @return string Wrapped title string.
53 */
54 public function wrapRecordTitle($str, $row) {
55 $aOnClick = 'jumpToUrl(' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => ('tt_content:' . $row['uid'])))) . ');return false;';
56 return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $str . '</a>';
57 }
58
59 /**
60 * Wrapping the column header
61 *
62 * @param string $str Header value
63 * @param string $vv Column info.
64 * @return string
65 * @see printRecordMap()
66 */
67 public function wrapColumnHeader($str, $vv) {
68 $aOnClick = 'jumpToUrl(' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => ('_EDIT_COL:' . $vv)))) . ');return false;';
69 return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $str . '</a>';
70 }
71
72 /**
73 * Create on-click event value.
74 *
75 * @param array $row The record.
76 * @param string $vv Column position value.
77 * @param int $moveUid Move uid
78 * @param int $pid PID value.
79 * @param int $sys_lang System language
80 * @return string
81 */
82 public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0) {
83 if (is_array($row)) {
84 $location = $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => 'tt_content:new/-' . $row['uid'] . '/' . $row['colPos']));
85 } else {
86 $location = $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => 'tt_content:new/' . $pid . '/' . $vv));
87 }
88 return 'jumpToUrl(' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($location) . ');return false;';
89 }
90
91 /**
92 * Wrapping the record header (from getRecordHeader())
93 *
94 * @param string $str HTML content
95 * @param array $row Record array.
96 * @return string HTML content
97 */
98 public function wrapRecordHeader($str, $row) {
99 if ($row['uid'] == $this->moveUid) {
100 return '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/content_client.gif', 'width="7" height="10"') . ' alt="" />' . $str;
101 } else {
102 return $str;
103 }
104 }
105
106 }
107
108 require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('backend') . 'Classes/Controller/PageLayoutController.php';
109 // Make instance:
110 $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Controller\PageLayoutController::class);
111 $SOBE->init();
112 // Include files?
113 foreach ($SOBE->include_once as $INC_FILE) {
114 include_once $INC_FILE;
115 }
116 $SOBE->clearCache();
117 $SOBE->main();
118 $SOBE->printContent();