‪TYPO3CMS  10.4
TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController Class Reference

Public Member Functions

 __construct ()
 
ResponseInterface mainAction (ServerRequestInterface $request)
 
string linkWrapTemplateTitle ($title, $onlyKey='')
 
string noTemplate ($newStandardTemplate=0)
 
string templateMenu (ServerRequestInterface $request)
 
string createTemplate ($id, $actTemplateId=0)
 

Public Attributes

string $modMenu_dontValidateList = ''
 
string $modMenu_setDefaultList = ''
 
array $MOD_MENU
 
array $MOD_SETTINGS = array( )
 

Protected Member Functions

 generateMenu ()
 
 getButtons ()
 
 setInPageArray (&$pArray, $rlArr, $row)
 
StandaloneView getFluidTemplateObject ($extensionName, $templateName='Main')
 
 applyWorkspaceConstraint (QueryBuilder $queryBuilder, string $tableName, int $workspaceId)
 
string getHookObjectForAction ($action)
 
 menuConfig ($changedSettings)
 
array mergeExternalItems ($modName, $menuKey, $menuArr)
 
mixed getExternalItemConfig ($modName, $menuKey, $value='')
 
 checkExtObj ($changedSettings, ServerRequestInterface $request)
 
string null getExtObjContent ()
 
LanguageService getLanguageService ()
 
BackendUserAuthentication getBackendUser ()
 
PageRenderer getPageRenderer ()
 

Protected Attributes

string $perms_clause
 
array $pageinfo = array( )
 
bool $access = false
 
string $moduleName = 'web_ts'
 
ModuleTemplate $moduleTemplate
 
ExtendedTemplateService $templateService
 
 $id
 
array $modTSconfig
 
array $extClassConf
 
object $extObj
 
ServerRequestInterface $request
 

Detailed Description

Module: TypoScript Tools

This is a specific Backend Controller implementation and is not considered part of the Public TYPO3 API.

Definition at line 47 of file TypoScriptTemplateModuleController.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::__construct ( )

Member Function Documentation

◆ applyWorkspaceConstraint()

TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::applyWorkspaceConstraint ( QueryBuilder  $queryBuilder,
string  $tableName,
int  $workspaceId 
)
protected

Fetching all live records, and versioned records that do not have a "online ID" counterpart, as this is then handled via the BackendUtility::workspaceOL().

Parameters
QueryBuilder$queryBuilder
string$tableName
int$workspaceId

Definition at line 587 of file TypoScriptTemplateModuleController.php.

References TYPO3\CMS\Core\Database\Query\Restriction\QueryRestrictionContainerInterface\add(), TYPO3\CMS\Core\Database\Query\QueryBuilder\getRestrictions(), and TYPO3\CMS\Backend\Utility\BackendUtility\isTableWorkspaceEnabled().

Referenced by TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\mainAction().

◆ checkExtObj()

TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::checkExtObj (   $changedSettings,
ServerRequestInterface  $request 
)
protected

Creates an instance of the class found in $this->extClassConf['name'] in $this->extObj if any (this should hold three keys, "name", "path" and "title" if a "Function menu module" tries to connect...) This value in extClassConf might be set by an extension (in an ext_tables/ext_localconf file) which thus "connects" to a module. The array $this->extClassConf is set based on the value of MOD_SETTINGS[function] If an instance is created it is initiated with $this passed as value and $this->extClassConf as second argument. Further the $this->MOD_SETTING is cleaned up again after calling the init function.

See also
‪\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction()
Parameters
array$changedSettings
ServerRequestInterface$request

Definition at line 690 of file TypoScriptTemplateModuleController.php.

References TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\$request, and TYPO3\CMS\Backend\Utility\BackendUtility\getModuleData().

Referenced by TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\mainAction().

◆ createTemplate()

string TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::createTemplate (   $id,
  $actTemplateId = 0 
)

◆ generateMenu()

TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::generateMenu ( )
protected

Generates the menu based on $this->MOD_MENU

Exceptions

Definition at line 143 of file TypoScriptTemplateModuleController.php.

Referenced by TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\mainAction().

◆ getBackendUser()

BackendUserAuthentication TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::getBackendUser ( )
protected

