php TYPO3-CMS-Core-Http-AjaxRequestHandler类(方法)实例源码

下面列出了php TYPO3-CMS-Core-Http-AjaxRequestHandler 类(方法)源码代码实例,从而了解它的用法。

作者:beechi    项目:tag_item   
/**
  * Create a tag
  *
  * @param array $params
  * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj
  * @return void
  * @throws \Exception
  */
 public function createTag(array $params, \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj)
 {
     $request = GeneralUtility::_POST();
     try {
         // Check if a tag is submitted
         if (!isset($request['item']) || empty($request['item'])) {
             throw new \Exception('error_no-tag');
         }
         $itemUid = $request['uid'];
         if ((int) $itemUid === 0 && (strlen($itemUid) == 16 && !GeneralUtility::isFirstPartOfStr($itemUid, 'NEW'))) {
             throw new \Exception('error_no-uid');
         }
         $table = $request['table'];
         if (empty($table)) {
             throw new \Exception('error_no-table');
         }
         // Get tag uid
         $newTagId = $this->getTagUid($request);
         $ajaxObj->setContentFormat('javascript');
         $ajaxObj->setContent('');
         $response = array($newTagId, $request['item'], self::TAG, $table, 'tags', 'data[' . htmlspecialchars($table) . '][' . $itemUid . '][tags]', $itemUid);
         $ajaxObj->setJavascriptCallbackWrap(implode('-', $response));
     } catch (\Exception $e) {
         $errorMsg = $GLOBALS['LANG']->sL(self::LLPATH . $e->getMessage());
         $ajaxObj->setError($errorMsg);
     }
 }

作者:plan2ne    项目:TYPO3.CM   
/**
  * Sets the TYPO3 Backend context to a certain workspace,
  * called by the Backend toolbar menu
  *
  * @param array $parameters
  * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxRequestHandler
  * @return void
  */
 public function setWorkspace($parameters, \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxRequestHandler)
 {
     $workspaceId = (int) GeneralUtility::_GP('workspaceId');
     $pageId = (int) GeneralUtility::_GP('pageId');
     $finalPageUid = 0;
     $originalPageId = $pageId;
     $this->getBackendUser()->setWorkspace($workspaceId);
     while ($pageId) {
         $page = BackendUtility::getRecordWSOL('pages', $pageId, '*', ' AND pages.t3ver_wsid IN (0, ' . $workspaceId . ')');
         if ($page) {
             if ($this->getBackendUser()->doesUserHaveAccess($page, 1)) {
                 break;
             }
         } else {
             $page = BackendUtility::getRecord('pages', $pageId);
         }
         $pageId = $page['pid'];
     }
     if (isset($page['uid'])) {
         $finalPageUid = (int) $page['uid'];
     }
     $response = array('title' => \TYPO3\CMS\Workspaces\Service\WorkspaceService::getWorkspaceTitle($workspaceId), 'workspaceId' => $workspaceId, 'pageId' => $finalPageUid && $originalPageId == $finalPageUid ? NULL : $finalPageUid);
     $ajaxRequestHandler->setContent($response);
     $ajaxRequestHandler->setContentFormat('json');
 }

作者:plan2ne    项目:TYPO3.CM   
/**
  * Processes all AJAX calls and returns a JSON for the data
  *
  * @param array $parameters
  * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxRequestHandler
  */
 public function processAjaxRequest($parameters, AjaxRequestHandler $ajaxRequestHandler)
 {
     // do the regular / main logic, depending on the action parameter
     $action = GeneralUtility::_GP('action');
     $key = GeneralUtility::_GP('key');
     $value = GeneralUtility::_GP('value');
     $content = $this->process($action, $key, $value);
     $ajaxRequestHandler->setContentFormat('json');
     $ajaxRequestHandler->setContent($content);
 }

