TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Backend\Controller\BackendController Class Reference

Public Member Functions

 getPageRenderer ()
 
 __construct ()
 
 mainAction (ServerRequestInterface $request, ResponseInterface $response)
 
 render ()
 
 addJavascript ($javascript)
 
 addJavascriptFile ($javascriptFile)
 
 addCss ($css)
 
 addCssFile ($cssFileName, $cssFile)
 
 addToolbarItem ($toolbarItemName, $toolbarItemClassName)
 
 getModuleMenu (ServerRequestInterface $request, ResponseInterface $response)
 

Protected Member Functions

 includeLegacyBackendItems ()
 
 initializeToolbarItems ()
 
 loadResourcesForRegisteredNavigationComponents ()
 
 getLocalLangFileName ()
 
 generateLocalLang ()
 
 generateJavascript ()
 
 handlePageEditing ()
 
 setStartupModule ()
 
 executeHook ($identifier, array $hookConfiguration=[])
 
 generateModuleMenu ()
 
 getFluidTemplateObject ($templatePathAndFileName=null)
 
 getLanguageService ()
 
 getBackendUser ()
 
 getDocumentTemplate ()
 

Protected Attributes

 $content = ''
 
 $css = ''
 
 $cssFiles = []
 
 $js = ''
 
 $jsFiles = []
 
 $toolbarItems = []
 
 $menuWidth = 190
 
 $debug
 
 $templatePath = 'EXT:backend/Resources/Private/Templates/'
 
 $backendModuleRepository
 
 $moduleLoader
 
 $pageRenderer
 

Detailed Description

Class for rendering the TYPO3 backend

Definition at line 34 of file BackendController.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ addCss()

TYPO3\CMS\Backend\Controller\BackendController::addCss (   $css)

Adds a css snippet to the backend

Parameters
string$cssCss snippet
Returns
void
Exceptions

Definition at line 814 of file BackendController.php.

References TYPO3\CMS\Backend\Controller\BackendController\$css.

◆ addCssFile()

TYPO3\CMS\Backend\Controller\BackendController::addCssFile (   $cssFileName,
  $cssFile 
)

Adds a css file to the backend after it has been checked that it exists

Parameters
string$cssFileNameThe css file's name with out the .css ending
string$cssFileCss file reference
Returns
bool TRUE if the css file was added, FALSE otherwise

Definition at line 829 of file BackendController.php.

◆ addJavascript()

TYPO3\CMS\Backend\Controller\BackendController::addJavascript (   $javascript)

Adds a javascript snippet to the backend

Parameters
string$javascriptJavascript snippet
Returns
void
Exceptions

Definition at line 781 of file BackendController.php.

◆ addJavascriptFile()

TYPO3\CMS\Backend\Controller\BackendController::addJavascriptFile (   $javascriptFile)

Adds a javscript file to the backend after it has been checked that it exists

Parameters
string$javascriptFileJavascript file reference
Returns
bool TRUE if the javascript file was successfully added, FALSE otherwise

Definition at line 796 of file BackendController.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\resolveBackPath().

◆ addToolbarItem()

TYPO3\CMS\Backend\Controller\BackendController::addToolbarItem (   $toolbarItemName,
  $toolbarItemClassName 
)

Adds an item to the toolbar, the class file for the toolbar item must be loaded at this point

Parameters
string$toolbarItemNameToolbar item name, f.e. tx_toolbarExtension_coolItem
string$toolbarItemClassNameToolbar item class name, f.e. tx_toolbarExtension_coolItem
Returns
void
Exceptions

Definition at line 848 of file BackendController.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\logDeprecatedFunction().

◆ executeHook()

TYPO3\CMS\Backend\Controller\BackendController::executeHook (   $identifier,
array  $hookConfiguration = [] 
)
protected

Executes defined hooks functions for the given identifier.

These hook identifiers are valid:

  • constructPostProcess
  • renderPreProcess
  • renderPostProcess
Parameters
string$identifierSpecific hook identifier
array$hookConfigurationAdditional configuration passed to hook functions
Returns
void

Definition at line 865 of file BackendController.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\callUserFunction().

Referenced by TYPO3\CMS\Backend\Controller\BackendController\__construct(), and TYPO3\CMS\Backend\Controller\BackendController\render().

◆ generateJavascript()

◆ generateLocalLang()

TYPO3\CMS\Backend\Controller\BackendController::generateLocalLang ( )
protected

Reads labels required in JavaScript code from the localization system and returns them as JSON array in TYPO3.LLL.

Returns
string JavaScript code containing the LLL labels in TYPO3.LLL

Definition at line 484 of file BackendController.php.

References TYPO3\CMS\Backend\Controller\BackendController\getLanguageService().

Referenced by TYPO3\CMS\Backend\Controller\BackendController\getLocalLangFileName().

◆ generateModuleMenu()

TYPO3\CMS\Backend\Controller\BackendController::generateModuleMenu ( )
protected

loads all modules from the repository and renders it with a template

Returns
string

Definition at line 881 of file BackendController.php.

References TYPO3\CMS\Backend\Controller\BackendController\getFluidTemplateObject().

Referenced by TYPO3\CMS\Backend\Controller\BackendController\getModuleMenu(), and TYPO3\CMS\Backend\Controller\BackendController\render().

◆ getBackendUser()

◆ getDocumentTemplate()

TYPO3\CMS\Backend\Controller\BackendController::getDocumentTemplate ( )
protected