◆ getButtons()

◆ getExternalItemConfig()

mixed TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::getExternalItemConfig (   $modName,
  $menuKey,
  $value = '' 
)
protected

Returns configuration values from the global variable $TBE_MODULES_EXT for the module given. For example if the module is named "web_info" and the "function" key ($menuKey) of MOD_SETTINGS is "stat" ($value) then you will have the values of $TBE_MODULES_EXT['webinfo']['MOD_MENU']['function']['stat'] returned.

Parameters
string$modName‪Module name
string$menuKey‪Menu key, eg. "function" for the function menu. See $this->MOD_MENU
string$value‪Optionally the value-key to fetch from the array that would otherwise have been returned if this value was not set. Look source...
Returns
‪mixed The value from the TBE_MODULES_EXT array.

Definition at line 670 of file TypoScriptTemplateModuleController.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\mainAction().

◆ getExtObjContent()

string null TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::getExtObjContent ( )
protected

Return the content of the 'main' function inside the "Function menu module" if present

Returns
‪string|null

Definition at line 705 of file TypoScriptTemplateModuleController.php.

References TYPO3\CMS\Core\Messaging\AbstractMessage\ERROR, and TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\getLanguageService().

Referenced by TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\mainAction().

◆ getFluidTemplateObject()

StandaloneView TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::getFluidTemplateObject (   $extensionName,
  $templateName = 'Main' 
)
protected

Returns a new standalone view, shorthand function

Parameters
string$extensionName
string$templateName
Returns
‪StandaloneView

Definition at line 570 of file TypoScriptTemplateModuleController.php.

Referenced by TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\mainAction(), and TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\noTemplate().

◆ getHookObjectForAction()

string TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::getHookObjectForAction (   $action)
protected

◆ getLanguageService()

◆ getPageRenderer()

PageRenderer TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::getPageRenderer ( )
protected
Returns
‪PageRenderer

Definition at line 747 of file TypoScriptTemplateModuleController.php.

◆ linkWrapTemplateTitle()

string TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::linkWrapTemplateTitle (   $title,
  $onlyKey = '' 
)

Wrap title for link in template, called from client classes.

Parameters
string$title
string$onlyKey
Returns
‪string

Definition at line 376 of file TypoScriptTemplateModuleController.php.

References TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\$id.

◆ mainAction()

ResponseInterface TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::mainAction ( ServerRequestInterface  $request)

Injects the request object for the current request or subrequest Then checks for module functions that have hooked in, and renders menu etc.

Parameters
ServerRequestInterface$request‪the current request
Returns
‪ResponseInterface the response with the content

Definition at line 178 of file TypoScriptTemplateModuleController.php.

References TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\$id, TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\$request, TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\applyWorkspaceConstraint(), TYPO3\CMS\Backend\Utility\BackendUtility\BEgetRootLine(), TYPO3\CMS\Core\Type\Enumeration\cast(), TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\checkExtObj(), TYPO3\CMS\Core\Versioning\VersionState\DELETE_PLACEHOLDER, TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\generateMenu(), TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\getBackendUser(), TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\getButtons(), TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\getExternalItemConfig(), TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\getExtObjContent(), TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\getFluidTemplateObject(), TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getPagePermsClause(), TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\menuConfig(), TYPO3\CMS\Core\Type\Bitmask\Permission\PAGE_SHOW, TYPO3\CMS\Backend\Utility\BackendUtility\readPageAccess(), TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\setInPageArray(), and TYPO3\CMS\Backend\Utility\BackendUtility\workspaceOL().

◆ menuConfig()

TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::menuConfig (   $changedSettings)
protected

Initializes the internal MOD_MENU array setting and unsetting items based on various conditions. It also merges in external menu items from the global array TBE_MODULES_EXT (see mergeExternalItems()) Then MOD_SETTINGS array is cleaned up (see \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleData()) so it contains only valid values. It's also updated with any SET[] values submitted. Also loads the modTSconfig internal variable.

Parameters
array$changedSettings‪can be anything
See also
mainAction()
‪\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleData()
mergeExternalItems()

Definition at line 623 of file TypoScriptTemplateModuleController.php.