作者:plan2ne    项目:TYPO3.CM   
/**
  * The main dispatcher function. Collect data and prepare HTML output.
  *
  * @param array $params array of parameters, currently unused
  * @param AjaxRequestHandler $ajaxObj object of type AjaxRequestHandler
  * @return void
  */
 public function dispatch($params = array(), AjaxRequestHandler $ajaxObj = NULL)
 {
     $params = GeneralUtility::_GP('params');
     if ($params['action'] === 'getContextHelp') {
         $result = $this->getContextHelp($params['table'], $params['field']);
         $ajaxObj->addContent('title', $result['title']);
         $ajaxObj->addContent('content', $result['description']);
         $ajaxObj->addContent('link', $result['moreInfo']);
         $ajaxObj->setContentFormat('json');
     }
 }

作者:TrueTyp    项目:phpuni   
/**
  * Used to broker incoming requests to other calls.
  * Called by typo3/ajax.php
  *
  * @param array $unused additional parameters (not used)
  * @param AjaxRequestHandler $ajax the AJAX object for this request
  *
  * @return void
  */
 public function ajaxBroker(array $unused, AjaxRequestHandler $ajax)
 {
     $state = (bool) GeneralUtility::_POST('state');
     $checkbox = GeneralUtility::_POST('checkbox');
     if (in_array($checkbox, $this->validCheckboxKeys, true)) {
         $ajax->setContentFormat('json');
         $this->userSettingsService->set($checkbox, $state);
         $ajax->addContent('success', true);
     } else {
         $ajax->setContentFormat('plain');
         $ajax->setError('Illegal input parameters.');
     }
 }

作者:TrueTyp    项目:caretake   
/**
  * @param array $params
  * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj
  */
 public function ajaxLoadTree($params, &$ajaxObj)
 {
     $node_id = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('node');
     if ($node_id == 'root') {
         $node_repository = tx_caretaker_NodeRepository::getInstance();
         $node = $node_repository->getRootNode(true);
         $result = $this->nodeToArray($node, 2);
     } else {
         $node_repository = tx_caretaker_NodeRepository::getInstance();
         $node = $node_repository->id2node($node_id, 1);
         $result = $this->nodeToArray($node);
     }
     $ajaxObj->setContent($result['children']);
     $ajaxObj->setContentFormat('jsonbody');
 }

作者:plan2ne    项目:TYPO3.CM   
/**
  * Gets RSA Public Key.
  *
  * @param array $parameters Parameters (not used)
  * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $parent The calling parent AJAX object
  * @return void
  */
 public function getRsaPublicKey(array $parameters, \TYPO3\CMS\Core\Http\AjaxRequestHandler $parent)
 {
     $backend = BackendFactory::getBackend();
     if ($backend !== NULL) {
         $keyPair = $backend->createNewKeyPair();
         $storage = \TYPO3\CMS\Rsaauth\Storage\StorageFactory::getStorage();
         $storage->put($keyPair->getPrivateKey());
         session_commit();
         $parent->addContent('publicKeyModulus', $keyPair->getPublicKeyModulus());
         $parent->addContent('exponent', sprintf('%x', $keyPair->getExponent()));
         $parent->setContentFormat('json');
     } else {
         $parent->setError('No OpenSSL backend could be obtained for rsaauth.');
     }
 }

