/** * General processor for AJAX requests. * (called by typo3/ajax.php) * * @param array $params Additional parameters (not used here) * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler &$ajaxObj The AjaxRequestHandler object of this request * @return void * @author Oliver Hader <*****@*****.**> */ public function processAjaxRequest($params, \TYPO3\CMS\Core\Http\AjaxRequestHandler &$ajaxObj) { $this->ajaxObj = $ajaxObj; $ajaxIdParts = explode('::', $ajaxObj->getAjaxID(), 2); $ajaxMethod = $ajaxIdParts[1]; $response = array(); // Process the AJAX requests: if ($ajaxMethod == 'loadTemplates') { $ajaxObj->setContent($this->loadTemplates((int) \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('pageId'))); $ajaxObj->setContentFormat('jsonbody'); } }
/** * General processor for AJAX requests. * (called by typo3/ajax.php) * * @param array $params Additional parameters (not used here) * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler &$ajaxObj The AjaxRequestHandler object of this request * @return void * @author Oliver Hader <*****@*****.**> */ public function processAjaxRequest($params, \TYPO3\CMS\Core\Http\AjaxRequestHandler &$ajaxObj) { $this->ajaxObj = $ajaxObj; // Load the TSref XML information: $this->loadFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('t3editor') . 'res/tsref/tsref.xml'); $ajaxIdParts = explode('::', $ajaxObj->getAjaxID(), 2); $ajaxMethod = $ajaxIdParts[1]; $response = array(); // Process the AJAX requests: if ($ajaxMethod == 'getTypes') { $ajaxObj->setContent($this->getTypes()); $ajaxObj->setContentFormat('jsonbody'); } elseif ($ajaxMethod == 'getDescription') { $ajaxObj->addContent('', $this->getDescription(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('typeId'), \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('parameterName'))); $ajaxObj->setContentFormat('plain'); } }