138 $this->contentObject = $this->configurationManager->getContentObject();
413 $this->noCache = (boolean)
$noCache;
463 $this->arguments = array();
466 $this->createAbsoluteUri = FALSE;
467 $this->addQueryString = FALSE;
468 $this->addQueryStringMethod = NULL;
469 $this->argumentsToBeExcludedFromQueryString = array();
470 $this->linkAccessRestrictedPages = FALSE;
471 $this->targetPageUid = NULL;
472 $this->targetPageType = 0;
473 $this->noCache = FALSE;
474 $this->useCacheHash = TRUE;
475 $this->argumentPrefix = NULL;
492 public function uriFor($actionName = NULL, $controllerArguments = array(), $controllerName = NULL, $extensionName = NULL, $pluginName = NULL) {
493 if ($actionName !== NULL) {
494 $controllerArguments[
'action'] = $actionName;
496 if ($controllerName !== NULL) {
497 $controllerArguments[
'controller'] = $controllerName;
499 $controllerArguments[
'controller'] = $this->request->getControllerName();
501 if ($extensionName === NULL) {
502 $extensionName = $this->request->getControllerExtensionName();
504 if ($pluginName === NULL && $this->environmentService->isEnvironmentInFrontendMode()) {
505 $pluginName = $this->extensionService->getPluginNameByAction($extensionName, $controllerArguments[
'controller'], $controllerArguments[
'action']);
507 if ($pluginName === NULL) {
508 $pluginName = $this->request->getPluginName();
510 if ($this->environmentService->isEnvironmentInFrontendMode() && $this->configurationManager->isFeatureEnabled(
'skipDefaultArguments')) {
513 if ($this->targetPageUid === NULL && $this->environmentService->isEnvironmentInFrontendMode()) {
514 $this->targetPageUid = $this->extensionService->getTargetPidByPlugin($extensionName, $pluginName);
516 if ($this->format !==
'') {
519 if ($this->argumentPrefix !== NULL) {
520 $prefixedControllerArguments = array($this->argumentPrefix => $controllerArguments);
522 $pluginNamespace = $this->extensionService->getPluginNamespace($extensionName, $pluginName);
523 $prefixedControllerArguments = array($pluginNamespace => $controllerArguments);
526 return $this->
build();
541 $defaultControllerName = $this->extensionService->getDefaultControllerNameByPlugin($extensionName, $pluginName);
542 if (isset($controllerArguments[
'action'])) {
543 $defaultActionName = $this->extensionService->getDefaultActionNameByPluginAndController($extensionName, $pluginName, $controllerArguments[
'controller']);
544 if ($controllerArguments[
'action'] === $defaultActionName) {
545 unset($controllerArguments[
'action']);
548 if ($controllerArguments[
'controller'] === $defaultControllerName) {
549 unset($controllerArguments[
'controller']);
551 return $controllerArguments;
564 if ($this->environmentService->isEnvironmentInBackendMode()) {
580 if ($this->addQueryString === TRUE) {
581 if ($this->addQueryStringMethod) {
582 switch ($this->addQueryStringMethod) {
590 $arguments = array_replace_recursive(\
TYPO3\CMS\Core\Utility\GeneralUtility::_GET(), \
TYPO3\CMS\Core\Utility\GeneralUtility::_POST());
593 $arguments = array_replace_recursive(\
TYPO3\CMS\Core\Utility\GeneralUtility::_POST(), \
TYPO3\CMS\Core\Utility\GeneralUtility::_GET());
601 foreach ($this->argumentsToBeExcludedFromQueryString as $argumentToBeExcluded) {
607 'M' => \
TYPO3\CMS\Core\Utility\GeneralUtility::_GP(
'M'),
608 'id' => \
TYPO3\CMS\Core\Utility\GeneralUtility::_GP(
'id')
617 if ($this->section !==
'') {
620 if ($this->createAbsoluteUri === TRUE) {
621 $uri = $this->request->getBaseUri() . $uri;
634 if ($this->createAbsoluteUri === TRUE) {
635 $typolinkConfiguration[
'forceAbsoluteUrl'] = TRUE;
636 if ($this->absoluteUriScheme !== NULL) {
640 $uri = $this->contentObject->typoLink_URL($typolinkConfiguration);
651 $typolinkConfiguration = array();
652 $typolinkConfiguration[
'parameter'] = $this->targetPageUid !== NULL ? $this->targetPageUid :
$GLOBALS[
'TSFE']->id;
653 if ($this->targetPageType !== 0) {
655 } elseif ($this->format !==
'') {
659 if (count($this->arguments) > 0) {
664 if ($this->addQueryString === TRUE) {
665 $typolinkConfiguration[
'addQueryString'] = 1;
666 if (count($this->argumentsToBeExcludedFromQueryString) > 0) {
667 $typolinkConfiguration[
'addQueryString.'] = array(
668 'exclude' => implode(
',', $this->argumentsToBeExcludedFromQueryString)
671 if ($this->addQueryStringMethod) {
675 if ($this->noCache === TRUE) {
676 $typolinkConfiguration[
'no_cache'] = 1;
677 } elseif ($this->useCacheHash) {
678 $typolinkConfiguration[
'useCacheHash'] = 1;
680 if ($this->section !==
'') {
683 if ($this->linkAccessRestrictedPages === TRUE) {
684 $typolinkConfiguration[
'linkAccessRestrictedPages'] = 1;
686 return $typolinkConfiguration;
698 foreach ($arguments as $argumentKey => $argumentValue) {
700 if ($argumentValue instanceof \
TYPO3\CMS\Extbase\Persistence\Generic\LazyLoadingProxy) {
701 $argumentValue = $argumentValue->_loadRealInstance();
704 $arguments[$argumentKey] = $argumentValue;
706 if ($argumentValue instanceof \
TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject) {
707 if ($argumentValue->getUid() !== NULL) {
708 $arguments[$argumentKey] = $argumentValue->getUid();
709 } elseif ($argumentValue instanceof \
TYPO3\CMS\Extbase\DomainObject\AbstractValueObject) {
712 throw new \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentValueException(
'Could not serialize Domain Object ' . get_class($argumentValue) .
'. It is neither an Entity with identity properties set, nor a Value Object.', 1260881688);
714 } elseif (is_array($argumentValue)) {
730 foreach ($object->_getProperties() as $propertyName => $propertyValue) {
731 if ($propertyValue instanceof \
TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject) {
732 if ($propertyValue->getUid() !== NULL) {
733 $result[$propertyName] = $propertyValue->getUid();
737 } elseif (is_array($propertyValue)) {
740 $result[$propertyName] = $propertyValue;
setCreateAbsoluteUri($createAbsoluteUri)
static mergeRecursiveWithOverrule(array &$original, array $overrule, $addKeys=TRUE, $includeEmptyValues=TRUE, $enableUnsetFeature=TRUE)
setAddQueryString($addQueryString)
static explodeUrl2Array($string, $multidim=FALSE)
buildTypolinkConfiguration()
removeDefaultControllerAndAction(array $controllerArguments, $extensionName, $pluginName)
setArguments(array $arguments)
convertDomainObjectsToIdentityArrays(array $arguments)
setArgumentsToBeExcludedFromQueryString(array $argumentsToBeExcludedFromQueryString)
getLinkAccessRestrictedPages()
setLinkAccessRestrictedPages($linkAccessRestrictedPages)
getAddQueryStringMethod()
setArgumentPrefix($argumentPrefix)
uriFor($actionName=NULL, $controllerArguments=array(), $controllerName=NULL, $extensionName=NULL, $pluginName=NULL)
getArgumentsToBeExcludedFromQueryString()
convertTransientObjectToArray(\TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject $object)
setAbsoluteUriScheme($absoluteUriScheme)
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
$argumentsToBeExcludedFromQueryString
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
setTargetPageUid($targetPageUid)
$linkAccessRestrictedPages
setRequest(\TYPO3\CMS\Extbase\Mvc\Request $request)
static implodeArrayForUrl($name, array $theArray, $str='', $skipBlank=FALSE, $rawurlencodeParamName=FALSE)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
setUseCacheHash($useCacheHash)
static arrayDiffAssocRecursive(array $array1, array $array2)
setAddQueryStringMethod($addQueryStringMethod)
setTargetPageType($targetPageType)