TYPO3 CMS  TYPO3_8-7
ContentLayoutPagePositionMap.php
Go to the documentation of this file.
1 <?php
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 
20 
25 {
30 
34  public $l_insertNewRecordHere = 'newContentElement';
35 
43  public function wrapRecordTitle($str, $row)
44  {
45  $aOnClick = 'jumpToUrl(' . GeneralUtility::quoteJSvalue($this->linkToCurrentModule(['edit_record' => 'tt_content:' . $row['uid']])) . ');return false;';
46  return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $str . '</a>';
47  }
48 
57  public function wrapColumnHeader($str, $vv)
58  {
59  $aOnClick = 'jumpToUrl(' . GeneralUtility::quoteJSvalue($this->linkToCurrentModule(['edit_record' => '_EDIT_COL:' . $vv])) . ');return false;';
60  return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $str . '</a>';
61  }
62 
73  public function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0)
74  {
75  if (is_array($row)) {
76  $linkInformation = 'tt_content:new/-' . $row['uid'] . '/' . $row['colPos'];
77  } else {
78  $linkInformation = 'tt_content:new/' . $pid . '/' . $vv;
79  }
80  $location = $this->linkToCurrentModule(['edit_record' => $linkInformation]);
81  return 'jumpToUrl(' . GeneralUtility::quoteJSvalue($location) . ');return false;';
82  }
83 
91  public function wrapRecordHeader($str, $row)
92  {
93  if ($row['uid'] == $this->moveUid) {
95  $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
96  return $iconFactory->getIcon('status-status-current', Icon::SIZE_SMALL)->render() . $str;
97  }
98  return $str;
99  }
100 
108  protected function linkToCurrentModule($params)
109  {
110  unset($params['popView']);
111  unset($params['new_unique_uid']);
112  return GeneralUtility::linkThisScript($params);
113  }
114 }
static linkThisScript(array $getParams=[])
static makeInstance($className,... $constructorArguments)