[TASK] Use "int" in @param notation
[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 // Exits if 'cms' extension is not loaded:
31 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms', 1);
32 /**
33 * Local extension of position map class
34 *
35 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
36 */
37 class ext_posMap extends \TYPO3\CMS\Backend\Tree\View\PagePositionMap {
38
39 /**
40 * @var bool
41 */
42 public $dontPrintPageInsertIcons = 1;
43
44 /**
45 * @var string
46 */
47 public $l_insertNewRecordHere = 'newContentElement';
48
49 /**
50 * Wrapping the title of the record.
51 *
52 * @param string $str The title value.
53 * @param array $row The record row.
54 * @return string Wrapped title string.
55 */
56 public function wrapRecordTitle($str, $row) {
57 $aOnClick = 'jumpToUrl(' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => ('tt_content:' . $row['uid'])))) . ');return false;';
58 return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $str . '</a>';
59 }
60
61 /**
62 * Wrapping the column header
63 *
64 * @param string $str Header value
65 * @param string $vv Column info.
66 * @return string
67 * @see printRecordMap()
68 */
69 public function wrapColumnHeader($str, $vv) {
70 $aOnClick = 'jumpToUrl(' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => ('_EDIT_COL:' . $vv)))) . ');return false;';
71 return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $str . '</a>';
72 }
73
74 /**
75 * Create on-click event value.
76 *
77 * @param array $row The record.
78 * @param string $vv Column position value.
79 * @param int $moveUid Move uid
80 * @param int $pid PID value.
81 * @param int $sys_lang System language
82 * @return string
83 */
84 public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0) {
85 if (is_array($row)) {
86 $location = $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => 'tt_content:new/-' . $row['uid'] . '/' . $row['colPos']));
87 } else {
88 $location = $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => 'tt_content:new/' . $pid . '/' . $vv));
89 }
90 return 'jumpToUrl(' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($location) . ');return false;';
91 }
92
93 /**
94 * Wrapping the record header (from getRecordHeader())
95 *
96 * @param string $str HTML content
97 * @param array $row Record array.
98 * @return string HTML content
99 */
100 public function wrapRecordHeader($str, $row) {
101 if ($row['uid'] == $this->moveUid) {
102 return '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/content_client.gif', 'width="7" height="10"') . ' alt="" />' . $str;
103 } else {
104 return $str;
105 }
106 }
107
108 }
109
110 /*
111 * @deprecated since 6.0, the classname SC_db_layout and this file is obsolete
112 * and will be removed with 6.2. The class was renamed and is now located at:
113 * typo3/sysext/backend/Classes/Controller/PageLayoutController.php
114 */
115 require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('backend') . 'Classes/Controller/PageLayoutController.php';
116 // Make instance:
117 $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\PageLayoutController');
118 $SOBE->init();
119 // Include files?
120 foreach ($SOBE->include_once as $INC_FILE) {
121 include_once $INC_FILE;
122 }
123 $SOBE->clearCache();
124 $SOBE->main();
125 $SOBE->printContent();