[TASK] Merge submodule fluid into core
[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 * 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.xlf');
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\Utility\ExtensionManagementUtility::isLoaded('cms', 1);
49 /**
50 * Local position map class
51 *
52 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
53 */
54 class ext_posMap extends \TYPO3\CMS\Backend\Tree\View\PagePositionMap {
55
56 /**
57 * @todo Define visibility
58 */
59 public $dontPrintPageInsertIcons = 1;
60
61 /**
62 * Wrapping the title of the record - here we just return it.
63 *
64 * @param string $str The title value.
65 * @param array $row The record row.
66 * @return string Wrapped title string.
67 * @todo Define visibility
68 */
69 public function wrapRecordTitle($str, $row) {
70 return $str;
71 }
72
73 /**
74 * Create on-click event value.
75 *
76 * @param array $row The record.
77 * @param string $vv Column position value.
78 * @param integer $moveUid Move uid
79 * @param integer $pid PID value.
80 * @param integer $sys_lang System language
81 * @return string
82 * @todo Define visibility
83 */
84 public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0) {
85 $table = 'tt_content';
86 $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);
87 return 'window.location.href=\'' . $location . '\'+document.editForm.defValues.value; return false;';
88 }
89
90 }
91
92 /*
93 * @deprecated since 6.0, the classname SC_db_new_content_el and this file is obsolete
94 * and will be removed with 6.2. The class was renamed and is now located at:
95 * typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php
96 */
97 require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('backend') . 'Classes/Controller/ContentElement/NewContentElementController.php';
98 // Make instance:
99 $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\ContentElement\\NewContentElementController');
100 $SOBE->init();
101 // Include files?
102 foreach ($SOBE->include_once as $INC_FILE) {
103 include_once $INC_FILE;
104 }
105 $SOBE->main();
106 $SOBE->printContent();
107 ?>