本文整理汇总了PHP中TYPO3\CMS\Core\Utility\GeneralUtility::_POST方法的典型用法代码示例。如果您正苦于以下问题:PHP GeneralUtility::_POST方法的具体用法?PHP GeneralUtility::_POST怎么用?PHP GeneralUtility::_POST使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Utility\GeneralUtility
的用法示例。
在下文中一共展示了GeneralUtility::_POST方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveStopWordsAction
/**
* Saves the edited stop word list to Solr
*
* @return void
*/
public function saveStopWordsAction()
{
$solrConnection = $this->getSelectedCoreSolrConnection();
$postParameters = GeneralUtility::_POST('tx_solr_tools_solradministration');
// lowercase stopword before saving because terms get lowercased before stopword filtering
$newStopWords = $this->stringUtility->toLower($postParameters['stopWords']);
$newStopWords = GeneralUtility::trimExplode("\n", $newStopWords, true);
$oldStopWords = $solrConnection->getStopWords();
$wordsRemoved = true;
$removedStopWords = array_diff($oldStopWords, $newStopWords);
foreach ($removedStopWords as $word) {
$response = $solrConnection->deleteStopWord($word);
if ($response->getHttpStatus() != 200) {
$wordsRemoved = false;
$this->addFlashMessage('Failed to remove stop word "' . $word . '".', 'An error occurred', FlashMessage::ERROR);
break;
}
}
$wordsAdded = true;
$addedStopWords = array_diff($newStopWords, $oldStopWords);
if (!empty($addedStopWords)) {
$wordsAddedResponse = $solrConnection->addStopWords($addedStopWords);
$wordsAdded = $wordsAddedResponse->getHttpStatus() == 200;
}
$reloadResponse = $solrConnection->reloadCore();
if ($wordsRemoved && $wordsAdded && $reloadResponse->getHttpStatus() == 200) {
$this->addFlashMessage('Stop Words Updated.');
}
$this->forwardToIndex();
}
示例2: initializeIndexQueueAction
/**
* Initializes the Index Queue for selected indexing configurations
*
* @return void
*/
public function initializeIndexQueueAction()
{
$initializedIndexingConfigurations = array();
$itemIndexQueue = GeneralUtility::makeInstance('Tx_Solr_IndexQueue_Queue');
$indexingConfigurationsToInitialize = GeneralUtility::_POST('tx_solr-index-queue-initialization');
if (!empty($indexingConfigurationsToInitialize)) {
// initialize selected indexing configuration
foreach ($indexingConfigurationsToInitialize as $indexingConfigurationName) {
$initializedIndexingConfiguration = $itemIndexQueue->initialize($this->site, $indexingConfigurationName);
// track initialized indexing configurations for the flash message
$initializedIndexingConfigurations = array_merge($initializedIndexingConfigurations, $initializedIndexingConfiguration);
}
} else {
$this->addFlashMessage('No indexing configurations selected.', 'Index Queue not initialized', FlashMessage::WARNING);
}
$messagesForConfigurations = array();
foreach (array_keys($initializedIndexingConfigurations) as $indexingConfigurationName) {
$itemCount = $itemIndexQueue->getItemsCountBySite($this->site, $indexingConfigurationName);
if (!is_int($itemCount)) {
$itemCount = 0;
}
$messagesForConfigurations[] = $indexingConfigurationName . ' (' . $itemCount . ' records)';
}
if (!empty($initializedIndexingConfigurations)) {
$this->addFlashMessage('Initialized indexing configurations: ' . implode(', ', $messagesForConfigurations), 'Index Queue initialized', FlashMessage::OK);
}
$this->forward('index');
}
示例3: createTag
/**
* 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);
}
}
示例4: adminLinks
/**
* Administrative links for a table / record.
*
* @param string $table Table name
* @param array $row Record for which administrative links are generated.
*
* @return string HTML link tags.
*/
public function adminLinks($table, array $row)
{
if ($table !== 'tx_commerce_products') {
return parent::adminLinks($table, $row);
} else {
$language = $this->getLanguageService();
// Edit link:
$adminLink = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick('&edit[' . $table . '][' . $row['uid'] . ']=edit', $this->getBackPath())) . '">' . IconUtility::getSpriteIcon('actions-document-open', array('title' => $language->sL('LLL:EXT:lang/locallang_core.xml:cm.edit', true))) . '</a>';
// Delete link:
$adminLink .= '<a href="' . htmlspecialchars($this->doc->issueCommand('&cmd[' . $table . '][' . $row['uid'] . '][delete]=1')) . '">' . IconUtility::getSpriteIcon('actions-edit-delete', array('title' => $language->sL('LLL:EXT:lang/locallang_core.php:cm.delete', true))) . '</a>';
if ($row['pid'] == -1) {
// get page TSconfig
$pagesTyposcriptConfig = BackendUtility::getPagesTSconfig(GeneralUtility::_POST('popViewId'));
if ($pagesTyposcriptConfig['tx_commerce.']['singlePid']) {
$previewPageId = $pagesTyposcriptConfig['tx_commerce.']['singlePid'];
} else {
$previewPageId = SettingsFactory::getInstance()->getExtConf('previewPageID');
}
$sysLanguageUid = (int) $row['sys_language_uid'];
/**
* Product.
*
* @var \CommerceTeam\Commerce\Domain\Model\Product $product
*/
$product = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('CommerceTeam\\Commerce\\Domain\\Model\\Product', $row['t3ver_oid'], $sysLanguageUid);
$product->loadData();
$getVars = ($sysLanguageUid > 0 ? '&L=' . $sysLanguageUid : '') . '&ADMCMD_vPrev[' . rawurlencode($table . ':' . $row['t3ver_oid']) . ']=' . $row['uid'] . '&no_cache=1&tx_commerce_pi1[showUid]=' . $product->getUid() . '&tx_commerce_pi1[catUid]=' . current($product->getMasterparentCategory());
$adminLink .= '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($previewPageId, $this->getBackPath(), BackendUtility::BEgetRootLine($row['_REAL_PID']), '', '', $getVars)) . '">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>';
}
return $adminLink;
}
}
示例5: main
/**
* Run the wizard and output HTML.
*
* @return void
*/
public function main()
{
$p = GeneralUtility::_GP('P');
if (isset($p['itemName'])) {
$this->parentFormItemName = $p['itemName'];
}
if (isset($p['fieldChangeFunc']['TBE_EDITOR_fieldChanged'])) {
$this->parentFormFieldChangeFunc = $p['fieldChangeFunc']['TBE_EDITOR_fieldChanged'];
}
if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tx_openid_mode') === 'finish' && $this->openIDResponse === NULL) {
$this->includePHPOpenIDLibrary();
$openIdConsumer = $this->getOpenIDConsumer();
$this->openIDResponse = $openIdConsumer->complete($this->getReturnUrl());
$this->handleResponse();
$this->renderHtml();
return;
} elseif (GeneralUtility::_POST('openid_url') != '') {
$openIDIdentifier = GeneralUtility::_POST('openid_url');
$this->sendOpenIDRequest($openIDIdentifier);
// When sendOpenIDRequest() returns, there was an error
$flashMessageService = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
$flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', sprintf($GLOBALS['LANG']->sL('LLL:EXT:openid/Resources/Private/Language/Wizard.xlf:error.setup'), htmlspecialchars($openIDIdentifier)), $GLOBALS['LANG']->sL('LLL:EXT:openid/Resources/Private/Language/Wizard.xlf:title.error'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
$flashMessageService->getMessageQueueByIdentifier()->enqueue($flashMessage);
}
$this->renderHtml();
}
示例6: initializeIndexQueueAction
/**
* Initializes the Index Queue for selected indexing configurations
*
* @return void
*/
public function initializeIndexQueueAction()
{
$initializedIndexingConfigurations = array();
$itemIndexQueue = GeneralUtility::makeInstance('Tx_Solr_IndexQueue_Queue');
$indexingConfigurationsToInitialize = GeneralUtility::_POST('tx_solr-index-queue-initialization');
if (!empty($indexingConfigurationsToInitialize)) {
// initialize selected indexing configuration
foreach ($indexingConfigurationsToInitialize as $indexingConfigurationName) {
$initializedIndexingConfiguration = $itemIndexQueue->initialize($this->site, $indexingConfigurationName);
// track initialized indexing configurations for the flash message
$initializedIndexingConfigurations = array_merge($initializedIndexingConfigurations, $initializedIndexingConfiguration);
}
} else {
$messageLabel = 'solr.backend.index_queue_module.flashmessage.initialize.no_selection';
$titleLabel = 'solr.backend.index_queue_module.flashmessage.not_initialized.title';
$this->addFlashMessage(LocalizationUtility::translate($messageLabel, 'Solr'), LocalizationUtility::translate($titleLabel, 'Solr'), FlashMessage::WARNING);
}
$messagesForConfigurations = array();
foreach (array_keys($initializedIndexingConfigurations) as $indexingConfigurationName) {
$itemCount = $itemIndexQueue->getItemsCountBySite($this->site, $indexingConfigurationName);
if (!is_int($itemCount)) {
$itemCount = 0;
}
$messagesForConfigurations[] = $indexingConfigurationName . ' (' . $itemCount . ' records)';
}
if (!empty($initializedIndexingConfigurations)) {
$messageLabel = 'solr.backend.index_queue_module.flashmessage.initialize.success';
$titleLabel = 'solr.backend.index_queue_module.flashmessage.initialize.title';
$this->addFlashMessage(LocalizationUtility::translate($messageLabel, 'Solr', array(implode(', ', $messagesForConfigurations))), LocalizationUtility::translate($titleLabel, 'Solr'), FlashMessage::OK);
}
$this->forward('index');
}
示例7: doAction
/**
* Single entry point for all MShop admin requests.
*
* @return JSON 2.0 RPC message response
*/
public function doAction()
{
$param = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST();
if (($content = file_get_contents('php://input')) === false) {
throw new \RuntimeException('Unable to get request content');
}
$this->view->assign('response', $this->getController()->process($param, $content));
}
示例8: isClicked
/**
* return true if the button is clicked
* @return bool
*/
public function isClicked()
{
if ($this->form->isSubmitted()) {
$post = GeneralUtility::_POST($this->form->getIdentifier());
return isset($post[$this->getName()]);
}
return false;
}
示例9: initializeCreateAction
/**
* Rewrite Arguments to receive a clean mail object in createAction
*
* @return void
*/
public function initializeCreateAction()
{
$this->reformatParamsForAction();
$this->forwardIfFormParamsDoNotMatch();
if ($this->settings['debug']['variables']) {
GeneralUtility::devLog('Variables', $this->extensionName, 0, GeneralUtility::_POST());
}
}
示例10: showtextAction
/**
* action showtext
*
* @param
* @return string $response
*/
public function showtextAction()
{
$arg1 = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('a1');
$arg2 = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('a2');
$returnStr = '';
$returnStr = '"' . $arg1 . ' ' . $arg2 . '" ' . 'from Server as a Response!';
return $returnStr;
}
示例11: getFileWithAbsolutePath
/**
* Get the file with its absolute path.
*
* @return string
*/
public function getFileWithAbsolutePath()
{
$fileIdentifier = GeneralUtility::_POST('qquuid');
if (!empty($fileIdentifier)) {
$fileIdentifier .= '-';
}
return $this->uploadFolder . DIRECTORY_SEPARATOR . $fileIdentifier . $this->name;
}
示例12: saveSortingState
/**
* Saves the sorting order of tasks in the backend user's uc
*
* @param array $params Array of parameters from the AJAX interface, currently unused
* @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj Object of type TYPO3AJAX
* @return void
*/
public function saveSortingState(array $params, \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj)
{
$sort = array();
$items = explode('&', \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('data'));
foreach ($items as $item) {
$sort[] = substr($item, 12);
}
$GLOBALS['BE_USER']->uc['taskcenter']['sorting'] = serialize($sort);
$GLOBALS['BE_USER']->writeUC();
}
示例13: saveSortingState
/**
* Saves the sorting order of tasks in the backend user's uc
*
* @param array $params Array of parameters from the AJAX interface, currently unused
* @param AjaxRequestHandler $ajaxObj Object of type AjaxRequestHandler
* @return void
*/
public function saveSortingState(array $params, AjaxRequestHandler $ajaxObj)
{
$sort = array();
$items = explode('&', GeneralUtility::_POST('data'));
foreach ($items as $item) {
$sort[] = substr($item, 12);
}
$this->getBackendUserAuthentication()->uc['taskcenter']['sorting'] = serialize($sort);
$this->getBackendUserAuthentication()->writeUC();
}
示例14: main
/**
* Updates nested sets
*
* @return string HTML output
*/
public function main()
{
if (\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('nssubmit') != '') {
$this->updateOverridePaths();
$content = 'Update finished successfully.';
} else {
$content = $this->prompt();
}
return $content;
}
示例15: showtextAction
/**
* action showtext
*
* @param
* @return string $response
*/
public function showtextAction()
{
$ajaxParams = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('request');
$argsArray = $ajaxParams['arguments'];
$arg1 = $argsArray['a1'];
$arg2 = $argsArray['a2'];
$returnStr = '';
$returnStr = $arg1 . ' ' . $arg2 . ' ' . 'from Server as a Response!';
return $returnStr;
}