[TASK] Use "int" in @param notation
[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 // Exits if 'cms' extension is not loaded:
33 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms', 1);
34 /**
35 * Local position map class
36 *
37 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
38 */
39 class ext_posMap extends \TYPO3\CMS\Backend\Tree\View\PagePositionMap {
40
41 /**
42 * @var bool
43 */
44 public $dontPrintPageInsertIcons = 1;
45
46 /**
47 * Wrapping the title of the record - here we just return it.
48 *
49 * @param string $str The title value.
50 * @param array $row The record row.
51 * @return string Wrapped title string.
52 */
53 public function wrapRecordTitle($str, $row) {
54 return $str;
55 }
56
57 /**
58 * Create on-click event value.
59 *
60 * @param array $row The record.
61 * @param string $vv Column position value.
62 * @param int $moveUid Move uid
63 * @param int $pid PID value.
64 * @param int $sys_lang System language
65 * @return string
66 */
67 public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0) {
68 $table = 'tt_content';
69 $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);
70 return 'window.location.href=\'' . $location . '\'+document.editForm.defValues.value; return false;';
71 }
72
73 }
74
75 /*
76 * @deprecated since 6.0, the classname SC_db_new_content_el and this file is obsolete
77 * and will be removed with 6.2. The class was renamed and is now located at:
78 * typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php
79 */
80 require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('backend') . 'Classes/Controller/ContentElement/NewContentElementController.php';
81 // Make instance:
82 $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\ContentElement\\NewContentElementController');
83 $SOBE->init();
84 // Include files?
85 foreach ($SOBE->include_once as $INC_FILE) {
86 include_once $INC_FILE;
87 }
88 $SOBE->main();
89 $SOBE->printContent();