Returns an instance of DocumentTemplate

Returns

Definition at line 946 of file BackendController.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Backend\Controller\BackendController\render().

◆ getFluidTemplateObject()

TYPO3\CMS\Backend\Controller\BackendController::getFluidTemplateObject (   $templatePathAndFileName = null)
protected

returns a new standalone view, shorthand function

Parameters
string$templatePathAndFileNameoptional the path to set the template path and filename
Returns

Definition at line 912 of file BackendController.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\getFileAbsFileName(), and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Backend\Controller\BackendController\generateModuleMenu(), and TYPO3\CMS\Backend\Controller\BackendController\render().

◆ getLanguageService()

TYPO3\CMS\Backend\Controller\BackendController::getLanguageService ( )
protected

◆ getLocalLangFileName()

TYPO3\CMS\Backend\Controller\BackendController::getLocalLangFileName ( )
protected

Returns the file name to the LLL JavaScript, containing the localized labels, which can be used in JavaScript code.

Returns
string File name of the JS file, relative to TYPO3_mainDir
Exceptions

Definition at line 464 of file BackendController.php.

References TYPO3\CMS\Backend\Controller\BackendController\generateLocalLang(), and TYPO3\CMS\Core\Utility\GeneralUtility\writeFileToTypo3tempDir().

Referenced by TYPO3\CMS\Backend\Controller\BackendController\__construct().

◆ getModuleMenu()

TYPO3\CMS\Backend\Controller\BackendController::getModuleMenu ( ServerRequestInterface  $request,
ResponseInterface  $response 
)

Returns the Module menu for the AJAX request

Parameters
ServerRequestInterface$request
ResponseInterface$response
Returns
ResponseInterface

Definition at line 898 of file BackendController.php.

References TYPO3\CMS\Backend\Controller\BackendController\$content, and TYPO3\CMS\Backend\Controller\BackendController\generateModuleMenu().

◆ getPageRenderer()

TYPO3\CMS\Backend\Controller\BackendController::getPageRenderer ( )

◆ handlePageEditing()

◆ includeLegacyBackendItems()

TYPO3\CMS\Backend\Controller\BackendController::includeLegacyBackendItems ( )
protected

Add hooks from the additional backend items to load certain things for the main backend. This was previously called from the global scope from backend.php.

Definition at line 186 of file BackendController.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\GeneralUtility\getFileAbsFileName(), and TYPO3\CMS\Core\Utility\GeneralUtility\removePrefixPathFromList().

Referenced by TYPO3\CMS\Backend\Controller\BackendController\__construct().

◆ initializeToolbarItems()

TYPO3\CMS\Backend\Controller\BackendController::initializeToolbarItems ( )
protected

Initialize toolbar item objects

Exceptions

Definition at line 223 of file BackendController.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Backend\Controller\BackendController\__construct().

◆ loadResourcesForRegisteredNavigationComponents()

◆ mainAction()

TYPO3\CMS\Backend\Controller\BackendController::mainAction ( ServerRequestInterface  $request,
ResponseInterface  $response 
)

Injects the request object for the current request or subrequest As this controller goes only through the render() method, it is rather simple for now

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

Definition at line 261 of file BackendController.php.

References TYPO3\CMS\Backend\Controller\BackendController\render().

◆ render()

◆ setStartupModule()

TYPO3\CMS\Backend\Controller\BackendController::setStartupModule ( )
protected

Sets the startup module from either GETvars module and modParams or user configuration.

Returns
string the JavaScript code for the startup module

Definition at line 734 of file BackendController.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\_GET(), TYPO3\CMS\Backend\Controller\BackendController\getBackendUser(), and TYPO3\CMS\Core\Utility\GeneralUtility\quoteJSvalue().

Referenced by TYPO3\CMS\Backend\Controller\BackendController\generateJavascript().

Member Data Documentation

◆ $backendModuleRepository

TYPO3\CMS\Backend\Controller\BackendController::$backendModuleRepository
protected

Definition at line 84 of file BackendController.php.

◆ $content

TYPO3\CMS\Backend\Controller\BackendController::$content = ''
protected

◆ $css

TYPO3\CMS\Backend\Controller\BackendController::$css = ''
protected

◆ $cssFiles

TYPO3\CMS\Backend\Controller\BackendController::$cssFiles = []
protected

◆ $debug

TYPO3\CMS\Backend\Controller\BackendController::$debug
protected

Definition at line 74 of file BackendController.php.

◆ $js

TYPO3\CMS\Backend\Controller\BackendController::$js = ''
protected

Definition at line 54 of file BackendController.php.

◆ $jsFiles

TYPO3\CMS\Backend\Controller\BackendController::$jsFiles = []
protected

◆ $menuWidth

TYPO3\CMS\Backend\Controller\BackendController::$menuWidth = 190
protected

Definition at line 69 of file BackendController.php.

◆ $moduleLoader

TYPO3\CMS\Backend\Controller\BackendController::$moduleLoader
protected

Definition at line 89 of file BackendController.php.

◆ $pageRenderer

TYPO3\CMS\Backend\Controller\BackendController::$pageRenderer
protected

◆ $templatePath

TYPO3\CMS\Backend\Controller\BackendController::$templatePath = 'EXT:backend/Resources/Private/Templates/'
protected

Definition at line 79 of file BackendController.php.

◆ $toolbarItems

TYPO3\CMS\Backend\Controller\BackendController::$toolbarItems = []
protected

Definition at line 64 of file BackendController.php.