diff -rub indexed_search.orig//Classes/Controller/SearchFormController.php indexed_search/Classes/Controller/SearchFormController.php --- indexed_search.orig//Classes/Controller/SearchFormController.php 2013-03-07 10:29:00.000000000 +0100 +++ indexed_search/Classes/Controller/SearchFormController.php 2013-04-25 20:41:37.406059337 +0200 @@ -112,6 +112,9 @@ */ public $iconFileNameCache = array(); + // a small cache used for building the browse links + protected $pointerSelectorCache; + // Storage of icons.... /** * @todo Define visibility @@ -1746,8 +1749,68 @@ * @todo Define visibility */ public function makePointerSelector_link($str, $p, $freeIndexUid) { + $pointerSelector = ''; + + if ($this->conf['pageBrowser.']['makePointerLinksWithHref']) { + + // pointerSelector is a normal hyperlink (no JavaScript required) + if (!$this->pointerSelectorCache) { + $this->pointerSelectorCache = array(); + // create pointerSelectorCache only once, which need to be transferred as GET parameters of the URL + $this->pointerSelectorCache = $this->piVars; + unset($this->pointerSelectorCache['submit_button']); + unset($this->pointerSelectorCache['pointer']); + unset($this->pointerSelectorCache['_freeIndexUid']); + // only use non-default values + foreach ($this->pointerSelectorCache as $var => $val) { + if ( + (is_array($this->optValues[$var]) && $this->piVars[$var] == (string) array_shift(array_keys($this->optValues[$var]))) || + (isset($this->conf['_DEFAULT_PI_VARS.'][$var]) && $this->conf['_DEFAULT_PI_VARS'][$var] == $val) + ) { + unset($this->pointerSelectorCache[$var]); + } + } + } + $this->pointerSelectorCache['pointer'] = $p; + $this->pointerSelectorCache['_freeIndexUid'] = $freeIndexUid; + $linkArray = array ( + 'parameter' => $GLOBALS['TSFE']->id, + 'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $this->pointerSelectorCache) + ); + $linkArray = array_merge((array) $this->conf['pageBrowser.']['makePointerLinksWithHref.'], $linkArray); + $pointerSelector = $this->cObj->typolink($str, $linkArray); + } elseif ($this->conf['pageBrowser.']['makePointerLinksWithForm']) { + + // pointerSelector is a submit button of a pointer form (no JavaScript required; URL will stay "clean" after submission) + if (!$this->pointerSelectorCache) { + $this->pointerSelectorCache = array( + 'hiddenInputs' => '', + 'currentUrl' => '' + ); + foreach ($this->piVars as $key => $value) { + if ($key != 'pointer' && $key != '_freeIndexUid') { + $this->pointerSelectorCache['hiddenInputs'] .= ''; + } + } + $this->pointerSelectorCache['currentUrl'] = $this->cObj->getTypoLink_URL($GLOBALS['TSFE']->id, array(), '_self'); + } + $hiddenPointerForm = $this->pointerSelectorCache['hiddenInputs'] . + '' . + ''; + $pointerSelector = + '
' . + '
' . $hiddenPointerForm . '
' . + 'conf['pageBrowser.']['makePointerLinksWithForm.']['submit_params'] ? ' ' . $this->conf['pageBrowser.']['makePointerLinksWithForm.']['submit_params'] : '') . + ' />' . + '
'; + } else { + + // pointerSelector is a JavaScript onclick event (the default way) $onclick = 'document.getElementById(\'' . $this->prefixId . '_pointer\').value=\'' . $p . '\';' . 'document.getElementById(\'' . $this->prefixId . '_freeIndexUid\').value=\'' . rawurlencode($freeIndexUid) . '\';' . 'document.getElementById(\'' . $this->prefixId . '\').submit();return false;'; - return '' . $str . ''; + $pointerSelector = '' . $str . ''; + } + return $pointerSelector; } /** diff -rub indexed_search.orig//ext_typoscript_setup.txt indexed_search/ext_typoscript_setup.txt --- indexed_search.orig//ext_typoscript_setup.txt 2013-03-07 10:29:00.000000000 +0100 +++ indexed_search/ext_typoscript_setup.txt 2013-04-25 20:45:11.126059763 +0200 @@ -57,6 +57,17 @@ targetPid.data = TSFE:id } + pageBrowser { + makePointerLinksWithHref = 0 + makePointerLinksWithHref { + ATagParams = class="tx-indexedsearch-pointerLink" + } + makePointerLinksWithForm = 0 + makePointerLinksWithForm { + submit_params = class="tx-indexedsearch-pointerButton" + } + } + result_link_target = /* flagRendering = CASE