References TYPO3\CMS\Backend\Utility\BackendUtility\getModuleData(), TYPO3\CMS\Backend\Utility\BackendUtility\getPagesTSconfig(), and TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\mergeExternalItems().

Referenced by TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\mainAction().

◆ mergeExternalItems()

array TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::mergeExternalItems (   $modName,
  $menuKey,
  $menuArr 
)
protected

Merges menu items from global array $TBE_MODULES_EXT

Parameters
string$modName‪Module name for which to find value
string$menuKey‪Menu key, eg. 'function' for the function menu.
array$menuArr‪The part of a MOD_MENU array to work on.
Returns
‪array Modified array part.
See also
‪\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction()
menuConfig()

Definition at line 648 of file TypoScriptTemplateModuleController.php.

References $GLOBALS, TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\getBackendUser(), TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\getLanguageService(), and TYPO3\CMS\Core\Localization\LanguageService\sL().

Referenced by TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\menuConfig().

◆ noTemplate()

string TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::noTemplate (   $newStandardTemplate = 0)

◆ setInPageArray()

TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::setInPageArray ( $pArray,
  $rlArr,
  $row 
)
protected

Set page in array To render list of page tree with templates

Parameters
array$pArray‪Multidimensional array of page tree with template records
array$rlArr‪Rootline array
array$row‪Record of sys_template

Definition at line 538 of file TypoScriptTemplateModuleController.php.

Referenced by TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\mainAction().

◆ templateMenu()

string TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::templateMenu ( ServerRequestInterface  $request)

Render template menu, called from client classes.

Parameters
ServerRequestInterface$request
Returns
‪string

Definition at line 449 of file TypoScriptTemplateModuleController.php.

References TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController\$request, TYPO3\CMS\Backend\Utility\BackendUtility\getFuncMenu(), and TYPO3\CMS\Backend\Utility\BackendUtility\getModuleData().

Member Data Documentation

◆ $access

bool TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::$access = false
protected

Definition at line 68 of file TypoScriptTemplateModuleController.php.

◆ $extClassConf

array TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::$extClassConf
protected

Contains module configuration parts from TBE_MODULES_EXT if found

Definition at line 116 of file TypoScriptTemplateModuleController.php.

◆ $extObj

object TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::$extObj
protected

May contain an instance of a 'Function menu module' which connects to this backend module.

See also
checkExtObj()

Definition at line 123 of file TypoScriptTemplateModuleController.php.

◆ $id

◆ $MOD_MENU

array TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::$MOD_MENU
Initial value:
= array(
'function' => []
)

The module menu items array. Each key represents a key for which values can range between the items in the array of that key. Written by client classes.

Definition at line 96 of file TypoScriptTemplateModuleController.php.

◆ $MOD_SETTINGS

array TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::$MOD_SETTINGS = array( )

Current settings for the keys of the MOD_MENU array, used in client classes

Definition at line 104 of file TypoScriptTemplateModuleController.php.

◆ $modMenu_dontValidateList

string TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::$modMenu_dontValidateList = ''

Definition at line 56 of file TypoScriptTemplateModuleController.php.

◆ $modMenu_setDefaultList

string TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::$modMenu_setDefaultList = ''

Written by client classes

Definition at line 60 of file TypoScriptTemplateModuleController.php.

◆ $modTSconfig

array TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::$modTSconfig
protected

Module TSconfig based on PAGE TSconfig / USER TSconfig

Definition at line 110 of file TypoScriptTemplateModuleController.php.

◆ $moduleName

string TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::$moduleName = 'web_ts'
protected

The name of the module

Definition at line 74 of file TypoScriptTemplateModuleController.php.

◆ $moduleTemplate

ModuleTemplate TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::$moduleTemplate
protected

ModuleTemplate Container

Definition at line 80 of file TypoScriptTemplateModuleController.php.

◆ $pageinfo

array TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::$pageinfo = array( )
protected

Definition at line 64 of file TypoScriptTemplateModuleController.php.

◆ $perms_clause

string TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::$perms_clause
protected

Definition at line 52 of file TypoScriptTemplateModuleController.php.

◆ $request

◆ $templateService

ExtendedTemplateService TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::$templateService
protected

Definition at line 84 of file TypoScriptTemplateModuleController.php.