[TASK] Remove superfluous parenthesis in sysexts.
[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\Extension\ExtensionManager::isLoaded('cms', 1);
47 /**
48 * Local extension of position map class
49 *
50 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
51 * @package TYPO3
52 * @subpackage core
53 */
54 class ext_posMap extends \TYPO3\CMS\Backend\Tree\View\PagePositionMap {
55
56 /**
57 * @todo Define visibility
58 */
59 public $dontPrintPageInsertIcons = 1;
60
61 /**
62 * @todo Define visibility
63 */
64 public $l_insertNewRecordHere = 'newContentElement';
65
66 /**
67 * Wrapping the title of the record.
68 *
69 * @param string $str The title value.
70 * @param array $row The record row.
71 * @return string Wrapped title string.
72 * @todo Define visibility
73 */
74 public function wrapRecordTitle($str, $row) {
75 $aOnClick = 'jumpToUrl(\'' . $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => ('tt_content:' . $row['uid']))) . '\');return false;';
76 return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $str . '</a>';
77 }
78
79 /**
80 * Wrapping the column header
81 *
82 * @param string $str Header value
83 * @param string $vv Column info.
84 * @return string
85 * @see printRecordMap()
86 * @todo Define visibility
87 */
88 public function wrapColumnHeader($str, $vv) {
89 $aOnClick = 'jumpToUrl(\'' . $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => ('_EDIT_COL:' . $vv))) . '\');return false;';
90 return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $str . '</a>';
91 }
92
93 /**
94 * Create on-click event value.
95 *
96 * @param array $row The record.
97 * @param string $vv Column position value.
98 * @param integer $moveUid Move uid
99 * @param integer $pid PID value.
100 * @param integer $sys_lang System language
101 * @return string
102 * @todo Define visibility
103 */
104 public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0) {
105 if (is_array($row)) {
106 $location = $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => 'tt_content:new/-' . $row['uid'] . '/' . $row['colPos']));
107 } else {
108 $location = $GLOBALS['SOBE']->local_linkThisScript(array('edit_record' => 'tt_content:new/' . $pid . '/' . $vv));
109 }
110 return 'jumpToUrl(\'' . $location . '\');return false;';
111 }
112
113 /**
114 * Wrapping the record header (from getRecordHeader())
115 *
116 * @param string $str HTML content
117 * @param array $row Record array.
118 * @return string HTML content
119 * @todo Define visibility
120 */
121 public function wrapRecordHeader($str, $row) {
122 if ($row['uid'] == $this->moveUid) {
123 return '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/content_client.gif', 'width="7" height="10"') . ' alt="" />' . $str;
124 } else {
125 return $str;
126 }
127 }
128
129 }
130
131 /*
132 * @deprecated since 6.0, the classname SC_db_layout and this file is obsolete
133 * and will be removed by 7.0. The class was renamed and is now located at:
134 * typo3/sysext/backend/Classes/Controller/PageLayoutController.php
135 */
136 require_once \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('backend') . 'Classes/Controller/PageLayoutController.php';
137 // Make instance:
138 $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\PageLayoutController');
139 $SOBE->init();
140 // Include files?
141 foreach ($SOBE->include_once as $INC_FILE) {
142 include_once $INC_FILE;
143 }
144 $SOBE->clearCache();
145 $SOBE->main();
146 $SOBE->printContent();
147 ?>