|
TYPO3 API
SVNRelease
|
Public Member Functions | |
| __construct ($ajaxId) | |
| getAjaxID () | |
| setContent ($content) | |
| addContent ($key, $content) | |
| getContent ($key= '') | |
| setContentFormat ($format) | |
| setJavascriptCallbackWrap ($javascriptCallbackWrap) | |
| setError ($errorMsg= '') | |
| isError () | |
| render () | |
Protected Member Functions | |
| renderAsError () | |
| renderAsPlain () | |
| renderAsXML () | |
| renderAsJSON () | |
| renderAsJavascript () | |
Protected Attributes | |
| $ajaxId = null | |
| $errorMessage = null | |
| $isError = false | |
| $content = array() | |
| $contentFormat = 'plain' | |
| $charset = 'utf-8' | |
| $requestCharset = 'utf-8' | |
| $javascriptCallbackWrap | |
Definition at line 36 of file class.typo3ajax.php.
| TYPO3AJAX::__construct | ( | $ | ajaxId | ) |
sets the charset and the ID for the AJAX call due some charset limitations in Javascript (prototype uses encodeURIcomponent, which converts all data to utf-8), we need to detect if the encoding of the request differs from the backend encoding (e.g. forceCharset), and then convert all incoming data (_GET and _POST) in the expected backend encoding.
| string | the AJAX id |
Definition at line 62 of file class.typo3ajax.php.
| TYPO3AJAX::addContent | ( | $ | key, |
| $ | content | ||
| ) |
adds new content
| string | the new content key where the content should be added in the content array |
| string | the new content to add |
Definition at line 119 of file class.typo3ajax.php.
References $content.
Referenced by AjaxLogin\getChallenge(), AjaxLogin\isTimedOut(), AjaxLogin\login(), AjaxLogin\logout(), tx_t3editor_TSrefLoader\processAjaxRequest(), TYPO3_tcefile\processAjaxRequest(), AjaxLogin\refreshLogin(), and AjaxLogin\refreshTokens().
| TYPO3AJAX::getAjaxID | ( | ) |
returns the ID for the AJAX call
Definition at line 91 of file class.typo3ajax.php.
Referenced by tx_t3editor_codecompletion\processAjaxRequest(), and tx_t3editor_TSrefLoader\processAjaxRequest().
| TYPO3AJAX::getContent | ( | $ | key = '' | ) |
returns the content for the ajax call
Definition at line 140 of file class.typo3ajax.php.
| TYPO3AJAX::isError | ( | ) |
checks whether an error occured during the execution or not
Definition at line 186 of file class.typo3ajax.php.
Referenced by render(), and setError().
| TYPO3AJAX::render | ( | ) |
renders the AJAX call based on the $contentFormat variable and exits the request
Definition at line 196 of file class.typo3ajax.php.
References isError(), renderAsError(), renderAsJavascript(), renderAsJSON(), renderAsPlain(), and renderAsXML().
| TYPO3AJAX::renderAsError | ( | ) | [protected] |
renders the AJAX call in XML error style to handle with JS the "responseXML" of the transport object will be filled with the error message then
Definition at line 226 of file class.typo3ajax.php.
References t3lib_utility_Http\HTTP_STATUS_500.
Referenced by render().
| TYPO3AJAX::renderAsJavascript | ( | ) | [protected] |
Renders the AJAX call as inline JSON inside a script tag. This is useful when an iframe is used as the AJAX transport.
Definition at line 296 of file class.typo3ajax.php.
References $content, and $GLOBALS.
Referenced by render().
| TYPO3AJAX::renderAsJSON | ( | ) | [protected] |
renders the AJAX call with JSON evaluated headers note that you need to have requestHeaders: {Accept: 'application/json'}, in your AJAX options of your AJAX request object in JS
the content will be available
Definition at line 272 of file class.typo3ajax.php.
References $content, and $GLOBALS.
Referenced by render().
| TYPO3AJAX::renderAsPlain | ( | ) | [protected] |
renders the AJAX call with text/html headers the content will be available in the "responseText" value of the transport object
Definition at line 240 of file class.typo3ajax.php.
Referenced by render().
| TYPO3AJAX::renderAsXML | ( | ) | [protected] |
renders the AJAX call with text/xml headers the content will be available in the "responseXML" value of the transport object
Definition at line 253 of file class.typo3ajax.php.
Referenced by render().
| TYPO3AJAX::setContent | ( | $ | content | ) |
overwrites the existing content with the first parameter
| array | the new content |
Definition at line 102 of file class.typo3ajax.php.
References $content.
Referenced by t3lib_extjs_ExtDirectApi\getAPI(), tx_t3editor\getPlugins(), tx_t3editor_codecompletion\processAjaxRequest(), tx_t3editor_TSrefLoader\processAjaxRequest(), and t3lib_extjs_ExtDirectRouter\route().
| TYPO3AJAX::setContentFormat | ( | $ | format | ) |
sets the content format for the ajax call
| string | can be one of 'plain' (default), 'xml', 'json', 'javascript', 'jsonbody' or 'jsonhead' |
Definition at line 151 of file class.typo3ajax.php.
References t3lib_div\inArray().
Referenced by AjaxLogin\getChallenge(), tx_t3editor\getPlugins(), AjaxLogin\isTimedOut(), AjaxLogin\login(), AjaxLogin\logout(), tx_t3editor_codecompletion\processAjaxRequest(), tx_t3editor_TSrefLoader\processAjaxRequest(), TYPO3_tcefile\processAjaxRequest(), AjaxLogin\refreshLogin(), AjaxLogin\refreshTokens(), and t3lib_extjs_ExtDirectRouter\route().
| TYPO3AJAX::setError | ( | $ | errorMsg = '' | ) |
sets an error message and the error flag
| string | the error message |
Definition at line 175 of file class.typo3ajax.php.
References isError().
Referenced by TYPO3_tcefile\processAjaxRequest().
| TYPO3AJAX::setJavascriptCallbackWrap | ( | $ | javascriptCallbackWrap | ) |
Specifies the wrap to be used if contentFormat is "javascript". The wrap used by default stores the results in a variable "response" and adds <script>-Tags around it.
| string | $javascriptCallbackWrap | the javascript callback wrap to be used |
Definition at line 165 of file class.typo3ajax.php.
References $javascriptCallbackWrap.
TYPO3AJAX::$ajaxId = null [protected] |
Definition at line 37 of file class.typo3ajax.php.
Referenced by __construct().
TYPO3AJAX::$charset = 'utf-8' [protected] |
Definition at line 42 of file class.typo3ajax.php.
Referenced by __construct().
TYPO3AJAX::$content = array() [protected] |
Definition at line 40 of file class.typo3ajax.php.
Referenced by addContent(), renderAsJavascript(), renderAsJSON(), and setContent().
TYPO3AJAX::$contentFormat = 'plain' [protected] |
Definition at line 41 of file class.typo3ajax.php.
TYPO3AJAX::$errorMessage = null [protected] |
Definition at line 38 of file class.typo3ajax.php.
TYPO3AJAX::$isError = false [protected] |
Definition at line 39 of file class.typo3ajax.php.
TYPO3AJAX::$javascriptCallbackWrap [protected] |
' <script type="text/javascript"> /*<![CDATA[*/ response = |; /*]]>*/ </script> '
Definition at line 44 of file class.typo3ajax.php.
Referenced by setJavascriptCallbackWrap().
TYPO3AJAX::$requestCharset = 'utf-8' [protected] |
Definition at line 43 of file class.typo3ajax.php.
1.7.5.1