作者:khanhdeu    项目:typo3tes   
/**
  * ModuleMenu Store loading data
  *
  * @param array $params
  * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj
  * @return array
  */
 public function getModuleData($params, $ajaxObj)
 {
     $data = array('success' => TRUE, 'root' => array());
     $rawModuleData = $this->getRawModuleData();
     $index = 0;
     foreach ($rawModuleData as $moduleKey => $moduleData) {
         $key = substr($moduleKey, 8);
         $num = count($data['root']);
         if ($moduleData['link'] != 'dummy.php' || $moduleData['link'] == 'dummy.php' && is_array($moduleData['subitems'])) {
             $data['root'][$num]['key'] = $key;
             $data['root'][$num]['menuState'] = $GLOBALS['BE_USER']->uc['moduleData']['menuState'][$moduleKey];
             $data['root'][$num]['label'] = $moduleData['title'];
             $data['root'][$num]['subitems'] = is_array($moduleData['subitems']) ? count($moduleData['subitems']) : 0;
             if ($moduleData['link'] && $this->linkModules) {
                 $data['root'][$num]['link'] = 'top.goToModule(\'' . $moduleData['name'] . '\')';
             }
             // Traverse submodules
             if (is_array($moduleData['subitems'])) {
                 foreach ($moduleData['subitems'] as $subKey => $subData) {
                     $data['root'][$num]['sub'][] = array('name' => $subData['name'], 'description' => $subData['description'], 'label' => $subData['title'], 'icon' => $subData['icon']['filename'], 'navframe' => $subData['parentNavigationFrameScript'], 'link' => $subData['link'], 'originalLink' => $subData['originalLink'], 'index' => $index++, 'navigationFrameScript' => $subData['navigationFrameScript'], 'navigationFrameScriptParam' => $subData['navigationFrameScriptParam'], 'navigationComponentId' => $subData['navigationComponentId']);
                 }
             }
         }
     }
     if ($ajaxObj) {
         $ajaxObj->setContent($data);
         $ajaxObj->setContentFormat('jsonbody');
     } else {
         return $data;
     }
 }

作者:clickstor    项目:cs_se   
/**
  * make the ajax update
  *
  * @param array $params Array of parameters from the AJAX interface, currently unused
  * @param AjaxRequestHandler $ajaxObj Object of type AjaxRequestHandler
  * @return void
  */
 public function ajaxUpdate($params = array(), AjaxRequestHandler &$ajaxObj = NULL)
 {
     $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class);
     $this->evaluationRepository = $this->objectManager->get(EvaluationRepository::class);
     $this->persistenceManager = $this->objectManager->get(PersistenceManager::class);
     // get parameter
     if (empty($params)) {
         $uid = $GLOBALS['GLOBALS']['HTTP_POST_VARS']['uid'];
     } else {
         $attr = $params['request']->getParsedBody();
         $uid = $attr['uid'];
     }
     $this->processResults($uid);
     $ajaxObj->addContent('uid', $uid);
 }

作者:khanhdeu    项目:typo3tes   
/**
  * @test
  */
 public function processAjaxRequestUploadProcess()
 {
     $this->fileController = $this->getAccessibleMock('TYPO3\\CMS\\Backend\\Controller\\File\\FileController', array('init', 'main'));
     $this->mockAjaxRequestHandler = $this->getMock('TYPO3\\CMS\\Core\\Http\\AjaxRequestHandler', array('addContent', 'setContentFormat'), array(), '', FALSE);
     $fileData = array('upload' => array(array($this->fileResourceMock)));
     $result = array('upload' => array(array('id' => 'foo', 'date' => '29-11-73', 'iconClasses' => 't3-icon t3-icon-mimetypes t3-icon-mimetypes-text t3-icon-text-html')));
     $this->fileController->_set('fileProcessor', $this->mockFileProcessor);
     $this->fileController->_set('fileData', $fileData);
     $this->fileController->_set('redirect', FALSE);
     $this->fileController->expects($this->once())->method('init');
     $this->fileController->expects($this->once())->method('main');
     $this->mockAjaxRequestHandler->expects($this->once())->method('addContent')->with('result', $result);
     $this->mockAjaxRequestHandler->expects($this->once())->method('setContentFormat')->with('json');
     $this->fileController->processAjaxRequest(array(), $this->mockAjaxRequestHandler);
 }

作者:raimundlandi    项目:winkel.de-DE   
/**
  * get list rows
  *
  * @param    AjaxRequestHandler $ajaxObj the parent ajax object
  *
  * @return    void
  */
 public function getListRows(AjaxRequestHandler &$ajaxObj)
 {
     $uid = (int) $this->getParamValue('uid');
     if ($uid > 0) {
         $table = (string) $this->getParamValue('table');
         $table = $table ? $table : 'tt_content';
         $level = (int) $this->getParamValue('level');
         $this->initializeTemplateContainer();
         $elementChildren = Helper::getInstance()->getChildren($table, $uid, GeneralUtility::_GP('sortField'), (int) GeneralUtility::_GP('sortRev'));
         $row = BackendUtility::getRecord($table, $uid);
         $recordList = $this->getRecordList($table, $uid, $row);
         if ($recordList instanceof DatabaseRecordList) {
             $level++;
             foreach ($elementChildren as $elementChild) {
                 $listRows[] = $recordList->renderListRow($elementChild->getTable(), BackendUtility::getRecord($elementChild->getTable(), $elementChild->getId()), 0, $GLOBALS['TCA'][$table]['ctrl']['label'], $GLOBALS['TCA'][$table]['ctrl']['thumbnail'], 1, $level);
             }
         }
         $ajaxObj->addContent('list', $listRows);
     }
 }

