本文整理汇总了PHP中TYPO3\CMS\Core\Utility\GeneralUtility::explodeUrl2Array方法的典型用法代码示例。如果您正苦于以下问题:PHP GeneralUtility::explodeUrl2Array方法的具体用法?PHP GeneralUtility::explodeUrl2Array怎么用?PHP GeneralUtility::explodeUrl2Array使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Utility\GeneralUtility
的用法示例。
在下文中一共展示了GeneralUtility::explodeUrl2Array方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* Creates a link to a given page with a given link text with the current
* tx_solr parameters appended to the URL
*
* @param array Array of arguments, [0] is the link text, [1] is the (optional) page Id to link to (otherwise TSFE->id), [2] are additional URL parameters, [3] use cache, defaults to FALSE
* @return string complete anchor tag with URL and link text
*/
public function execute(array $arguments = array())
{
$linkText = $arguments[0];
$pageId = $this->determinePageId(trim($arguments[1]));
$additionalUrlParameters = $arguments[2] ? $arguments[2] : '';
$useCache = $arguments[3] ? true : false;
$returnOnlyUrl = $arguments[4] ? true : false;
// FIXME pass anything not prefixed with tx_solr in $additionalParameters as 4th parameter
$additionalUrlParameters = GeneralUtility::explodeUrl2Array($additionalUrlParameters, true);
$solrUrlParameters = array();
if (!empty($additionalUrlParameters['tx_solr'])) {
$solrUrlParameters = $additionalUrlParameters['tx_solr'];
}
$linkConfiguration = array('useCacheHash' => $useCache);
if ($returnOnlyUrl) {
$linkConfiguration['returnLast'] = 'url';
}
if ($this->search->hasSearched()) {
$query = $this->search->getQuery();
} else {
$query = GeneralUtility::makeInstance('ApacheSolrForTypo3\\Solr\\Query', '');
}
$linkBuilder = GeneralUtility::makeInstance('ApacheSolrForTypo3\\Solr\\Query\\LinkBuilder', $query);
$linkBuilder->setLinkTargetPageId($pageId);
$queryLink = $linkBuilder->getQueryLink($linkText, $solrUrlParameters, $linkConfiguration);
return $queryLink;
}
示例2: preProcess
/**
* Restores link handler generated preview link on save-n-preview event. This link is overwritten by the workspace module.
*
* @param integer $pageUid
* @param string $backPath
* @param array $rootLine
* @param string $anchorSection
* @param string $viewScript
* @param array $additionalGetVars
* @param boolean $switchFocus
*/
public function preProcess($pageUid, $backPath, $rootLine, $anchorSection, &$viewScript, $additionalGetVars, $switchFocus)
{
if ($GLOBALS['BE_USER']->workspace != 0) {
$additionalGetVars = GeneralUtility::explodeUrl2Array($additionalGetVars);
if (isset($additionalGetVars['eID']) && $additionalGetVars['eID'] === 'linkhandlerPreview' && isset($GLOBALS['_POST']['viewUrl'])) {
$viewScript = $GLOBALS['_POST']['viewUrl'];
}
}
}
示例3: render
/**
* Returns a URL to link to FormEngine
*
* @param string $parameters Is a set of GET params to send to FormEngine
* @return string URL to FormEngine module + parameters
* @see \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl()
*/
public function render($parameters)
{
// Make sure record_edit module is available
if (GeneralUtility::compat_version('7.0')) {
$parameters = GeneralUtility::explodeUrl2Array($parameters);
return BackendUtility::getModuleUrl('record_edit', $parameters);
} else {
return 'alt_doc.php?' . $parameters;
}
}
示例4: renderStatic
/**
* @param array $arguments
* @param callable $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
*
* @return string
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
/** @var BackendUserAuthentication $beUser */
$beUser = $GLOBALS['BE_USER'];
$urlParameters = ['vC' => $beUser->veriCode(), 'prErr' => 1, 'uPT' => 1, 'redirect' => $arguments['redirectUrl'] ?: GeneralUtility::getIndpEnv('REQUEST_URI')];
if (isset($arguments['parameters'])) {
$parametersArray = GeneralUtility::explodeUrl2Array($arguments['parameters']);
$urlParameters += $parametersArray;
}
return htmlspecialchars(BackendUtility::getModuleUrl('tce_db', $urlParameters));
}
示例5: modifyMenuDefinition
/**
* modifies the menu definition and returns it
*
* @param array $menuDef menu definition
* @return array modified menu definition
*/
public function modifyMenuDefinition($menuDef)
{
$tabs = $this->getTabsConfig();
foreach ($tabs as $key => $tabConfig) {
$menuDef[$key]['isActive'] = $this->pObj->act == $key;
$menuDef[$key]['label'] = $tabConfig['label'];
$menuDef[$key]['url'] = '#';
$addPassOnParams = $this->getaddPassOnParams();
$addPassOnParams = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl('', \TYPO3\CMS\Core\Utility\GeneralUtility::explodeUrl2Array($addPassOnParams), '', TRUE);
$menuDef[$key]['addParams'] = 'onclick="jumpToUrl(\'?act=' . $key . '&editorNo=' . $this->pObj->editorNo . '&contentTypo3Language=' . $this->pObj->contentTypo3Language . '&contentTypo3Charset=' . $this->pObj->contentTypo3Charset . $addPassOnParams . '\');return false;"';
}
return $menuDef;
}
示例6: render
/**
* Returns a URL to link to quick command
*
* @param string $parameters Is a set of GET params to send to FormEngine
* @return string URL to FormEngine module + parameters
*/
public function render($parameters)
{
$parameters = GeneralUtility::explodeUrl2Array($parameters);
$parameters['vC'] = $this->getBackendUserAuthentication()->veriCode();
$parameters['prErr'] = 1;
$parameters['uPT'] = 1;
// Make sure record_edit module is available
if (GeneralUtility::compat_version('7.0')) {
$url = BackendUtility::getModuleUrl('tce_db', $parameters);
} else {
$url = 'tce_db.php?' . GeneralUtility::implodeArrayForUrl('', $parameters);
}
return $url . BackendUtility::getUrlToken('tceAction');
}
示例7: init
/**
* Constructor function for class
*
* @return void
* @todo Define visibility
*/
public function init()
{
// Initialize GPvars:
$this->target = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('target');
$this->returnUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::sanitizeLocalUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('returnUrl'));
// Cleaning and checking target
if ($this->target) {
$this->fileOrFolderObject = \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->retrieveFileOrFolderObject($this->target);
}
if (!$this->fileOrFolderObject) {
$title = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:paramError', TRUE);
$message = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:targetNoDir', TRUE);
throw new \RuntimeException($title . ': ' . $message, 1294586844);
}
// If a folder should be renamed, AND the returnURL should go to the old directory name, the redirect is forced
// so the redirect will NOT end in a error message
// this case only happens if you select the folder itself in the foldertree and then use the clickmenu to
// rename the folder
if ($this->fileOrFolderObject instanceof \TYPO3\CMS\Core\Resource\Folder) {
$parsedUrl = parse_url($this->returnUrl);
$queryParts = \TYPO3\CMS\Core\Utility\GeneralUtility::explodeUrl2Array(urldecode($parsedUrl['query']));
if ($queryParts['id'] === $this->fileOrFolderObject->getCombinedIdentifier()) {
$this->returnUrl = str_replace(urlencode($queryParts['id']), urlencode($this->fileOrFolderObject->getStorage()->getRootLevelFolder()->getCombinedIdentifier()), $this->returnUrl);
}
}
// Setting icon and title
$icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('apps-filetree-root');
$this->title = $icon . htmlspecialchars($this->fileOrFolderObject->getStorage()->getName()) . ': ' . htmlspecialchars($this->fileOrFolderObject->getIdentifier());
// Setting template object
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->setModuleTemplate('templates/file_rename.html');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->JScode = $this->doc->wrapScriptTags('
function backToList() { //
top.goToModule("file_list");
}
');
}
示例8: createAjaxShortcut
/**
* Creates a shortcut through an AJAX call
*
* @param array $params Array of parameters from the AJAX interface, currently unused
* @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj Oject of type AjaxRequestHandler
* @return void
*/
public function createAjaxShortcut($params = array(), AjaxRequestHandler $ajaxObj = NULL)
{
$databaseConnection = $this->getDatabaseConnection();
$languageService = $this->getLanguageService();
$shortcutCreated = 'failed';
// Default name
$shortcutName = 'Shortcut';
$shortcutNamePrepend = '';
$url = GeneralUtility::_POST('url');
$module = GeneralUtility::_POST('module');
$motherModule = GeneralUtility::_POST('motherModName');
// Determine shortcut type
$url = rawurldecode($url);
$queryParts = parse_url($url);
$queryParameters = GeneralUtility::explodeUrl2Array($queryParts['query'], TRUE);
// Proceed only if no scheme is defined, as URL is expected to be relative
if (empty($queryParts['scheme'])) {
if (is_array($queryParameters['edit'])) {
$shortcut['table'] = key($queryParameters['edit']);
$shortcut['recordid'] = key($queryParameters['edit'][$shortcut['table']]);
if ($queryParameters['edit'][$shortcut['table']][$shortcut['recordid']] == 'edit') {
$shortcut['type'] = 'edit';
$shortcutNamePrepend = $languageService->getLL('shortcut_edit', TRUE);
} elseif ($queryParameters['edit'][$shortcut['table']][$shortcut['recordid']] == 'new') {
$shortcut['type'] = 'new';
$shortcutNamePrepend = $languageService->getLL('shortcut_create', TRUE);
}
} else {
$shortcut['type'] = 'other';
}
// Lookup the title of this page and use it as default description
$pageId = $shortcut['recordid'] ? $shortcut['recordid'] : $this->getLinkedPageId($url);
if (MathUtility::canBeInterpretedAsInteger($pageId)) {
$page = BackendUtility::getRecord('pages', $pageId);
if (count($page)) {
// Set the name to the title of the page
if ($shortcut['type'] == 'other') {
$shortcutName = $page['title'];
} else {
$shortcutName = $shortcutNamePrepend . ' ' . $languageService->sL($GLOBALS['TCA'][$shortcut['table']]['ctrl']['title']) . ' (' . $page['title'] . ')';
}
}
} else {
$dirName = urldecode($pageId);
if (preg_match('/\\/$/', $dirName)) {
// If $pageId is a string and ends with a slash,
// assume it is a fileadmin reference and set
// the description to the basename of that path
$shortcutName .= ' ' . basename($dirName);
}
}
// adding the shortcut
if ($module && $url) {
$fieldValues = array('userid' => $this->getBackendUser()->user['uid'], 'module_name' => $module . '|' . $motherModule, 'url' => $url, 'description' => $shortcutName, 'sorting' => $GLOBALS['EXEC_TIME']);
$databaseConnection->exec_INSERTquery('sys_be_shortcuts', $fieldValues);
if ($databaseConnection->sql_affected_rows() == 1) {
$shortcutCreated = 'success';
}
}
$ajaxObj->addContent('create', $shortcutCreated);
}
}
示例9: renderStatic
/**
* @param array $arguments
* @param callable $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
*
* @return string
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
$parameters = GeneralUtility::explodeUrl2Array($arguments['parameters']);
$parameters['returnUrl'] = 'index.php?M=web_NewsTxNewsM2&id=' . (int) GeneralUtility::_GET('id') . '&moduleToken=' . FormProtectionFactory::get()->generateToken('moduleCall', 'web_NewsTxNewsM2');
return BackendUtility::getModuleUrl('record_edit', $parameters);
}
示例10: getQueryArguments
/**
* Gets the query arguments and assembles them for URLs.
* Arguments may be removed or set, depending on configuration.
*
* @param string $conf Configuration
* @param array $overruleQueryArguments Multidimensional key/value pairs that overrule incoming query arguments
* @param boolean $forceOverruleArguments If set, key/value pairs not in the query but the overrule array will be set
* @return string The URL query part (starting with a &)
*/
public function getQueryArguments($conf, $overruleQueryArguments = array(), $forceOverruleArguments = FALSE)
{
switch ((string) $conf['method']) {
case 'GET':
$currentQueryArray = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET();
break;
case 'POST':
$currentQueryArray = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST();
break;
case 'GET,POST':
$currentQueryArray = array_merge(\TYPO3\CMS\Core\Utility\GeneralUtility::_GET(), \TYPO3\CMS\Core\Utility\GeneralUtility::_POST());
break;
case 'POST,GET':
$currentQueryArray = array_merge(\TYPO3\CMS\Core\Utility\GeneralUtility::_POST(), \TYPO3\CMS\Core\Utility\GeneralUtility::_GET());
break;
default:
$currentQueryArray = \TYPO3\CMS\Core\Utility\GeneralUtility::explodeUrl2Array(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('QUERY_STRING'), TRUE);
}
if ($conf['exclude']) {
$exclude = str_replace(',', '&', $conf['exclude']);
$exclude = \TYPO3\CMS\Core\Utility\GeneralUtility::explodeUrl2Array($exclude, TRUE);
// never repeat id
$exclude['id'] = 0;
$newQueryArray = \TYPO3\CMS\Core\Utility\GeneralUtility::arrayDiffAssocRecursive($currentQueryArray, $exclude);
} else {
$newQueryArray = $currentQueryArray;
}
if ($forceOverruleArguments) {
$newQueryArray = \TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule($newQueryArray, $overruleQueryArguments);
} else {
$newQueryArray = \TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule($newQueryArray, $overruleQueryArguments, TRUE);
}
return \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl('', $newQueryArray, '', FALSE, TRUE);
}
示例11: removeInvalidElements
/**
* Checks the array for elements which might contain unallowed default values and will unset them!
* Looks for the "tt_content_defValues" key in each element and if found it will traverse that array as fieldname /
* value pairs and check.
* The values will be added to the "params" key of the array (which should probably be unset or empty by default).
*
* @param array $wizardItems Wizard items, passed by reference
* @return void
*/
public function removeInvalidElements(&$wizardItems)
{
// Get TCEFORM from TSconfig of current page
$row = array('pid' => $this->id);
$TCEFORM_TSconfig = BackendUtility::getTCEFORM_TSconfig('tt_content', $row);
$headersUsed = array();
// Traverse wizard items:
foreach ($wizardItems as $key => $cfg) {
// Exploding parameter string, if any (old style)
if ($wizardItems[$key]['params']) {
// Explode GET vars recursively
$tempGetVars = GeneralUtility::explodeUrl2Array($wizardItems[$key]['params'], true);
// If tt_content values are set, merge them into the tt_content_defValues array,
// unset them from $tempGetVars and re-implode $tempGetVars into the param string
// (in case remaining parameters are around).
if (is_array($tempGetVars['defVals']['tt_content'])) {
$wizardItems[$key]['tt_content_defValues'] = array_merge(is_array($wizardItems[$key]['tt_content_defValues']) ? $wizardItems[$key]['tt_content_defValues'] : array(), $tempGetVars['defVals']['tt_content']);
unset($tempGetVars['defVals']['tt_content']);
$wizardItems[$key]['params'] = GeneralUtility::implodeArrayForUrl('', $tempGetVars);
}
}
// If tt_content_defValues are defined...:
if (is_array($wizardItems[$key]['tt_content_defValues'])) {
$backendUser = $this->getBackendUser();
// Traverse field values:
foreach ($wizardItems[$key]['tt_content_defValues'] as $fN => $fV) {
if (is_array($GLOBALS['TCA']['tt_content']['columns'][$fN])) {
// Get information about if the field value is OK:
$config =& $GLOBALS['TCA']['tt_content']['columns'][$fN]['config'];
$authModeDeny = $config['type'] == 'select' && $config['authMode'] && !$backendUser->checkAuthMode('tt_content', $fN, $fV, $config['authMode']);
// explode TSconfig keys only as needed
if (!isset($removeItems[$fN])) {
$removeItems[$fN] = GeneralUtility::trimExplode(',', $TCEFORM_TSconfig[$fN]['removeItems'], true);
}
if (!isset($keepItems[$fN])) {
$keepItems[$fN] = GeneralUtility::trimExplode(',', $TCEFORM_TSconfig[$fN]['keepItems'], true);
}
$isNotInKeepItems = !empty($keepItems[$fN]) && !in_array($fV, $keepItems[$fN]);
if ($authModeDeny || $fN === 'CType' && in_array($fV, $removeItems[$fN]) || $isNotInKeepItems) {
// Remove element all together:
unset($wizardItems[$key]);
break;
} else {
// Add the parameter:
$wizardItems[$key]['params'] .= '&defVals[tt_content][' . $fN . ']=' . rawurlencode($fV);
$tmp = explode('_', $key);
$headersUsed[$tmp[0]] = $tmp[0];
}
}
}
}
}
// remove headers without elements
foreach ($wizardItems as $key => $cfg) {
$tmp = explode('_', $key);
if ($tmp[0] && !$tmp[1] && !in_array($tmp[0], $headersUsed)) {
unset($wizardItems[$key]);
}
}
}
示例12: registerDocheaderButtons
/**
* Registers the Icons into the docheader
*
* @return void
* @throws \InvalidArgumentException
*/
protected function registerDocheaderButtons()
{
/** @var ButtonBar $buttonBar */
$buttonBar = $this->view->getModuleTemplate()->getDocHeaderComponent()->getButtonBar();
$currentRequest = $this->request;
$moduleName = $currentRequest->getPluginName();
$getVars = $this->request->getArguments();
$extensionName = $currentRequest->getControllerExtensionName();
if (count($getVars) === 0) {
$modulePrefix = strtolower('tx_' . $extensionName . '_' . $moduleName);
$getVars = array('id', 'M', $modulePrefix);
}
$shortcutName = $this->getLanguageService()->sL('LLL:EXT:beuser/Resources/Private/Language/locallang.xml:backendUsers');
if ($this->request->getControllerName() === 'BackendUser') {
if ($this->request->getControllerActionName() === 'index') {
$returnUrl = rawurlencode(BackendUtility::getModuleUrl('system_BeuserTxBeuser'));
$parameters = GeneralUtility::explodeUrl2Array('edit[be_users][0]=new&returnUrl=' . $returnUrl);
$addUserLink = BackendUtility::getModuleUrl('record_edit', $parameters);
$title = $this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newRecordGeneral', true);
$icon = $this->view->getModuleTemplate()->getIconFactory()->getIcon('actions-document-new', Icon::SIZE_SMALL);
$addUserButton = $buttonBar->makeLinkButton()->setHref($addUserLink)->setTitle($title)->setIcon($icon);
$buttonBar->addButton($addUserButton, ButtonBar::BUTTON_POSITION_LEFT);
}
if ($this->request->getControllerActionName() === 'compare') {
$addUserLink = BackendUtility::getModuleUrl('system_BeuserTxBeuser');
$title = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', true);
$icon = $this->view->getModuleTemplate()->getIconFactory()->getIcon('actions-view-go-back', Icon::SIZE_SMALL);
$addUserButton = $buttonBar->makeLinkButton()->setHref($addUserLink)->setTitle($title)->setIcon($icon);
$buttonBar->addButton($addUserButton, ButtonBar::BUTTON_POSITION_LEFT);
}
if ($this->request->getControllerActionName() === 'online') {
$shortcutName = $this->getLanguageService()->sL('LLL:EXT:beuser/Resources/Private/Language/locallang.xml:onlineUsers');
}
}
if ($this->request->getControllerName() === 'BackendUserGroup') {
$shortcutName = $this->getLanguageService()->sL('LLL:EXT:beuser/Resources/Private/Language/locallang.xml:backendUserGroupsMenu');
$returnUrl = rawurlencode(BackendUtility::getModuleUrl('system_BeuserTxBeuser', array('tx_beuser_system_beusertxbeuser' => array('action' => 'index', 'controller' => 'BackendUserGroup'))));
$parameters = GeneralUtility::explodeUrl2Array('edit[be_groups][0]=new&returnUrl=' . $returnUrl);
$addUserLink = BackendUtility::getModuleUrl('record_edit', $parameters);
$title = $this->getLanguageService()->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newRecordGeneral', true);
$icon = $this->view->getModuleTemplate()->getIconFactory()->getIcon('actions-document-new', Icon::SIZE_SMALL);
$addUserGroupButton = $buttonBar->makeLinkButton()->setHref($addUserLink)->setTitle($title)->setIcon($icon);
$buttonBar->addButton($addUserGroupButton, ButtonBar::BUTTON_POSITION_LEFT);
}
$shortcutButton = $buttonBar->makeShortcutButton()->setModuleName($moduleName)->setDisplayName($shortcutName)->setGetVariables($getVars);
$buttonBar->addButton($shortcutButton);
}
示例13: getQueryArguments
/**
* Gets the query arguments and assembles them for URLs.
* Arguments may be removed or set, depending on configuration.
*
* @param string $conf Configuration
* @param array $overruleQueryArguments Multidimensional key/value pairs that overrule incoming query arguments
* @param bool $forceOverruleArguments If set, key/value pairs not in the query but the overrule array will be set
* @return string The URL query part (starting with a &)
*/
public function getQueryArguments($conf, $overruleQueryArguments = array(), $forceOverruleArguments = false)
{
switch ((string) $conf['method']) {
case 'GET':
$currentQueryArray = GeneralUtility::_GET();
break;
case 'POST':
$currentQueryArray = GeneralUtility::_POST();
break;
case 'GET,POST':
$currentQueryArray = GeneralUtility::_GET();
ArrayUtility::mergeRecursiveWithOverrule($currentQueryArray, GeneralUtility::_POST());
break;
case 'POST,GET':
$currentQueryArray = GeneralUtility::_POST();
ArrayUtility::mergeRecursiveWithOverrule($currentQueryArray, GeneralUtility::_GET());
break;
default:
$currentQueryArray = GeneralUtility::explodeUrl2Array($this->getEnvironmentVariable('QUERY_STRING'), true);
}
if ($conf['exclude']) {
$exclude = str_replace(',', '&', $conf['exclude']);
$exclude = GeneralUtility::explodeUrl2Array($exclude, true);
// never repeat id
$exclude['id'] = 0;
$newQueryArray = ArrayUtility::arrayDiffAssocRecursive($currentQueryArray, $exclude);
} else {
$newQueryArray = $currentQueryArray;
}
if ($forceOverruleArguments) {
ArrayUtility::mergeRecursiveWithOverrule($newQueryArray, $overruleQueryArguments);
} else {
ArrayUtility::mergeRecursiveWithOverrule($newQueryArray, $overruleQueryArguments, false);
}
return GeneralUtility::implodeArrayForUrl('', $newQueryArray, '', false, true);
}
示例14: mergeTypoScript
/**
* Merge all TypoScript for the typoLink from the global and local defined settings.
*
*@param array $linkConfigurationArray Global defined TypoScript cofiguration for the linkHandler
* @param array $typoLinkConfigurationArray Local typolink TypoScript configuration for current link
* @param string $recordTableName The name of database table
* @access protected
* @return array
*/
protected function mergeTypoScript(array $linkConfigurationArray, array $typoLinkConfigurationArray, $recordTableName)
{
// precompile the "additionalParams"
$linkConfigurationArray[$recordTableName . '.']['additionalParams'] = $this->localContentObject->stdWrap($linkConfigurationArray[$recordTableName . '.']['additionalParams'], $linkConfigurationArray[$recordTableName . '.']['additionalParams.']);
unset($linkConfigurationArray[$recordTableName . '.']['additionalParams.']);
// merge recursive the "additionalParams" from "$typoScriptConfiguration" with the "$typoLinkConfigurationArray"
if (array_key_exists('additionalParams', $typoLinkConfigurationArray)) {
$typoLinkConfigurationArray['additionalParams'] = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl('', \TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule(\TYPO3\CMS\Core\Utility\GeneralUtility::explodeUrl2Array($linkConfigurationArray[$recordTableName . '.']['additionalParams']), \TYPO3\CMS\Core\Utility\GeneralUtility::explodeUrl2Array($typoLinkConfigurationArray['additionalParams'])));
}
/**
* @internal Merge the linkhandler configuration from $typoScriptConfiguration with the current $typoLinkConfiguration.
*/
if (is_array($typoLinkConfigurationArray) && !empty($typoLinkConfigurationArray)) {
if (array_key_exists('parameter.', $typoLinkConfigurationArray)) {
unset($typoLinkConfigurationArray['parameter.']);
}
$linkConfigurationArray[$recordTableName . '.'] = array_merge($linkConfigurationArray[$recordTableName . '.'], $typoLinkConfigurationArray);
}
return $linkConfigurationArray[$recordTableName . '.'];
}
示例15: buildBackendUri
/**
* Builds the URI, backend flavour
* The resulting URI is relative and starts with "index.php".
* The settings pageUid, pageType, noCache, useCacheHash & linkAccessRestrictedPages
* will be ignored in the backend.
*
* @return string The URI
*/
public function buildBackendUri()
{
if ($this->addQueryString === true) {
if ($this->addQueryStringMethod) {
switch ($this->addQueryStringMethod) {
case 'GET':
$arguments = GeneralUtility::_GET();
break;
case 'POST':
$arguments = GeneralUtility::_POST();
break;
case 'GET,POST':
$arguments = array_replace_recursive(GeneralUtility::_GET(), GeneralUtility::_POST());
break;
case 'POST,GET':
$arguments = array_replace_recursive(GeneralUtility::_POST(), GeneralUtility::_GET());
break;
default:
$arguments = GeneralUtility::explodeUrl2Array(GeneralUtility::getIndpEnv('QUERY_STRING'), true);
}
} else {
$arguments = GeneralUtility::_GET();
}
foreach ($this->argumentsToBeExcludedFromQueryString as $argumentToBeExcluded) {
$argumentToBeExcluded = GeneralUtility::explodeUrl2Array($argumentToBeExcluded, true);
$arguments = ArrayUtility::arrayDiffAssocRecursive($arguments, $argumentToBeExcluded);
}
} else {
$arguments = array('M' => GeneralUtility::_GP('M'), 'id' => GeneralUtility::_GP('id'));
}
ArrayUtility::mergeRecursiveWithOverrule($arguments, $this->arguments);
$arguments = $this->convertDomainObjectsToIdentityArrays($arguments);
$this->lastArguments = $arguments;
$moduleName = $arguments['M'];
unset($arguments['M'], $arguments['moduleToken']);
$backendUriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
if ($this->request instanceof WebRequest && $this->createAbsoluteUri) {
$uri = (string) $backendUriBuilder->buildUriFromModule($moduleName, $arguments, \TYPO3\CMS\Backend\Routing\UriBuilder::ABSOLUTE_URL);
} else {
$uri = (string) $backendUriBuilder->buildUriFromModule($moduleName, $arguments);
}
if ($this->section !== '') {
$uri .= '#' . $this->section;
}
return $uri;
}