Index: typo3/sysext/indexed_search/ext_typoscript_setup.txt
===================================================================
--- typo3/sysext/indexed_search/ext_typoscript_setup.txt (revision 3457)
+++ typo3/sysext/indexed_search/ext_typoscript_setup.txt (working copy)
@@ -72,6 +72,9 @@
}
*/
forwardSearchWordsInResultLink = 0
+ browseLinks_setUrl = 0
+ browseLinks_useForms = 0
+ browseLinks_useForms.submit_params = class="tx-indexedsearch-browseLink-submit"
# Setting default values for piVars (please see the source code for the form-field names which you can preset values for here)
_DEFAULT_PI_VARS {
Index: typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php
===================================================================
--- typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php (revision 3457)
+++ typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php (working copy)
@@ -154,6 +154,7 @@
var $resultSections = array(); // Page tree sections for search result.
var $external_parsers = array(); // External parser objects
var $iconFileNameCache = array(); // Storage of icons....
+ var $pointerVars = array(); // contains piVars required for page browser links
/**
* Lexer object
@@ -703,7 +704,11 @@
// Print a message telling which words we searched for, and in which sections etc.
$what = $this->tellUsWhatIsSeachedFor($sWArr).
(substr($this->piVars['sections'],0,2)=='rl'?' '.$this->pi_getLL('inSection','',1).' "'.substr($this->getPathFromPageId(substr($this->piVars['sections'],4)),1).'"':'');
- $what = '
pi_classParam('whatis').'>'.$this->cObj->stdWrap($what, $this->conf['whatis_stdWrap.']).'
';
+ $what = ((!$this->conf['browseLinks_setUrl'] && $this->conf['browseLinks_useForms'])?
+ '':
+ ''
+ ).
+ 'pi_classParam('whatis').'>'.$this->cObj->stdWrap($what, $this->conf['whatis_stdWrap.']).'
';
$content = $what.$content;
// Return content:
@@ -1847,14 +1852,56 @@
*
* @param string String to wrap in tag
* @param integer Pointer value
- * @param string List of integers pointing to free indexing configurations to search. -1 represents no filtering, 0 represents TYPO3 pages only, any number above zero is a uid of an indexing configuration!
+ * @param string List of integers pointing to free indexing configurations to search.
+ * -1 represents no filtering, 0 represents TYPO3 pages only.
+ * Any number above zero is a uid of an indexing configuration!
* @return string Input string wrapped in tag with onclick event attribute set.
*/
- function makePointerSelector_link($str,$p,$freeIndexUid) {
- $onclick = 'document.'.$this->prefixId.'[\''.$this->prefixId.'[pointer]\'].value=\''.$p.'\';'.
+ function makePointerSelector_link($str, $p, $freeIndexUid) {
+ if ($this->conf['browseLinks_setUrl']) {
+ // create pointerVars only once
+ if (!$this->pointerVars) {
+ $this->pointerVars = $this->piVars;
+ unset($this->pointerVars['submit_button']);
+
+ // only use non-default values
+ foreach ($this->pointerVars 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->pointerVars[$var]);
+ }
+ }
+ }
+ $this->pointerVars['pointer'] = $p;
+ $url = $this->pi_linkTP_keepPIvars_url($this->pointerVars, 0, 1);
+ return ''.$str.'';
+ } elseif ($this->conf['browseLinks_useForms']) {
+ $blindForm = '';
+ foreach ($this->piVars as $key=>$value) {
+ if ($key!='pointer' && $key!='_freeIndexUid') {
+ $blindForm .= '';
+ }
+ }
+ $blindForm .= '';
+ $blindForm .= '';
+ $blindForm = ''.$blindForm.'
';
+ return '';
+ } else {
+ $onclick = 'document.'.$this->prefixId.'[\''.$this->prefixId.'[pointer]\'].value=\''.$p.'\';'.
'document.'.$this->prefixId.'[\''.$this->prefixId.'[_freeIndexUid]\'].value=\''.rawurlencode($freeIndexUid).'\';'.
'document.'.$this->prefixId.'.submit();return false;';
- return ''.$str.'';
+ return ''.$str.'';
+ }
}
/**