作者:adroll    项目:TYPO3.CM   
/**
  * Gets called when a shortcut is changed, checks whether the user has
  * permissions to do so and saves the changes if everything is ok
  *
  * @param array $params Array of parameters from the AJAX interface, currently unused
  * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj Object of type AjaxRequestHandler
  * @return void
  */
 public function setAjaxShortcut($params = array(), AjaxRequestHandler $ajaxObj = NULL)
 {
     $databaseConnection = $this->getDatabaseConnection();
     $backendUser = $this->getBackendUser();
     $shortcutId = (int) GeneralUtility::_POST('shortcutId');
     $shortcutName = strip_tags(GeneralUtility::_POST('shortcutTitle'));
     $shortcutGroupId = (int) GeneralUtility::_POST('shortcutGroup');
     if ($shortcutGroupId > 0 || $backendUser->isAdmin()) {
         // Users can delete only their own shortcuts (except admins)
         $addUserWhere = !$backendUser->isAdmin() ? ' AND userid=' . (int) $backendUser->user['uid'] : '';
         $fieldValues = array('description' => $shortcutName, 'sc_group' => $shortcutGroupId);
         if ($fieldValues['sc_group'] < 0 && !$backendUser->isAdmin()) {
             $fieldValues['sc_group'] = 0;
         }
         $databaseConnection->exec_UPDATEquery('sys_be_shortcuts', 'uid=' . $shortcutId . $addUserWhere, $fieldValues);
         $affectedRows = $databaseConnection->sql_affected_rows();
         if ($affectedRows == 1) {
             $ajaxObj->addContent('shortcut', $shortcutName);
         } else {
             $ajaxObj->addContent('shortcut', 'failed');
         }
     }
     $ajaxObj->setContentFormat('plain');
 }

作者:noxlud    项目:TYPO3v4-Cor   
/**
  * Handles the actual process from within the ajaxExec function
  * therefore, it does exactly the same as the real typo3/tce_file.php
  * but without calling the "finish" method, thus makes it simpler to deal with the
  * actual return value
  *
  * @param array $params Always empty.
  * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj The Ajax object used to return content and set content types
  * @return void
  */
 public function processAjaxRequest(array $params, \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj)
 {
     $this->init();
     $this->main();
     $errors = $this->fileProcessor->getErrorMessages();
     if (count($errors)) {
         $ajaxObj->setError(implode(',', $errors));
     } else {
         $ajaxObj->addContent('result', $this->fileData);
         if ($this->redirect) {
             $ajaxObj->addContent('redirect', $this->redirect);
         }
         $ajaxObj->setContentFormat('json');
     }
 }

作者:Andreas    项目:commerc   
/**
  * Makes the AJAX call to expand or collapse the categorytree.
  * Called by typo3/ajax.php
  *
  * @param array $params Additional parameters (not used here)
  * @param AjaxRequestHandler $ajaxObj Ajax object
  *
  * @return void
  */
 public function ajaxExpandCollapseWithoutProduct(array $params, AjaxRequestHandler &$ajaxObj)
 {
     $parameter = $this->getParameter();
     // Get the category tree without the products and the articles
     $this->init(TRUE);
     $tree = $this->categoryTree->getBrowseableAjaxTree($parameter);
     $ajaxObj->addContent('tree', $tree);
 }

