[CLEANUP] Use comments not PHPDoc style comments in copyright block
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / layout / db_new_content_el.php
1 <?php
2 /*
3 * This file is part of the TYPO3 CMS project.
4 *
5 * It is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License, either version 2
7 * of the License, or any later version.
8 *
9 * For the full copyright and license information, please read the
10 * LICENSE.txt file that was distributed with this source code.
11 *
12 * The TYPO3 project - inspiring people to share!
13 */
14 /**
15 * New content elements wizard
16 * (Part of the 'cms' extension)
17 *
18 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
19 */
20 unset($MCONF);
21 require __DIR__ . '/conf.php';
22 require $BACK_PATH . 'init.php';
23 // Unset MCONF/MLANG since all we wanted was back path etc. for this particular script.
24 unset($MCONF);
25 unset($MLANG);
26 // Merging locallang files/arrays:
27 $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_misc.xlf');
28 $LOCAL_LANG_orig = $LOCAL_LANG;
29 $LANG->includeLLFile('EXT:cms/layout/locallang_db_new_content_el.xlf');
30 \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($LOCAL_LANG_orig, $LOCAL_LANG);
31 $LOCAL_LANG = $LOCAL_LANG_orig;
32 /**
33 * Local position map class
34 *
35 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
36 */
37 class ext_posMap extends \TYPO3\CMS\Backend\Tree\View\PagePositionMap {
38
39 /**
40 * @var bool
41 */
42 public $dontPrintPageInsertIcons = 1;
43
44 /**
45 * Wrapping the title of the record - here we just return it.
46 *
47 * @param string $str The title value.
48 * @param array $row The record row.
49 * @return string Wrapped title string.
50 */
51 public function wrapRecordTitle($str, $row) {
52 return $str;
53 }
54
55 /**
56 * Create on-click event value.
57 *
58 * @param array $row The record.
59 * @param string $vv Column position value.
60 * @param int $moveUid Move uid
61 * @param int $pid PID value.
62 * @param int $sys_lang System language
63 * @return string
64 */
65 public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0) {
66 $table = 'tt_content';
67 $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);
68 return 'window.location.href=\'' . $location . '\'+document.editForm.defValues.value; return false;';
69 }
70
71 }
72
73 require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('backend') . 'Classes/Controller/ContentElement/NewContentElementController.php';
74 // Make instance:
75 $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Controller\ContentElement\NewContentElementController::class);
76 $SOBE->init();
77 // Include files?
78 foreach ($SOBE->include_once as $INC_FILE) {
79 include_once $INC_FILE;
80 }
81 $SOBE->main();
82 $SOBE->printContent();