[TASK] Fix typo in copyright notice
[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 text file 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 \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($LOCAL_LANG_orig, $LOCAL_LANG);
44 $LOCAL_LANG = $LOCAL_LANG_orig;
45 // Exits if 'cms' extension is not loaded:
46 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms', 1);
47 /**
48 * Local 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 * Wrapping the title of the record - here we just return it.
61 *
62 * @param string $str The title value.
63 * @param array $row The record row.
64 * @return string Wrapped title string.
65 * @todo Define visibility
66 */
67 public function wrapRecordTitle($str, $row) {
68 return $str;
69 }
70
71 /**
72 * Create on-click event value.
73 *
74 * @param array $row The record.
75 * @param string $vv Column position value.
76 * @param integer $moveUid Move uid
77 * @param integer $pid PID value.
78 * @param integer $sys_lang System language
79 * @return string
80 * @todo Define visibility
81 */
82 public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0) {
83 $table = 'tt_content';
84 $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);
85 return 'window.location.href=\'' . $location . '\'+document.editForm.defValues.value; return false;';
86 }
87
88 }
89
90 /*
91 * @deprecated since 6.0, the classname SC_db_new_content_el and this file is obsolete
92 * and will be removed with 6.2. The class was renamed and is now located at:
93 * typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php
94 */
95 require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('backend') . 'Classes/Controller/ContentElement/NewContentElementController.php';
96 // Make instance:
97 $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\ContentElement\\NewContentElementController');
98 $SOBE->init();
99 // Include files?
100 foreach ($SOBE->include_once as $INC_FILE) {
101 include_once $INC_FILE;
102 }
103 $SOBE->main();
104 $SOBE->printContent();