本文整理汇总了PHP中TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::getQueryArguments方法的典型用法代码示例。如果您正苦于以下问题:PHP ContentObjectRenderer::getQueryArguments方法的具体用法?PHP ContentObjectRenderer::getQueryArguments怎么用?PHP ContentObjectRenderer::getQueryArguments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
的用法示例。
在下文中一共展示了ContentObjectRenderer::getQueryArguments方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareMenuItemsForLanguageMenu
/**
* Fetches all menuitems if special = language is set
*
* @param string $specialValue The value from special.value
* @return array
*/
protected function prepareMenuItemsForLanguageMenu($specialValue)
{
$menuItems = array();
// Getting current page record NOT overlaid by any translation:
$tsfe = $this->getTypoScriptFrontendController();
$currentPageWithNoOverlay = $this->sys_page->getRawRecord('pages', $tsfe->page['uid']);
// Traverse languages set up:
$languageItems = GeneralUtility::intExplode(',', $specialValue);
foreach ($languageItems as $sUid) {
// Find overlay record:
if ($sUid) {
$lRecs = $this->sys_page->getPageOverlay($tsfe->page['uid'], $sUid);
} else {
$lRecs = array();
}
// Checking if the "disabled" state should be set.
if (GeneralUtility::hideIfNotTranslated($tsfe->page['l18n_cfg']) && $sUid && empty($lRecs) || $tsfe->page['l18n_cfg'] & 1 && (!$sUid || empty($lRecs)) || !$this->conf['special.']['normalWhenNoLanguage'] && $sUid && empty($lRecs)) {
$iState = $tsfe->sys_language_uid == $sUid ? 'USERDEF2' : 'USERDEF1';
} else {
$iState = $tsfe->sys_language_uid == $sUid ? 'ACT' : 'NO';
}
if ($this->conf['addQueryString']) {
$getVars = $this->parent_cObj->getQueryArguments($this->conf['addQueryString.'], array('L' => $sUid), true);
$this->analyzeCacheHashRequirements($getVars);
} else {
$getVars = '&L=' . $sUid;
}
// Adding menu item:
$menuItems[] = array_merge(array_merge($currentPageWithNoOverlay, $lRecs), array('ITEM_STATE' => $iState, '_ADD_GETVARS' => $getVars, '_SAFE' => true));
}
return $menuItems;
}
示例2: getQueryArgumentsWithMethodGetPostMergesParameters
/**
* @test
*/
public function getQueryArgumentsWithMethodGetPostMergesParameters() {
$_GET = array(
'key1' => 'GET1',
'key2' => 'GET2',
'key3' => array(
'key31' => 'GET31',
'key32' => 'GET32',
'key33' => array(
'key331' => 'GET331',
'key332' => 'GET332',
)
)
);
$_POST = array(
'key2' => 'POST2',
'key3' => array(
'key32' => 'POST32',
'key33' => array(
'key331' => 'POST331',
)
)
);
$getQueryArgumentsConfiguration = array();
$getQueryArgumentsConfiguration['method'] = 'GET,POST';
$expectedResult = $this->rawUrlEncodeSquareBracketsInUrl('&key1=GET1&key2=POST2&key3[key31]=GET31&key3[key32]=POST32&key3[key33][key331]=POST331&key3[key33][key332]=GET332');
$actualResult = $this->subject->getQueryArguments($getQueryArgumentsConfiguration);
$this->assertEquals($expectedResult, $actualResult);
}
示例3: getQueryArgumentsOverrulesMultiDimensionalForcedParameters
/**
* @test
*/
public function getQueryArgumentsOverrulesMultiDimensionalForcedParameters()
{
$_SERVER['QUERY_STRING'] = 'key1=value1' . '&key2=value2' . '&key3[key31]=value31' . '&key3[key32][key321]=value321' . '&key3[key32][key322]=value322';
$_POST = array('key1' => 'value1', 'key2' => 'value2', 'key3' => array('key31' => 'value31', 'key32' => array('key321' => 'value321', 'key322' => 'value322')));
$getQueryArgumentsConfiguration = array();
$getQueryArgumentsConfiguration['exclude'] = array();
$getQueryArgumentsConfiguration['exclude'][] = 'key1';
$getQueryArgumentsConfiguration['exclude'][] = 'key3[key31]';
$getQueryArgumentsConfiguration['exclude'][] = 'key3[key32][key321]';
$getQueryArgumentsConfiguration['exclude'][] = 'key3[key32][key322]';
$getQueryArgumentsConfiguration['exclude'] = implode(',', $getQueryArgumentsConfiguration['exclude']);
$overruleArguments = array('key2' => 'value2Overruled', 'key3' => array('key32' => array('key321' => 'value321Overruled', 'key323' => 'value323Overruled')));
$expectedResult = $this->rawUrlEncodeSquareBracketsInUrl('&key2=value2Overruled&key3[key32][key321]=value321Overruled&key3[key32][key323]=value323Overruled');
$actualResult = $this->cObj->getQueryArguments($getQueryArgumentsConfiguration, $overruleArguments, TRUE);
$this->assertEquals($expectedResult, $actualResult);
$getQueryArgumentsConfiguration['method'] = 'POST';
$actualResult = $this->cObj->getQueryArguments($getQueryArgumentsConfiguration, $overruleArguments, TRUE);
$this->assertEquals($expectedResult, $actualResult);
}
示例4: makeMenu
/**
* Creates the menu in the internal variables, ready for output.
* Basically this will read the page records needed and fill in the internal $this->menuArr
* Based on a hash of this array and some other variables the $this->result variable will be loaded either from cache OR by calling the generate() method of the class to create the menu for real.
*
* @return void
* @todo Define visibility
*/
public function makeMenu()
{
if ($this->id) {
$this->useCacheHash = FALSE;
// Initializing showAccessRestrictedPages
if ($this->mconf['showAccessRestrictedPages']) {
// SAVING where_groupAccess
$SAVED_where_groupAccess = $this->sys_page->where_groupAccess;
// Temporarily removing fe_group checking!
$this->sys_page->where_groupAccess = '';
}
// Begin production of menu:
$temp = array();
$altSortFieldValue = trim($this->mconf['alternativeSortingField']);
$altSortField = $altSortFieldValue ?: 'sorting';
// ... only for the FIRST level of a HMENU
if ($this->menuNumber == 1 && $this->conf['special']) {
$value = isset($this->conf['special.']['value.']) ? $this->parent_cObj->stdWrap($this->conf['special.']['value'], $this->conf['special.']['value.']) : $this->conf['special.']['value'];
switch ($this->conf['special']) {
case 'userfunction':
$temp = $this->parent_cObj->callUserFunction($this->conf['special.']['userFunc'], array_merge($this->conf['special.'], array('_altSortField' => $altSortField)), '');
if (!is_array($temp)) {
$temp = array();
}
break;
case 'language':
$temp = array();
// Getting current page record NOT overlaid by any translation:
$currentPageWithNoOverlay = $this->sys_page->getRawRecord('pages', $GLOBALS['TSFE']->page['uid']);
// Traverse languages set up:
$languageItems = GeneralUtility::intExplode(',', $value);
foreach ($languageItems as $sUid) {
// Find overlay record:
if ($sUid) {
$lRecs = $this->sys_page->getPageOverlay($GLOBALS['TSFE']->page['uid'], $sUid);
} else {
$lRecs = array();
}
// Checking if the "disabled" state should be set.
if (GeneralUtility::hideIfNotTranslated($GLOBALS['TSFE']->page['l18n_cfg']) && $sUid && !count($lRecs) || $GLOBALS['TSFE']->page['l18n_cfg'] & 1 && (!$sUid || !count($lRecs)) || !$this->conf['special.']['normalWhenNoLanguage'] && $sUid && !count($lRecs)) {
$iState = $GLOBALS['TSFE']->sys_language_uid == $sUid ? 'USERDEF2' : 'USERDEF1';
} else {
$iState = $GLOBALS['TSFE']->sys_language_uid == $sUid ? 'ACT' : 'NO';
}
if ($this->conf['addQueryString']) {
$getVars = $this->parent_cObj->getQueryArguments($this->conf['addQueryString.'], array('L' => $sUid), TRUE);
$this->analyzeCacheHashRequirements($getVars);
} else {
$getVars = '&L=' . $sUid;
}
// Adding menu item:
$temp[] = array_merge(array_merge($currentPageWithNoOverlay, $lRecs), array('ITEM_STATE' => $iState, '_ADD_GETVARS' => $getVars, '_SAFE' => TRUE));
}
break;
case 'directory':
if ($value == '') {
$value = $GLOBALS['TSFE']->page['uid'];
}
$items = GeneralUtility::intExplode(',', $value);
foreach ($items as $id) {
$MP = $this->tmpl->getFromMPmap($id);
// Checking if a page is a mount page and if so, change the ID and set the MP var properly.
$mount_info = $this->sys_page->getMountPointInfo($id);
if (is_array($mount_info)) {
if ($mount_info['overlay']) {
// Overlays should already have their full MPvars calculated:
$MP = $this->tmpl->getFromMPmap($mount_info['mount_pid']);
$MP = $MP ? $MP : $mount_info['MPvar'];
} else {
$MP = ($MP ? $MP . ',' : '') . $mount_info['MPvar'];
}
$id = $mount_info['mount_pid'];
}
// Get sub-pages:
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'pid=' . (int) $id . $this->sys_page->where_hid_del, '', $altSortField);
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$row = $this->sys_page->getPage($row['uid']);
$GLOBALS['TSFE']->sys_page->versionOL('pages', $row, TRUE);
if (!empty($row)) {
// Keep mount point?
$mount_info = $this->sys_page->getMountPointInfo($row['uid'], $row);
// There is a valid mount point.
if (is_array($mount_info) && $mount_info['overlay']) {
// Using "getPage" is OK since we need the check for enableFields
// AND for type 2 of mount pids we DO require a doktype < 200!
$mp_row = $this->sys_page->getPage($mount_info['mount_pid']);
if (count($mp_row)) {
$row = $mp_row;
$row['_MP_PARAM'] = $mount_info['MPvar'];
} else {
// If the mount point could not be fetched with respect
// to enableFields, unset the row so it does not become a part of the menu!
//.........这里部分代码省略.........