作者:khanhdeu    项目:typo3tes   
/**
  * The main dispatcher function. Collect data and prepare HTML output.
  *
  * @param array $params array of parameters from the AJAX interface, currently unused
  * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj object of type AjaxRequestHandler
  * @return void
  */
 public function dispatch($params = array(), \TYPO3\CMS\Core\Http\AjaxRequestHandler &$ajaxObj = NULL)
 {
     $content = '';
     // Basic test for required value
     if ($this->conf['page'] > 0) {
         // Init TCE for execution of update
         /** @var $tce \TYPO3\CMS\Core\DataHandling\DataHandler */
         $tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\DataHandling\\DataHandler');
         $tce->stripslashes_values = 1;
         // Determine the scripts to execute
         switch ($this->conf['action']) {
             case 'show_change_owner_selector':
                 $content = $this->renderUserSelector($this->conf['page'], $this->conf['ownerUid'], $this->conf['username']);
                 break;
             case 'change_owner':
                 if (is_int($this->conf['new_owner_uid'])) {
                     // Prepare data to change
                     $data = array();
                     $data['pages'][$this->conf['page']]['perms_userid'] = $this->conf['new_owner_uid'];
                     // Execute TCE Update
                     $tce->start($data, array());
                     $tce->process_datamap();
                     $content = self::renderOwnername($this->conf['page'], $this->conf['new_owner_uid'], $this->conf['new_owner_username']);
                 } else {
                     $ajaxObj->setError('An error occurred: No page owner uid specified.');
                 }
                 break;
             case 'show_change_group_selector':
                 $content = $this->renderGroupSelector($this->conf['page'], $this->conf['groupUid'], $this->conf['groupname']);
                 break;
             case 'change_group':
                 if (is_int($this->conf['new_group_uid'])) {
                     // Prepare data to change
                     $data = array();
                     $data['pages'][$this->conf['page']]['perms_groupid'] = $this->conf['new_group_uid'];
                     // Execute TCE Update
                     $tce->start($data, array());
                     $tce->process_datamap();
                     $content = self::renderGroupname($this->conf['page'], $this->conf['new_group_uid'], $this->conf['new_group_username']);
                 } else {
                     $ajaxObj->setError('An error occurred: No page group uid specified.');
                 }
                 break;
             case 'toggle_edit_lock':
                 // Prepare data to change
                 $data = array();
                 $data['pages'][$this->conf['page']]['editlock'] = $this->conf['editLockState'] === 1 ? 0 : 1;
                 // Execute TCE Update
                 $tce->start($data, array());
                 $tce->process_datamap();
                 $content = $this->renderToggleEditLock($this->conf['page'], $data['pages'][$this->conf['page']]['editlock']);
                 break;
             default:
                 if ($this->conf['mode'] == 'delete') {
                     $this->conf['permissions'] = (int) ($this->conf['permissions'] - $this->conf['bits']);
                 } else {
                     $this->conf['permissions'] = (int) ($this->conf['permissions'] + $this->conf['bits']);
                 }
                 // Prepare data to change
                 $data = array();
                 $data['pages'][$this->conf['page']]['perms_' . $this->conf['who']] = $this->conf['permissions'];
                 // Execute TCE Update
                 $tce->start($data, array());
                 $tce->process_datamap();
                 $content = self::renderPermissions($this->conf['permissions'], $this->conf['page'], $this->conf['who']);
         }
     } else {
         $ajaxObj->setError('This script cannot be called directly.');
     }
     $ajaxObj->addContent($this->conf['page'] . '_' . $this->conf['who'], $content);
 }

