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