TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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=array())
 
 generateModuleMenu ()
 
 getFluidTemplateObject ($templatePathAndFileName=null)
 
 getLanguageService ()
 
 getBackendUser ()
 
 getDocumentTemplate ()
 

Protected Attributes

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

Detailed Description

Class for rendering the TYPO3 backend

Definition at line 33 of file BackendController.php.

Constructor & Destructor Documentation

__construct ( )

Member Function Documentation

addCss (   $css)

Adds a css snippet to the backend

Parameters
string$cssCss snippet
Returns
void
Exceptions
\InvalidArgumentException

Definition at line 808 of file BackendController.php.

References BackendController\$css.

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 823 of file BackendController.php.

addJavascript (   $javascript)

Adds a javascript snippet to the backend

Parameters
string$javascriptJavascript snippet
Returns
void
Exceptions
\InvalidArgumentException

Definition at line 775 of file BackendController.php.

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 790 of file BackendController.php.

References GeneralUtility\resolveBackPath().

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
\UnexpectedValueException
Deprecated:
since TYPO3 CMS 7, will be removed in TYPO3 CMS 8. Toolbar items are registered in $GLOBALS['TYPO3_CONF_VARS']['BE']['toolbarItems'] now.

Definition at line 842 of file BackendController.php.

References GeneralUtility\logDeprecatedFunction().

executeHook (   $identifier,
array  $hookConfiguration = array() 
)
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 859 of file BackendController.php.

References $GLOBALS, and GeneralUtility\callUserFunction().

Referenced by BackendController\__construct(), and BackendController\render().

generateJavascript ( )
protected
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 477 of file BackendController.php.

References $lang, BackendController\getBackendUser(), and BackendController\getLanguageService().

Referenced by BackendController\getLocalLangFileName().

generateModuleMenu ( )
protected

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

Returns
string

Definition at line 875 of file BackendController.php.

References BackendController\getFluidTemplateObject().

Referenced by BackendController\getModuleMenu(), and BackendController\render().

getBackendUser ( )
protected
getDocumentTemplate ( )
protected

Returns an instance of DocumentTemplate

Returns

Definition at line 940 of file BackendController.php.

References $GLOBALS.

Referenced by BackendController\render().

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 906 of file BackendController.php.

References GeneralUtility\getFileAbsFileName(), and GeneralUtility\makeInstance().

Referenced by BackendController\generateModuleMenu(), and BackendController\render().

getLanguageService ( )
protected

Returns LanguageService

Returns

Definition at line 920 of file BackendController.php.

References $GLOBALS.

Referenced by BackendController\__construct(), BackendController\generateLocalLang(), and BackendController\handlePageEditing().

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
\RuntimeException

Definition at line 457 of file BackendController.php.

References BackendController\generateLocalLang(), and GeneralUtility\writeFileToTypo3tempDir().

Referenced by BackendController\__construct().

getModuleMenu ( ServerRequestInterface  $request,
ResponseInterface  $response 
)

Returns the Module menu for the AJAX request

Parameters
ServerRequestInterface$request
ResponseInterface$response
Returns
ResponseInterface

Definition at line 892 of file BackendController.php.

References BackendController\$content, $response, BackendController\generateModuleMenu(), and MessageInterface\getBody().

getPageRenderer ( )
Returns
PageRenderer
Deprecated:
since TYPO3 CMS 7, will be removed in TYPO3 CMS 8

Definition at line 99 of file BackendController.php.

References BackendController\$pageRenderer, and GeneralUtility\logDeprecatedFunction().

handlePageEditing ( )
protected
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 182 of file BackendController.php.

References $GLOBALS, and GeneralUtility\getFileAbsFileName().

Referenced by BackendController\__construct().

initializeToolbarItems ( )
protected

Initialize toolbar item objects

Exceptions
\RuntimeException
Returns
void

Definition at line 219 of file BackendController.php.

References $GLOBALS, and GeneralUtility\makeInstance().

Referenced by BackendController\__construct().

loadResourcesForRegisteredNavigationComponents ( )
protected
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 257 of file BackendController.php.

References $response, MessageInterface\getBody(), and BackendController\render().

render ( )
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 728 of file BackendController.php.

References GeneralUtility\_GET(), elseif, BackendController\getBackendUser(), and GeneralUtility\quoteJSvalue().

Referenced by BackendController\generateJavascript().

Member Data Documentation

$backendModuleRepository
protected

Definition at line 83 of file BackendController.php.

$content = ''
protected

Definition at line 38 of file BackendController.php.

Referenced by BackendController\getModuleMenu().

$css = ''
protected

Definition at line 43 of file BackendController.php.

Referenced by BackendController\addCss().

$cssFiles = array()
protected
$debug
protected

Definition at line 73 of file BackendController.php.

$js = ''
protected

Definition at line 53 of file BackendController.php.

$jsFiles = array()
protected
$menuWidth = 190
protected

Definition at line 68 of file BackendController.php.

$moduleLoader
protected

Definition at line 88 of file BackendController.php.

$pageRenderer
protected

Definition at line 93 of file BackendController.php.

Referenced by BackendController\getPageRenderer().

$templatePath = 'EXT:backend/Resources/Private/Templates/'
protected

Definition at line 78 of file BackendController.php.

$toolbarItems = array()
protected

Definition at line 63 of file BackendController.php.