[TASK] Comment legacy files to be removed with 6.2
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / layout / db_layout.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2011 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 * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
33 * XHTML compliant
34 *
35 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
36 */
37 unset($MCONF);
38 require 'conf.php';
39 require $BACK_PATH . 'init.php';
40 $LANG->includeLLFile('EXT:cms/layout/locallang.xml');
41 require_once 'class.tx_cms_layout.php';
42 $BE_USER->modAccess($MCONF, 1);
43 // Will open up records locked by current user. It's assumed that the locking should end if this script is hit.
44 \TYPO3\CMS\Backend\Utility\BackendUtility::lockRecords();
45 // Exits if 'cms' extension is not loaded:
46 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms', 1);
47 /**
48 * Local extension of position map class
49 *
50 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
51 */
52 class ext_posMap extends \TYPO3\CMS\Backend\Tree\View\PagePositionMap {
53
54 /**
55 * @todo Define visibility
56 */
57 public $dontPrintPageInsertIcons = 1;
58
59 /**
60 * @todo Define visibility
61 */
62 public $l_insertNewRecordHere = 'newContentElement';
63
64 /**
65 * Wrapping the title of the record.
66 *
67 * @param string $str The title value.
68 * @param array $row The record row.
69 * @return string Wrapped title string.
70 * @todo Define visibility
71 */
72 public function wrapRecordTitle($str, $row) {
73 $aOnClick = 'jumpToUrl(\'' . $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => ('tt_content:' . $row['uid']))) . '\');return false;';
74 return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $str . '</a>';
75 }
76
77 /**
78 * Wrapping the column header
79 *
80 * @param string $str Header value
81 * @param string $vv Column info.
82 * @return string
83 * @see printRecordMap()
84 * @todo Define visibility
85 */
86 public function wrapColumnHeader($str, $vv) {
87 $aOnClick = 'jumpToUrl(\'' . $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => ('_EDIT_COL:' . $vv))) . '\');return false;';
88 return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $str . '</a>';
89 }
90
91 /**
92 * Create on-click event value.
93 *
94 * @param array $row The record.
95 * @param string $vv Column position value.
96 * @param integer $moveUid Move uid
97 * @param integer $pid PID value.
98 * @param integer $sys_lang System language
99 * @return string
100 * @todo Define visibility
101 */
102 public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0) {
103 if (is_array($row)) {
104 $location = $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => 'tt_content:new/-' . $row['uid'] . '/' . $row['colPos']));
105 } else {
106 $location = $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => 'tt_content:new/' . $pid . '/' . $vv));
107 }
108 return 'jumpToUrl(\'' . $location . '\');return false;';
109 }
110
111 /**
112 * Wrapping the record header (from getRecordHeader())
113 *
114 * @param string $str HTML content
115 * @param array $row Record array.
116 * @return string HTML content
117 * @todo Define visibility
118 */
119 public function wrapRecordHeader($str, $row) {
120 if ($row['uid'] == $this->moveUid) {
121 return '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/content_client.gif', 'width="7" height="10"') . ' alt="" />' . $str;
122 } else {
123 return $str;
124 }
125 }
126
127 }
128
129 /*
130 * @deprecated since 6.0, the classname SC_db_layout and this file is obsolete
131 * and will be removed with 6.2. The class was renamed and is now located at:
132 * typo3/sysext/backend/Classes/Controller/PageLayoutController.php
133 */
134 require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('backend') . 'Classes/Controller/PageLayoutController.php';
135 // Make instance:
136 $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\PageLayoutController');
137 $SOBE->init();
138 // Include files?
139 foreach ($SOBE->include_once as $INC_FILE) {
140 include_once $INC_FILE;
141 }
142 $SOBE->clearCache();
143 $SOBE->main();
144 $SOBE->printContent();
145 ?>