[TASK] Use proper class naming for ext_posMap for db_new_content_el
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Tree / View / ContentCreationPagePositionMap.php
1 <?php
2 namespace TYPO3\CMS\Backend\Tree\View;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * Local position map class when creating new Content Elements
19 */
20 class ContentCreationPagePositionMap extends PagePositionMap {
21
22 /**
23 * @var bool
24 */
25 public $dontPrintPageInsertIcons = 1;
26
27 /**
28 * Wrapping the title of the record - here we just return it.
29 *
30 * @param string $str The title value.
31 * @param array $row The record row.
32 * @return string Wrapped title string.
33 */
34 public function wrapRecordTitle($str, $row) {
35 return $str;
36 }
37
38 /**
39 * Create on-click event value.
40 *
41 * @param array $row The record.
42 * @param string $vv Column position value.
43 * @param int $moveUid Move uid
44 * @param int $pid PID value.
45 * @param int $sys_lang System language
46 * @return string
47 */
48 public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0) {
49 $location = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('record_edit', array(
50 'edit[tt_content][' . (is_array($row) ? -$row['uid'] : $pid) . ']' => 'new',
51 'defVals[tt_content][colPos]' => $vv,
52 'defVals[tt_content][sys_language_uid]' => $sys_lang,
53 'returnUrl' => $GLOBALS['SOBE']->R_URI
54 ));
55 return 'window.location.href=' . \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue($location) . '+document.editForm.defValues.value; return false;';
56 }
57 }