コード例 #1
0
ファイル: UriBuilder.php プロジェクト: Mr-Robota/TYPO3.CMS
 /**
  * Builds a TypoLink configuration array from the current settings
  *
  * @return array typolink configuration array
  * @see TSref/typolink
  */
 protected function buildTypolinkConfiguration()
 {
     $typolinkConfiguration = array();
     $typolinkConfiguration['parameter'] = $this->targetPageUid !== NULL ? $this->targetPageUid : $GLOBALS['TSFE']->id;
     if ($this->targetPageType !== 0) {
         $typolinkConfiguration['parameter'] .= ',' . $this->targetPageType;
     } elseif ($this->format !== '') {
         $targetPageType = $this->extensionService->getTargetPageTypeByFormat($this->request->getControllerExtensionKey(), $this->format);
         $typolinkConfiguration['parameter'] .= ',' . $targetPageType;
     }
     if (count($this->arguments) > 0) {
         $arguments = $this->convertDomainObjectsToIdentityArrays($this->arguments);
         $this->lastArguments = $arguments;
         $typolinkConfiguration['additionalParams'] = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl(NULL, $arguments);
     }
     if ($this->addQueryString === TRUE) {
         $typolinkConfiguration['addQueryString'] = 1;
         if (count($this->argumentsToBeExcludedFromQueryString) > 0) {
             $typolinkConfiguration['addQueryString.'] = array('exclude' => implode(',', $this->argumentsToBeExcludedFromQueryString));
         }
         if ($this->addQueryStringMethod) {
             $typolinkConfiguration['addQueryString.']['method'] = $this->addQueryStringMethod;
         }
     }
     if ($this->noCache === TRUE) {
         $typolinkConfiguration['no_cache'] = 1;
     } elseif ($this->useCacheHash) {
         $typolinkConfiguration['useCacheHash'] = 1;
     }
     if ($this->section !== '') {
         $typolinkConfiguration['section'] = $this->section;
     }
     if ($this->linkAccessRestrictedPages === TRUE) {
         $typolinkConfiguration['linkAccessRestrictedPages'] = 1;
     }
     return $typolinkConfiguration;
 }