[TASK] Remove comments for revised in TYPO3 3.6
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / layout / db_layout.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2013 Kasper Skårhøj (kasperYYYY@typo3.com)
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 * A copy is found in the textfile GPL.txt and important notices to the license
17 * from the author is found in LICENSE.txt distributed with these scripts.
18 *
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27 /**
28 * Module: Web>Page
29 *
30 * This module lets you view a page in a more Content Management like style than the ordinary record-list
31 *
32 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
33 */
34 unset($MCONF);
35 require __DIR__ . '/conf.php';
36 require $BACK_PATH . 'init.php';
37 $LANG->includeLLFile('EXT:cms/layout/locallang.xlf');
38
39 $BE_USER->modAccess($MCONF, 1);
40 // Will open up records locked by current user. It's assumed that the locking should end if this script is hit.
41 \TYPO3\CMS\Backend\Utility\BackendUtility::lockRecords();
42 // Exits if 'cms' extension is not loaded:
43 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms', 1);
44 /**
45 * Local extension of position map class
46 *
47 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
48 */
49 class ext_posMap extends \TYPO3\CMS\Backend\Tree\View\PagePositionMap {
50
51 /**
52 * @todo Define visibility
53 */
54 public $dontPrintPageInsertIcons = 1;
55
56 /**
57 * @todo Define visibility
58 */
59 public $l_insertNewRecordHere = 'newContentElement';
60
61 /**
62 * Wrapping the title of the record.
63 *
64 * @param string $str The title value.
65 * @param array $row The record row.
66 * @return string Wrapped title string.
67 * @todo Define visibility
68 */
69 public function wrapRecordTitle($str, $row) {
70 $aOnClick = 'jumpToUrl(\'' . $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => ('tt_content:' . $row['uid']))) . '\');return false;';
71 return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $str . '</a>';
72 }
73
74 /**
75 * Wrapping the column header
76 *
77 * @param string $str Header value
78 * @param string $vv Column info.
79 * @return string
80 * @see printRecordMap()
81 * @todo Define visibility
82 */
83 public function wrapColumnHeader($str, $vv) {
84 $aOnClick = 'jumpToUrl(\'' . $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => ('_EDIT_COL:' . $vv))) . '\');return false;';
85 return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $str . '</a>';
86 }
87
88 /**
89 * Create on-click event value.
90 *
91 * @param array $row The record.
92 * @param string $vv Column position value.
93 * @param integer $moveUid Move uid
94 * @param integer $pid PID value.
95 * @param integer $sys_lang System language
96 * @return string
97 * @todo Define visibility
98 */
99 public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0) {
100 if (is_array($row)) {
101 $location = $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => 'tt_content:new/-' . $row['uid'] . '/' . $row['colPos']));
102 } else {
103 $location = $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => 'tt_content:new/' . $pid . '/' . $vv));
104 }
105 return 'jumpToUrl(\'' . $location . '\');return false;';
106 }
107
108 /**
109 * Wrapping the record header (from getRecordHeader())
110 *
111 * @param string $str HTML content
112 * @param array $row Record array.
113 * @return string HTML content
114 * @todo Define visibility
115 */
116 public function wrapRecordHeader($str, $row) {
117 if ($row['uid'] == $this->moveUid) {
118 return '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/content_client.gif', 'width="7" height="10"') . ' alt="" />' . $str;
119 } else {
120 return $str;
121 }
122 }
123
124 }
125
126 /*
127 * @deprecated since 6.0, the classname SC_db_layout and this file is obsolete
128 * and will be removed with 6.2. The class was renamed and is now located at:
129 * typo3/sysext/backend/Classes/Controller/PageLayoutController.php
130 */
131 require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('backend') . 'Classes/Controller/PageLayoutController.php';
132 // Make instance:
133 $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\PageLayoutController');
134 $SOBE->init();
135 // Include files?
136 foreach ($SOBE->include_once as $INC_FILE) {
137 include_once $INC_FILE;
138 }
139 $SOBE->clearCache();
140 $SOBE->main();
141 $SOBE->printContent();
142 ?>