[TYPO3-core] RFC:Bug 1347 Indexed search browselist relies on javascript

Michael Stucki michael at typo3.org
Fri Jul 6 19:02:29 CEST 2007


REMINDER

Patrick Broens schrieb:
> This is a SVN patch request.
> 
> Problem:
> The page browser (browselist) in indexed_search works only with
> javascript support using onclick behaviour. You can't navigate through
> the results with disabled or missing javascript support. This is a major
> accessibility issue.
> 
> Solution:
> Make a configurable way to switch between javascript or url using GET.
> 
> Comments:
> Switch between mode using plugin.tx_indexedsearch.browseLinks_setUrl in TS.
> Fix by Thorsten Kahler and Daniel Ditgens.
> 
> Bugtracker references:
> http://bugs.typo3.org/view.php?id=1347
> 
> Branch: Trunk
> 
> Patrick
> 
> 
> ------------------------------------------------------------------------
> 
> Index: typo3/sysext/indexed_search/ext_typoscript_setup.txt
> ===================================================================
> --- typo3/sysext/indexed_search/ext_typoscript_setup.txt	(revision 2154)
> +++ typo3/sysext/indexed_search/ext_typoscript_setup.txt	(working copy)
> @@ -66,6 +66,7 @@
>  	}
>  */
>  	forwardSearchWordsInResultLink = 0
> +	browseLinks_setUrl = 0
>  
>  	# 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 2154)
> +++ typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php	(working copy)
> @@ -157,6 +157,10 @@
>  	var $lexerObj;				// Lexer object
>  	var $templateCode;			// Will hold the content of $conf['templateFile']
>  	var $hiddenFieldList = 'ext, type, defOp, media, order, group, lang, desc, results';
> +	/**
> +	 * @var	array	$pointerVars contains piVars required for page browser links
> +	 */
> +	var $pointerVars = array();
>  
>  
>  	/**
> @@ -1830,10 +1834,31 @@
>  	 * @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.'\';'.
> +		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 );
> +			$tag = '<a href="'.htmlspecialchars($url).'">'.$str.'</a>';
> +		} 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>';
> +			$url = '#';
> +			$tag = '<a href="'.$url.'" onclick="'.htmlspecialchars($onclick).'">'.$str.'</a>';
> +		}
> +		return $tag;
>  	}
>  
>  	/**


-- 
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/


More information about the TYPO3-team-core mailing list