‪TYPO3CMS  9.5
AbstractFunctionModule.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 
23 
66 {
74  public ‪$pObj;
75 
79  public ‪$extObj;
80 
88  public ‪$localLangFile = '';
89 
96  public ‪$extClassConf;
97 
106  public ‪$function_key = '';
107 
111  protected ‪$pageRenderer;
112 
116  public function ‪__construct()
117  {
118  trigger_error(
119  'Class AbstractFunctionModule is deprecated and will be removed in TYPO3 v10.0',
120  E_USER_DEPRECATED
121  );
122  }
123 
131  public function ‪init(‪$pObj)
132  {
133  $this->pObj = ‪$pObj;
134  // Local lang:
135  if (!empty($this->localLangFile)) {
136  $this->‪getLanguageService()->‪includeLLFile($this->localLangFile);
137  }
138  // Setting MOD_MENU items as we need them for logging:
139  $this->pObj->MOD_MENU = array_merge($this->pObj->MOD_MENU, $this->modMenu());
140  }
141 
148  public function ‪handleExternalFunctionValue()
149  {
150  // Must clean first to make sure the correct key is set...
151  $this->pObj->MOD_SETTINGS = ‪BackendUtility::getModuleData($this->pObj->MOD_MENU, GeneralUtility::_GP('SET'), $this->pObj->MCONF['name']);
152  if ($this->function_key) {
153  $this->extClassConf = $this->pObj->getExternalItemConfig($this->pObj->MCONF['name'], $this->function_key, $this->pObj->MOD_SETTINGS[$this->function_key]);
154  }
155  }
156 
162  public function ‪checkExtObj()
163  {
164  if (is_array($this->extClassConf) && $this->extClassConf['name']) {
165  $this->extObj = GeneralUtility::makeInstance($this->extClassConf['name']);
166  $this->extObj->init($this->pObj, $this->extClassConf);
167  // Re-write:
168  $this->pObj->MOD_SETTINGS = ‪BackendUtility::getModuleData($this->pObj->MOD_MENU, GeneralUtility::_GP('SET'), $this->pObj->MCONF['name']);
169  }
170  }
171 
175  public function ‪extObjContent()
176  {
177  if (is_object($this->extObj)) {
178  return $this->extObj->main();
179  }
180  }
181 
188  public function ‪modMenu()
189  {
190  return [];
191  }
192 
196  protected function ‪getLanguageService()
197  {
198  return ‪$GLOBALS['LANG'];
199  }
200 
204  protected function ‪getBackendUserAuthentication()
205  {
206  return ‪$GLOBALS['BE_USER'];
207  }
208 
212  protected function ‪getDocumentTemplate()
213  {
214  return ‪$GLOBALS['TBE_TEMPLATE'];
215  }
216 
220  protected function ‪getPageRenderer()
221  {
222  if ($this->pageRenderer === null) {
223  $this->pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
224  }
225 
226  return ‪$this->pageRenderer;
227  }
228 }
‪TYPO3\CMS\Backend\Module\AbstractFunctionModule\$pObj
‪BaseScriptClass $pObj
Definition: AbstractFunctionModule.php:73
‪TYPO3\CMS\Core\Localization\LanguageService\includeLLFile
‪mixed includeLLFile($fileRef, $setGlobal=true, $mergeLocalOntoDefault=false)
Definition: LanguageService.php:260
‪TYPO3\CMS\Backend\Module\AbstractFunctionModule\checkExtObj
‪checkExtObj()
Definition: AbstractFunctionModule.php:156
‪TYPO3\CMS\Backend\Module\AbstractFunctionModule\$localLangFile
‪string $localLangFile
Definition: AbstractFunctionModule.php:85
‪TYPO3\CMS\Backend\Module\AbstractFunctionModule\init
‪init($pObj)
Definition: AbstractFunctionModule.php:125
‪TYPO3\CMS\Backend\Module\AbstractFunctionModule\$function_key
‪string $function_key
Definition: AbstractFunctionModule.php:101
‪TYPO3\CMS\Backend\Module\AbstractFunctionModule\modMenu
‪array modMenu()
Definition: AbstractFunctionModule.php:182
‪TYPO3\CMS\Backend\Module\AbstractFunctionModule
Definition: AbstractFunctionModule.php:66
‪TYPO3\CMS\Backend\Module\AbstractFunctionModule\$extObj
‪BaseScriptClass $extObj
Definition: AbstractFunctionModule.php:77
‪TYPO3\CMS\Backend\Module\AbstractFunctionModule\__construct
‪__construct()
Definition: AbstractFunctionModule.php:110
‪TYPO3\CMS\Backend\Module\AbstractFunctionModule\$pageRenderer
‪PageRenderer $pageRenderer
Definition: AbstractFunctionModule.php:105
‪TYPO3\CMS\Core\Page\PageRenderer
Definition: PageRenderer.php:35
‪TYPO3\CMS\Backend\Module\BaseScriptClass
Definition: BaseScriptClass.php:72
‪TYPO3\CMS\Backend\Template\DocumentTemplate
Definition: DocumentTemplate.php:48
‪TYPO3\CMS\Backend\Module\AbstractFunctionModule\$extClassConf
‪array $extClassConf
Definition: AbstractFunctionModule.php:92
‪TYPO3\CMS\Backend\Utility\BackendUtility\getModuleData
‪static array getModuleData( $MOD_MENU, $CHANGED_SETTINGS, $modName, $type='', $dontValidateList='', $setDefaultList='')
Definition: BackendUtility.php:3259
‪TYPO3\CMS\Backend\Module\AbstractFunctionModule\getPageRenderer
‪PageRenderer getPageRenderer()
Definition: AbstractFunctionModule.php:214
‪TYPO3\CMS\Backend\Module\AbstractFunctionModule\getLanguageService
‪LanguageService getLanguageService()
Definition: AbstractFunctionModule.php:190
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:45
‪TYPO3\CMS\Backend\Module\AbstractFunctionModule\getBackendUserAuthentication
‪BackendUserAuthentication getBackendUserAuthentication()
Definition: AbstractFunctionModule.php:198
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:72
‪TYPO3\CMS\Backend\Module\AbstractFunctionModule\getDocumentTemplate
‪DocumentTemplate getDocumentTemplate()
Definition: AbstractFunctionModule.php:206
‪TYPO3\CMS\Backend\Module\AbstractFunctionModule\handleExternalFunctionValue
‪handleExternalFunctionValue()
Definition: AbstractFunctionModule.php:142
‪$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
‪TYPO3\CMS\Backend\Module\AbstractFunctionModule\extObjContent
‪extObjContent()
Definition: AbstractFunctionModule.php:169
‪TYPO3\CMS\Backend\Module
Definition: AbstractFunctionModule.php:2