‪TYPO3CMS  10.4
AbstractLinkHandler.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
24 
30 abstract class ‪AbstractLinkHandler
31 {
39  protected ‪$linkAttributes = ['target', 'title', 'class', 'params', 'rel'];
40 
44  protected ‪$updateSupported = true;
45 
49  protected ‪$linkBrowser;
50 
54  protected ‪$iconFactory;
55 
59  protected ‪$view;
60 
64  public function ‪__construct()
65  {
66  }
67 
75  public function ‪initialize(‪AbstractLinkBrowserController ‪$linkBrowser, $identifier, array $configuration)
76  {
77  $this->linkBrowser = ‪$linkBrowser;
78  $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
79  $this->view = GeneralUtility::makeInstance(StandaloneView::class);
80  $this->view->getRequest()->setControllerExtensionName('recordlist');
81  $this->view->setTemplateRootPaths([GeneralUtility::getFileAbsFileName('EXT:recordlist/Resources/Private/Templates/LinkBrowser')]);
82  $this->view->setPartialRootPaths([GeneralUtility::getFileAbsFileName('EXT:recordlist/Resources/Private/Partials/LinkBrowser')]);
83  $this->view->setLayoutRootPaths([GeneralUtility::getFileAbsFileName('EXT:recordlist/Resources/Private/Layouts/LinkBrowser')]);
84  }
85 
89  public function ‪getLinkAttributes()
90  {
92  }
93 
98  public function ‪modifyLinkAttributes(array $fieldDefinitions)
99  {
100  return $fieldDefinitions;
101  }
102 
110  public function ‪isUpdateSupported()
111  {
113  }
114 
118  protected function ‪setTemporaryDbMounts()
119  {
120  $backendUser = $this->‪getBackendUser();
121 
122  // Clear temporary DB mounts
123  $tmpMount = GeneralUtility::_GET('setTempDBmount');
124  if (isset($tmpMount)) {
125  $backendUser->setAndSaveSessionData('pageTree_temporaryMountPoint', (int)$tmpMount);
126  }
127 
128  $backendUser->initializeWebmountsForElementBrowser();
129  }
130 
134  protected function ‪getBackendUser()
135  {
136  return ‪$GLOBALS['BE_USER'];
137  }
138 
142  protected function ‪getLanguageService()
143  {
144  return ‪$GLOBALS['LANG'];
145  }
146 }
‪TYPO3\CMS\Core\Imaging\IconFactory
Definition: IconFactory.php:33
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪TYPO3\CMS\Fluid\View\StandaloneView
Definition: StandaloneView.php:34
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:42
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46