[TASK] Use proper class naming for ext_posMap for db_new_content_el 04/38404/2
authorBenjamin Mack <benni@typo3.org>
Wed, 1 Apr 2015 14:25:11 +0000 (16:25 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 3 Apr 2015 18:57:35 +0000 (20:57 +0200)
Resolves: #66220
Releases: master
Change-Id: I763d82db8ba922d094e85c1b46039f8fef4d4dd6
Reviewed-on: http://review.typo3.org/38404
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php
typo3/sysext/backend/Classes/Tree/View/ContentCreationPagePositionMap.php [new file with mode: 0644]
typo3/sysext/backend/Modules/NewContentElement/index.php
typo3/sysext/cms/layout/db_new_content_el.php

index ca2ce51..046c76d 100644 (file)
@@ -137,7 +137,7 @@ class NewContentElementController {
        public function main() {
                if ($this->id && $this->access) {
                        // Init position map object:
-                       $posMap = GeneralUtility::makeInstance(\ext_posMap::class);
+                       $posMap = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Tree\View\ContentCreationPagePositionMap::class);
                        $posMap->cur_sys_language = $this->sys_language;
                        $posMap->backPath = $GLOBALS['BACK_PATH'];
                        // If a column is pre-set:
diff --git a/typo3/sysext/backend/Classes/Tree/View/ContentCreationPagePositionMap.php b/typo3/sysext/backend/Classes/Tree/View/ContentCreationPagePositionMap.php
new file mode 100644 (file)
index 0000000..cc46efa
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+namespace TYPO3\CMS\Backend\Tree\View;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * Local position map class when creating new Content Elements
+ */
+class ContentCreationPagePositionMap extends PagePositionMap {
+
+       /**
+        * @var bool
+        */
+       public $dontPrintPageInsertIcons = 1;
+
+       /**
+        * Wrapping the title of the record - here we just return it.
+        *
+        * @param string $str The title value.
+        * @param array $row The record row.
+        * @return string Wrapped title string.
+        */
+       public function wrapRecordTitle($str, $row) {
+               return $str;
+       }
+
+       /**
+        * Create on-click event value.
+        *
+        * @param array $row The record.
+        * @param string $vv Column position value.
+        * @param int $moveUid Move uid
+        * @param int $pid PID value.
+        * @param int $sys_lang System language
+        * @return string
+        */
+       public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0) {
+               $location = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('record_edit', array(
+                       'edit[tt_content][' . (is_array($row) ? -$row['uid'] : $pid) . ']' => 'new',
+                       'defVals[tt_content][colPos]' => $vv,
+                       'defVals[tt_content][sys_language_uid]' => $sys_lang,
+                       'returnUrl' => $GLOBALS['SOBE']->R_URI
+               ));
+               return 'window.location.href=' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($location) . '+document.editForm.defValues.value; return false;';
+       }
+}
index 694a1a5..3c0f459 100644 (file)
  * The TYPO3 project - inspiring people to share!
  */
 
-/**
- * Local position map class
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- */
-class ext_posMap extends \TYPO3\CMS\Backend\Tree\View\PagePositionMap {
-
-       /**
-        * @var bool
-        */
-       public $dontPrintPageInsertIcons = 1;
-
-       /**
-        * Wrapping the title of the record - here we just return it.
-        *
-        * @param string $str The title value.
-        * @param array $row The record row.
-        * @return string Wrapped title string.
-        */
-       public function wrapRecordTitle($str, $row) {
-               return $str;
-       }
-
-       /**
-        * Create on-click event value.
-        *
-        * @param array $row The record.
-        * @param string $vv Column position value.
-        * @param int $moveUid Move uid
-        * @param int $pid PID value.
-        * @param int $sys_lang System language
-        * @return string
-        */
-       public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0) {
-               $location = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('record_edit', array(
-                       'edit[tt_content][' . (is_array($row) ? -$row['uid'] : $pid) . ']' => 'new',
-                       'defVals[tt_content][colPos]' => $vv,
-                       'defVals[tt_content][sys_language_uid]' => $sys_lang,
-                       'returnUrl' => $GLOBALS['SOBE']->R_URI
-               ));
-               return 'window.location.href=' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($location) . '+document.editForm.defValues.value; return false;';
-       }
-
-}
-
 $GLOBALS['SOBE'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Controller\ContentElement\NewContentElementController::class);
 $GLOBALS['SOBE']->init();
 $GLOBALS['SOBE']->main();
index 7eddb52..e7a1092 100644 (file)
@@ -30,50 +30,6 @@ $LOCAL_LANG_orig = $LOCAL_LANG;
 $LANG->includeLLFile('EXT:cms/layout/locallang_db_new_content_el.xlf');
 \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($LOCAL_LANG_orig, $LOCAL_LANG);
 $LOCAL_LANG = $LOCAL_LANG_orig;
-/**
- * Local position map class
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- */
-class ext_posMap extends \TYPO3\CMS\Backend\Tree\View\PagePositionMap {
-
-       /**
-        * @var bool
-        */
-       public $dontPrintPageInsertIcons = 1;
-
-       /**
-        * Wrapping the title of the record - here we just return it.
-        *
-        * @param string $str The title value.
-        * @param array $row The record row.
-        * @return string Wrapped title string.
-        */
-       public function wrapRecordTitle($str, $row) {
-               return $str;
-       }
-
-       /**
-        * Create on-click event value.
-        *
-        * @param array $row The record.
-        * @param string $vv Column position value.
-        * @param int $moveUid Move uid
-        * @param int $pid PID value.
-        * @param int $sys_lang System language
-        * @return string
-        */
-       public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0) {
-               $location = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('record_edit', array(
-                       'edit[tt_content][' . (is_array($row) ? -$row['uid'] : $pid) . ']' => 'new',
-                       'defVals[tt_content][colPos]' => $vv,
-                       'defVals[tt_content][sys_language_uid]' => $sys_lang,
-                       'returnUrl' => $GLOBALS['SOBE']->R_URI
-               ));
-               return 'window.location.href=\'' . $location . '\'+document.editForm.defValues.value; return false;';
-       }
-
-}
 
 \TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog(
        'The new element class is moved to an own module. Please use BackendUtility::getModuleUrl(\'new_content_element\') to link to db_new_content_el.php. This script will be removed with version 8.'