[TASK] Remove superfluous parenthesis in sysexts.
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / layout / db_new_content_el.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 * New content elements wizard
29 * (Part of the 'cms' extension)
30 *
31 * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
32 * XHTML compatible.
33 *
34 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
35 */
36 unset($MCONF);
37 require 'conf.php';
38 require $BACK_PATH . 'init.php';
39 // Unset MCONF/MLANG since all we wanted was back path etc. for this particular script.
40 unset($MCONF);
41 unset($MLANG);
42 // Merging locallang files/arrays:
43 $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_misc.xml');
44 $LOCAL_LANG_orig = $LOCAL_LANG;
45 $LANG->includeLLFile('EXT:cms/layout/locallang_db_new_content_el.xml');
46 $LOCAL_LANG = \TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule($LOCAL_LANG_orig, $LOCAL_LANG);
47 // Exits if 'cms' extension is not loaded:
48 \TYPO3\CMS\Core\Extension\ExtensionManager::isLoaded('cms', 1);
49 /**
50 * Local position map class
51 *
52 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
53 * @package TYPO3
54 * @subpackage core
55 */
56 class ext_posMap extends \TYPO3\CMS\Backend\Tree\View\PagePositionMap {
57
58 /**
59 * @todo Define visibility
60 */
61 public $dontPrintPageInsertIcons = 1;
62
63 /**
64 * Wrapping the title of the record - here we just return it.
65 *
66 * @param string $str The title value.
67 * @param array $row The record row.
68 * @return string Wrapped title string.
69 * @todo Define visibility
70 */
71 public function wrapRecordTitle($str, $row) {
72 return $str;
73 }
74
75 /**
76 * Create on-click event value.
77 *
78 * @param array $row The record.
79 * @param string $vv Column position value.
80 * @param integer $moveUid Move uid
81 * @param integer $pid PID value.
82 * @param integer $sys_lang System language
83 * @return string
84 * @todo Define visibility
85 */
86 public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0) {
87 $table = 'tt_content';
88 $location = $this->backPath . 'alt_doc.php?edit[tt_content][' . (is_array($row) ? -$row['uid'] : $pid) . ']=new&defVals[tt_content][colPos]=' . $vv . '&defVals[tt_content][sys_language_uid]=' . $sys_lang . '&returnUrl=' . rawurlencode($GLOBALS['SOBE']->R_URI);
89 return 'window.location.href=\'' . $location . '\'+document.editForm.defValues.value; return false;';
90 }
91
92 }
93
94 /*
95 * @deprecated since 6.0, the classname SC_db_new_content_el and this file is obsolete
96 * and will be removed by 7.0. The class was renamed and is now located at:
97 * typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php
98 */
99 require_once \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('backend') . 'Classes/Controller/ContentElement/NewContentElementController.php';
100 // Make instance:
101 $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\ContentElement\\NewContentElementController');
102 $SOBE->init();
103 // Include files?
104 foreach ($SOBE->include_once as $INC_FILE) {
105 include_once $INC_FILE;
106 }
107 $SOBE->main();
108 $SOBE->printContent();
109 ?>