TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Core\ExtDirect\ExtDirectApi Class Reference
Inheritance diagram for TYPO3\CMS\Core\ExtDirect\ExtDirectApi:
t3lib_extjs_ExtDirectApi

Public Member Functions

 __construct ()
 
 getAPI ($ajaxParams, \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj)
 
 getApiPhp (array $filterNamespaces)
 
 getRoutingUrl ($namespace)
 

Protected Member Functions

 generateAPI (array $filterNamespaces)
 
 getExtDirectApi (array $filterNamespaces)
 
 getNamespaceError (array $filterNamespaces)
 
 findNamespace ($namespace, array $filterNamespaces)
 

Protected Attributes

 $settings = array()
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! Ext Direct API Generator

Author
Sebastian Kurfürst sebas.nosp@m.tian.nosp@m.@typo.nosp@m.3.or.nosp@m.g
Stefan Galinski stefa.nosp@m.n.ga.nosp@m.linsk.nosp@m.i@gm.nosp@m.ail.c.nosp@m.om

Definition at line 22 of file ExtDirectApi.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\ExtDirect\ExtDirectApi::__construct ( )

Constructs this object.

Definition at line 32 of file ExtDirectApi.php.

References $GLOBALS.

Member Function Documentation

◆ findNamespace()

TYPO3\CMS\Core\ExtDirect\ExtDirectApi::findNamespace (   $namespace,
array  $filterNamespaces 
)
protected

Looks if the given namespace is present in $filterNamespaces

Parameters
string$namespace
array$filterNamespaces
Returns
boolean

Definition at line 190 of file ExtDirectApi.php.

Referenced by TYPO3\CMS\Core\ExtDirect\ExtDirectApi\generateAPI().

◆ generateAPI()

TYPO3\CMS\Core\ExtDirect\ExtDirectApi::generateAPI ( array  $filterNamespaces)
protected

Generates the API that is configured inside the ExtDirect configuration array "$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect']".

Parameters
array$filerNamespaceNamespace that should be loaded like array('TYPO3.Backend')
Returns
array Javascript API configuration

Definition at line 86 of file ExtDirectApi.php.

References TYPO3\CMS\Core\ExtDirect\ExtDirectApi\findNamespace(), TYPO3\CMS\Core\ExtDirect\ExtDirectApi\getRoutingUrl(), and TYPO3\CMS\Core\Utility\GeneralUtility\getUserObj().

Referenced by TYPO3\CMS\Core\ExtDirect\ExtDirectApi\getExtDirectApi().

◆ getAPI()

TYPO3\CMS\Core\ExtDirect\ExtDirectApi::getAPI (   $ajaxParams,
\TYPO3\CMS\Core\Http\AjaxRequestHandler  $ajaxObj 
)

Parses the ExtDirect configuration array "$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect']" and feeds the given typo3 ajax instance with the resulting information. The get parameter "namespace" will be used to filter the configuration.

This method makes usage of the reflection mechanism to fetch the methods inside the defined classes together with their amount of parameters. This information are building the API and are required by ExtDirect. The result is cached to improve the overall performance.

Parameters
array$ajaxParamsAjax parameters
\TYPO3\CMS\Core\Http\AjaxRequestHandler$ajaxObjAjax object
Returns
void

Definition at line 52 of file ExtDirectApi.php.

◆ getApiPhp()

TYPO3\CMS\Core\ExtDirect\ExtDirectApi::getApiPhp ( array  $filterNamespaces)

Get the API for a given nameapace

Parameters
array$filterNamespaces
Returns
string
Exceptions

Definition at line 63 of file ExtDirectApi.php.

References TYPO3\CMS\Core\ExtDirect\ExtDirectApi\getExtDirectApi(), and TYPO3\CMS\Core\ExtDirect\ExtDirectApi\getNamespaceError().

◆ getExtDirectApi()

TYPO3\CMS\Core\ExtDirect\ExtDirectApi::getExtDirectApi ( array  $filterNamespaces)
protected

Generates the API or reads it from cache

Parameters
array$filterNamespaces
boolean$checkGetParam
Returns
string $javascriptNamespaces

Definition at line 150 of file ExtDirectApi.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\_GET(), TYPO3\CMS\Core\ExtDirect\ExtDirectApi\generateAPI(), TYPO3\CMS\Frontend\Page\PageRepository\storeHash(), and TYPO3_MODE.

Referenced by TYPO3\CMS\Core\ExtDirect\ExtDirectApi\getApiPhp().

◆ getNamespaceError()

TYPO3\CMS\Core\ExtDirect\ExtDirectApi::getNamespaceError ( array  $filterNamespaces)
protected

Generates the error message

Parameters
array$filterNamespaces
Returns
string $errorMessage

Definition at line 172 of file ExtDirectApi.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\ExtDirect\ExtDirectApi\getApiPhp().

◆ getRoutingUrl()

TYPO3\CMS\Core\ExtDirect\ExtDirectApi::getRoutingUrl (   $namespace)

Returns the convenient path for the routing Urls based on the TYPO3 mode.

Parameters
string$namespace
Returns
string

Definition at line 132 of file ExtDirectApi.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\locationHeaderUrl(), and TYPO3_MODE.

Referenced by TYPO3\CMS\Core\ExtDirect\ExtDirectApi\generateAPI().

Member Data Documentation

◆ $settings

TYPO3\CMS\Core\ExtDirect\ExtDirectApi::$settings = array()
protected

Definition at line 27 of file ExtDirectApi.php.