Commit 103da82c authored by Benni Mack's avatar Benni Mack Committed by Anja Leichsenring
Browse files

[TASK] Use proper class naming for ext_posMap for db_new_content_el

Resolves: #66220
Releases: master
Change-Id: I763d82db8ba922d094e85c1b46039f8fef4d4dd6
Reviewed-on: http://review.typo3.org/38404


Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent db0285c6
......@@ -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:
......
<?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;';
}
}
......@@ -12,51 +12,6 @@
* 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();
......
......@@ -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.'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment