Project

General

Profile

Feature #14902 » bug-1347_03.patch

Administrator Admin, 2008-03-19 14:38

View differences:

typo3/sysext/indexed_search/ext_typoscript_setup.txt (working copy)
}
*/
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 {
typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php (working copy)
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
......
// 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 = '<div'.$this->pi_classParam('whatis').'>'.$this->cObj->stdWrap($what, $this->conf['whatis_stdWrap.']).'</div>';
$what = ((!$this->conf['browseLinks_setUrl'] && $this->conf['browseLinks_useForms'])?
'<a id ="tx-indexedsearch-browseresults-anchor" name="tx-indexedsearch-browseresults-anchor"></a>':
''
).
'<div'.$this->pi_classParam('whatis').'>'.$this->cObj->stdWrap($what, $this->conf['whatis_stdWrap.']).'</div>';
$content = $what.$content;
// Return content:
......
*
* @param string String to wrap in <a> 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 <a> 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 '<a href="'.htmlspecialchars($url).'">'.$str.'</a>';
} elseif ($this->conf['browseLinks_useForms']) {
$blindForm = '';
foreach ($this->piVars as $key=>$value) {
if ($key!='pointer' && $key!='_freeIndexUid') {
$blindForm .= '<input type="hidden" name="'.$this->prefixId.'['.$key.']" value="'.$value.'" />';
}
}
$blindForm .= '<input type="hidden" name="'.$this->prefixId.'[pointer]" value='.$p.'" />';
$blindForm .= '<input type="hidden" name="'.$this->prefixId.'[_freeIndexUid]" value='.$freeIndexUid.'" />';
$blindForm = '<div style="display:none;">'.$blindForm.'</div>';
return '<form method="post" class="tx-indexedsearch-browseresults-form" action="'.
$this->cObj->getTypoLink_URL(
$GLOBALS['TSFE']->id,
array(),
'_self'
).'#tx-indexedsearch-browseresults-anchor">'.
$blindForm.
'<input type="submit" value="'.$str.'" title="'.$str.'"'.(
$this->conf['browseLinks_useForms.']['submit_params'] ? ' '.$this->conf['browseLinks_useForms.']['submit_params'] : ''
).' />'.
'</form>';
} 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 '<a href="#" onclick="'.htmlspecialchars($onclick).'">'.$str.'</a>';
return '<a href="#" onclick="'.htmlspecialchars($onclick).'">'.$str.'</a>';
}
}
/**
(4-4/5)