作者:plan2ne    项目:TYPO3.CM   
/**
  * Ajax handler for the "suggest" feature in TCEforms.
  *
  * @param array $params The parameters from the AJAX call
  * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj The AJAX object representing the AJAX call
  * @return void
  */
 public function processAjaxRequest($params, &$ajaxObj)
 {
     // Get parameters from $_GET/$_POST
     $search = GeneralUtility::_GP('value');
     $table = GeneralUtility::_GP('table');
     $field = GeneralUtility::_GP('field');
     $uid = GeneralUtility::_GP('uid');
     $pageId = GeneralUtility::_GP('pid');
     $newRecordRow = GeneralUtility::_GP('newRecordRow');
     // If the $uid is numeric, we have an already existing element, so get the
     // TSconfig of the page itself or the element container (for non-page elements)
     // otherwise it's a new element, so use given id of parent page (i.e., don't modify it here)
     $row = NULL;
     if (is_numeric($uid)) {
         $row = BackendUtility::getRecord($table, $uid);
         if ($table == 'pages') {
             $pageId = $uid;
         } else {
             $pageId = $row['pid'];
         }
     } else {
         $row = unserialize($newRecordRow);
     }
     $TSconfig = BackendUtility::getPagesTSconfig($pageId);
     $queryTables = array();
     $foreign_table_where = '';
     $fieldConfig = $GLOBALS['TCA'][$table]['columns'][$field]['config'];
     $parts = explode('|', $field);
     if ($GLOBALS['TCA'][$table]['columns'][$parts[0]]['config']['type'] === 'flex') {
         $flexfieldTCAConfig = $GLOBALS['TCA'][$table]['columns'][$parts[0]]['config'];
         $flexformDSArray = BackendUtility::getFlexFormDS($flexfieldTCAConfig, $row, $table, $parts[0]);
         $flexformDSArray = GeneralUtility::resolveAllSheetsInDS($flexformDSArray);
         $flexformElement = $parts[count($parts) - 2];
         $continue = TRUE;
         foreach ($flexformDSArray as $sheet) {
             foreach ($sheet as $dataStructure) {
                 $fieldConfig = $this->getNestedDsFieldConfig($dataStructure, $flexformElement);
                 if (!empty($fieldConfig)) {
                     $continue = FALSE;
                     break;
                 }
             }
             if (!$continue) {
                 break;
             }
         }
         $field = str_replace('|', '][', $field);
     }
     $wizardConfig = $fieldConfig['wizards']['suggest'];
     if (isset($fieldConfig['allowed'])) {
         if ($fieldConfig['allowed'] === '*') {
             foreach ($GLOBALS['TCA'] as $tableName => $tableConfig) {
                 // @todo Refactor function to BackendUtility
                 if (empty($tableConfig['ctrl']['hideTable']) && ($GLOBALS['BE_USER']->isAdmin() || empty($tableConfig['ctrl']['adminOnly']) && (empty($tableConfig['ctrl']['rootLevel']) || !empty($tableConfig['ctrl']['security']['ignoreRootLevelRestriction'])))) {
                     $queryTables[] = $tableName;
                 }
             }
             unset($tableName, $tableConfig);
         } else {
             $queryTables = GeneralUtility::trimExplode(',', $fieldConfig['allowed']);
         }
     } elseif (isset($fieldConfig['foreign_table'])) {
         $queryTables = array($fieldConfig['foreign_table']);
         $foreign_table_where = $fieldConfig['foreign_table_where'];
         // strip ORDER BY clause
         $foreign_table_where = trim(preg_replace('/ORDER[[:space:]]+BY.*/i', '', $foreign_table_where));
     }
     $resultRows = array();
     // fetch the records for each query table. A query table is a table from which records are allowed to
     // be added to the TCEForm selector, originally fetched from the "allowed" config option in the TCA
     foreach ($queryTables as $queryTable) {
         // if the table does not exist, skip it
         if (!is_array($GLOBALS['TCA'][$queryTable]) || empty($GLOBALS['TCA'][$queryTable])) {
             continue;
         }
         $config = (array) $wizardConfig['default'];
         if (is_array($wizardConfig[$queryTable])) {
             \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($config, $wizardConfig[$queryTable]);
         }
         // merge the configurations of different "levels" to get the working configuration for this table and
         // field (i.e., go from the most general to the most special configuration)
         if (is_array($TSconfig['TCEFORM.']['suggest.']['default.'])) {
             \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($config, $TSconfig['TCEFORM.']['suggest.']['default.']);
         }
         if (is_array($TSconfig['TCEFORM.']['suggest.'][$queryTable . '.'])) {
             \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($config, $TSconfig['TCEFORM.']['suggest.'][$queryTable . '.']);
         }
         // use $table instead of $queryTable here because we overlay a config
         // for the input-field here, not for the queried table
         if (is_array($TSconfig['TCEFORM.'][$table . '.'][$field . '.']['suggest.']['default.'])) {
             \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($config, $TSconfig['TCEFORM.'][$table . '.'][$field . '.']['suggest.']['default.']);
         }
         if (is_array($TSconfig['TCEFORM.'][$table . '.'][$field . '.']['suggest.'][$queryTable . '.'])) {
//.........这里部分代码省略.........

作者:Andreas    项目:commerc   
/**
  * Makes the AJAX call to expand or collapse the categorytree.
  * Called by typo3/ajax.php
  *
  * @param array $params Additional parameters (not used here)
  * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj Ajax object
  *
  * @return void
  */
 public function ajaxExpandCollapse(array $params, \TYPO3\CMS\Core\Http\AjaxRequestHandler &$ajaxObj)
 {
     $parameter = GeneralUtility::_GP('PM');
     // IE takes anchor as parameter
     if (($parameterPosition = strpos($parameter, '#')) !== FALSE) {
         $parameter = substr($parameter, 0, $parameterPosition);
     }
     $parameter = GeneralUtility::trimExplode('_', $parameter);
     // Load the tree
     $this->initTree();
     $tree = $this->treeObj->getBrowseableAjaxTree($parameter);
     $ajaxObj->addContent('tree', $tree);
 }

作者:maab12    项目:default   
/**
  * Ajax callback that reads the smd file and modiefies the target URL to include
  * the module token.
  *
  * @param array $parameters (unused)
  * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxRequestHandler
  * @return void
  */
 public function getWiringEditorSmd(array $parameters, AjaxRequestHandler $ajaxRequestHandler)
 {
     $smdJsonString = file_get_contents(ExtensionManagementUtility::extPath('extension_builder') . 'Resources/Public/jsDomainModeling/phpBackend/WiringEditor.smd');
     $smdJson = json_decode($smdJsonString);
     $parameters = array('tx_extensionbuilder_tools_extensionbuilderextensionbuilder' => array('controller' => 'BuilderModule', 'action' => 'dispatchRpc'));
     $smdJson->target = BackendUtility::getModuleUrl('tools_ExtensionBuilderExtensionbuilder', $parameters);
     $smdJsonString = json_encode($smdJson);
     $ajaxRequestHandler->setContent(array($smdJsonString));
 }

作者:noxlud    项目:TYPO3v4-Cor   
/**
  * Gets plugins that are defined at $TYPO3_CONF_VARS['EXTCONF']['t3editor']['plugins']
  * (called by typo3/ajax.php)
  *
  * @param array $params additional parameters (not used here)
  * @param TYPO3AJAX	&$ajaxObj: the TYPO3AJAX object of this request
  * @return void
  * @author Oliver Hader <oliver@typo3.org>
  */
 public function getPlugins($params, \TYPO3\CMS\Core\Http\AjaxRequestHandler &$ajaxObj)
 {
     $result = array();
     $plugins =& $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['t3editor']['plugins'];
     if (is_array($plugins)) {
         $result = array_values($plugins);
     }
     $ajaxObj->setContent($result);
     $ajaxObj->setContentFormat('jsonbody');
 }

作者:nicksergi    项目:TYPO3v4-Cor   
/**
  * Makes the AJAX call to expand or collapse the pagetree.
  * Called by typo3/ajax.php
  *
  * @param array $params Additional parameters (not used here)
  * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj The TYPO3AJAX object of this request
  * @return void
  */
 public function ajaxExpandCollapse($params, $ajaxObj)
 {
     $this->init();
     $tree = $this->pagetree->getBrowsableTree();
     if (!$this->pagetree->ajaxStatus) {
         $ajaxObj->setError($tree);
     } else {
         $ajaxObj->addContent('tree', $tree);
     }
 }


问题


面经


文章

微信
公众号

扫码关注公众号