‪TYPO3CMS  9.5
AbstractLinkHandler.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 
22 
28 abstract class ‪AbstractLinkHandler
29 {
37  protected ‪$linkAttributes = ['target', 'title', 'class', 'params', 'rel'];
38 
42  protected ‪$updateSupported = true;
43 
47  protected ‪$linkBrowser;
48 
52  protected ‪$iconFactory;
53 
57  protected ‪$view;
58 
62  public function ‪__construct()
63  {
64  }
65 
73  public function ‪initialize(‪AbstractLinkBrowserController ‪$linkBrowser, $identifier, array $configuration)
74  {
75  $this->linkBrowser = ‪$linkBrowser;
76  $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
77  $this->view = GeneralUtility::makeInstance(\‪TYPO3\CMS\Fluid\View\StandaloneView::class);
78  $this->view->getRequest()->setControllerExtensionName('recordlist');
79  $this->view->setTemplateRootPaths([GeneralUtility::getFileAbsFileName('EXT:recordlist/Resources/Private/Templates/LinkBrowser')]);
80  $this->view->setPartialRootPaths([GeneralUtility::getFileAbsFileName('EXT:recordlist/Resources/Private/Partials/LinkBrowser')]);
81  $this->view->setLayoutRootPaths([GeneralUtility::getFileAbsFileName('EXT:recordlist/Resources/Private/Layouts/LinkBrowser')]);
82  }
83 
87  public function ‪getLinkAttributes()
88  {
90  }
91 
96  public function ‪modifyLinkAttributes(array $fieldDefinitions)
97  {
98  return $fieldDefinitions;
99  }
100 
108  public function ‪isUpdateSupported()
109  {
111  }
112 
116  protected function ‪setTemporaryDbMounts()
117  {
118  $backendUser = $this->‪getBackendUser();
119 
120  // Clear temporary DB mounts
121  $tmpMount = GeneralUtility::_GET('setTempDBmount');
122  if (isset($tmpMount)) {
123  $backendUser->setAndSaveSessionData('pageTree_temporaryMountPoint', (int)$tmpMount);
124  }
125 
126  $backendUser->initializeWebmountsForElementBrowser();
127  }
128 
132  protected function ‪getBackendUser()
133  {
134  return ‪$GLOBALS['BE_USER'];
135  }
136 
140  protected function ‪getLanguageService()
141  {
142  return ‪$GLOBALS['LANG'];
143  }
144 }
‪TYPO3
‪TYPO3\CMS\Core\Imaging\IconFactory
Definition: IconFactory.php:31
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:45
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:29
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:45