Feature #19465 » indexed_search_pluginconfiguration_v4.diff

Administrator Admin, 2009-03-03 14:01

View differences:

typo3/sysext/indexed_search/ext_emconf.php (working copy)
32 32
	'author_company' => 'Curby Soft Multimedia',
33 33
	'CGLcompliance' => '',
34 34
	'CGLcompliance_note' => '',
35
	'version' => '2.12.0',
35
	'version' => '2.13.0',
36 36
	'_md5_values_when_last_written' => 'a:54:{s:9:"ChangeLog";s:4:"b02b";s:17:"class.crawler.php";s:4:"df89";s:25:"class.doublemetaphone.php";s:4:"8d81";s:25:"class.external_parser.php";s:4:"7ed5";s:17:"class.indexer.php";s:4:"044d";s:15:"class.lexer.php";s:4:"ac05";s:21:"ext_conf_template.txt";s:4:"0c64";s:12:"ext_icon.gif";s:4:"4cbf";s:17:"ext_localconf.php";s:4:"732c";s:14:"ext_tables.php";s:4:"9bda";s:14:"ext_tables.sql";s:4:"f9e0";s:28:"ext_typoscript_editorcfg.txt";s:4:"0a34";s:24:"ext_typoscript_setup.txt";s:4:"c2e7";s:13:"locallang.xml";s:4:"0a76";s:26:"locallang_csh_indexcfg.xml";s:4:"f4f3";s:16:"locallang_db.xml";s:4:"2c55";s:7:"tca.php";s:4:"8991";s:29:"example/class.crawlerhook.php";s:4:"0ce8";s:24:"example/class.pihook.php";s:4:"e221";s:12:"cli/conf.php";s:4:"bbcd";s:21:"cli/indexer_cli.phpsh";s:4:"d236";s:44:"modfunc2/class.tx_indexedsearch_modfunc2.php";s:4:"b531";s:22:"modfunc2/locallang.xml";s:4:"a889";s:44:"modfunc1/class.tx_indexedsearch_modfunc1.php";s:4:"9fb3";s:22:"modfunc1/locallang.xml";s:4:"4806";s:29:"pi/class.tx_indexedsearch.php";s:4:"56ef";s:21:"pi/considerations.txt";s:4:"e3df";s:22:"pi/indexed_search.tmpl";s:4:"7ada";s:16:"pi/locallang.xml";s:4:"f62f";s:20:"pi/template_css.tmpl";s:4:"a2e2";s:14:"pi/res/csv.gif";s:4:"e413";s:14:"pi/res/doc.gif";s:4:"0975";s:15:"pi/res/html.gif";s:4:"5647";s:14:"pi/res/jpg.gif";s:4:"23ac";s:17:"pi/res/locked.gif";s:4:"c212";s:16:"pi/res/pages.gif";s:4:"1923";s:14:"pi/res/pdf.gif";s:4:"9451";s:14:"pi/res/pps.gif";s:4:"926b";s:14:"pi/res/ppt.gif";s:4:"ada5";s:14:"pi/res/rtf.gif";s:4:"f660";s:14:"pi/res/sxc.gif";s:4:"00a6";s:14:"pi/res/sxi.gif";s:4:"ef83";s:14:"pi/res/sxw.gif";s:4:"4a8f";s:14:"pi/res/tif.gif";s:4:"533b";s:14:"pi/res/txt.gif";s:4:"c576";s:14:"pi/res/xls.gif";s:4:"4a22";s:14:"pi/res/xml.gif";s:4:"2e7b";s:13:"mod/clear.gif";s:4:"cc11";s:12:"mod/conf.php";s:4:"9062";s:13:"mod/index.php";s:4:"4dbd";s:15:"mod/isearch.gif";s:4:"4cbf";s:21:"mod/locallang_mod.xml";s:4:"1624";s:14:"doc/README.txt";s:4:"a737";s:12:"doc/TODO.txt";s:4:"c804";}',
37 37
	'constraints' => array(
38 38
		'depends' => array(
typo3/sysext/indexed_search/ext_localconf.php (working copy)
2 2
if (!defined ('TYPO3_MODE')) 	die ('Access denied.');
3 3

  
4 4
t3lib_extMgm::addPItoST43($_EXTKEY);
5
t3lib_extMgm::addPItoST43($_EXTKEY . 'box');
5 6

  
6 7
t3lib_extMgm::addTypoScript($_EXTKEY,'editorcfg','
7 8
	tt_content.CSS_editor.ch.tx_indexedsearch = < plugin.tx_indexedsearch.CSS_editor
......
62 63
/*
63 64
	$TYPO3_CONF_VARS['EXTCONF']['indexed_search']['crawler']['tx_myext_example1'] = 'EXT:indexed_search/example/class.crawlerhook.php:&tx_indexedsearch_crawlerhook';
64 65
*/
65
?>
66
?>
typo3/sysext/indexed_search/ext_tables.php (working copy)
1 1
<?php
2 2
if (!defined ('TYPO3_MODE')) 	die ('Access denied.');
3 3

  
4
t3lib_extMgm::addPlugin(Array('LLL:EXT:indexed_search/locallang.php:mod_indexed_search', $_EXTKEY));
4
t3lib_extMgm::addPlugin(Array('LLL:EXT:indexed_search/locallang.xml:mod_indexed_search', $_EXTKEY));
5
t3lib_extMgm::addPlugin(Array('LLL:EXT:indexed_search/locallang.xml:mod_indexed_search_box', $_EXTKEY . 'box'));
5 6

  
6 7
t3lib_div::loadTCA('tt_content');
7 8
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY] = 'layout,select_key,pages';
9
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY . '_box'] = 'layout,select_key,recursive';
10
$TCA['tt_content']['types']['list']['subtypes_addlist'][$_EXTKEY] = 'pi_flexform';
11
$TCA['tt_content']['types']['list']['subtypes_addlist'][$_EXTKEY. '_box'] = 'pi_flexform';
12
t3lib_extMgm::addPiFlexFormValue($_EXTKEY ,'FILE:EXT:'.$_EXTKEY.'/flexform.xml');
13
t3lib_extMgm::addPiFlexFormValue($_EXTKEY. '_box' ,'FILE:EXT:'.$_EXTKEY.'/flexform_box.xml');
8 14

  
9 15
if (TYPO3_MODE=='BE')    {
10 16
	t3lib_extMgm::addModule('tools','isearch','after:log',t3lib_extMgm::extPath($_EXTKEY).'mod/');
......
57 63
	$TCA['index_config']['types']['tx_myext_example1'] = $TCA['index_config']['types']['0'];
58 64
*/
59 65

  
60
?>
66
?>
typo3/sysext/indexed_search/ext_typoscript_setup.txt (working copy)
5 5
plugin.tx_indexedsearch {
6 6
	templateFile = EXT:indexed_search/pi/indexed_search.tmpl
7 7

  
8
	# what section should be displayed
9
	code = form,rules,results
10
	
11
	# if results should be outputted on a different page, define the pid for the result page here
12
	resultPid = 
13
	
8 14
	show {
15
		form = 1
9 16
		rules = 1
17
		results = 1
10 18
		parsetimes = 0
11 19
		L2sections = 0
12 20
		L1sections = 1
......
41 49
	}
42 50
	path_stdWrap {
43 51
	}
52
	# Display the searchword in results, like: Search for "searchword"
53
	whatIs_stdWrap {
54
		wrap = <div class="tx-indexedsearch-whatis">|</div>	
55
	}
56
	searchWord_stdWrap {
57
		wrap = <span class="tx-indexedsearch-sw">"|"</span>
58
	}
59
	markup_stdWrap {
60
		wrap = <strong class="tx-indexedsearch-redMarkup">|</strong>
61
	}
62
	# Paging
63
	resultsPerPage = 10
64
	
65
	pageBrowser {
66
		doNotLinkCurrent = 1
67
		general_stdWrap {
68
			wrap = <ul class="browsebox">|</ul>
69
		}
70
		previous_stdWrap {
71
			wrap = <li>|</li>
72
		}
73
		next_stdWrap {
74
			wrap = <li>|</li>
75
		}
76
		pages_stdWrap {
77
			wrap = <li>|</li>
78
		}
79
		current_stdWrap {
80
			wrap = <li class="tx-indexedsearch-browselist-currentPage"><strong>|</strong></li>
81
		}
82
		pageLinks_stdWrap {
83
			preCObject = TEXT
84
			preCObject.data = LLL:EXT:indexed_search/pi/locallang.xml:pi_list_browseresults_page
85
			preCObject.noTrimWrap = | ||
86
		}
87
	}
44 88
	search {
45 89
		rootPidList =
46 90
		page_links = 10
......
106 150
	_LOCAL_LANG {
107 151
	}
108 152
}
153

  
154
plugin.tx_indexedsearchbox < plugin.tx_indexedsearch
155
plugin.tx_indexedsearchbox.code = form
typo3/sysext/indexed_search/locallang.xml (working copy)
6 6
	</meta>
7 7
	<data type="array">
8 8
		<languageKey index="default" type="array">
9
			<label index="mod_indexed_search">Indexed search</label>
10
			<label index="mod2_indexed_search">Indexed search statistics</label>
9
			<label index="mod_indexed_search">Indexed Search</label>
10
			<label index="mod_indexed_search_box">Searchbox for Indexed Search</label>
11
			<label index="mod2_indexed_search">Indexed Search statistics</label>
12
			<label index="flexform_indexed_search.sheetTitle">Indexed Search settings</label>
13
			<label index="flexform_indexed_search.showForm">Show searchform</label>
14
			<label index="flexform_indexed_search.extendedForm">Extended searchform</label>
15
			<label index="flexform_indexed_search.showRules">Show rules</label>
16
			<label index="flexform_indexed_search.showResults">Show results</label>
17
			<label index="flexform_indexed_search_box.sheetTitle">Searchbox settings</label>
18
			<label index="flexform_indexed_search_box.extendedForm">Extended searchform</label>
11 19
			<label index="ignoreExtensions">Extension %s was set to be ignored.</label>
12 20
			<label index="pdfToolsNotFound">PDF tools was not found in paths '%1$spdftotext' and/or '%1$spdfinfo'"</label>
13 21
			<label index="pdfToolsDisabled">PDF tools disabled</label>
typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php (working copy)
144 144
		// Internals:
145 145
	var $sWArr = array();			// Search Words and operators
146 146
	var $optValues = array();		// Selector box values for search configuration form
147
	var $firstRow = Array();		// Will hold the first row in result - used to calculate relative hit-ratings.
147
	var $firstRow = array();		// Will hold the first row in result - used to calculate relative hit-ratings.
148 148

  
149
	var $code = '';					// Given code for render
150
	
149 151
	var $cache_path = array();		// Caching of page path
150 152
	var $cache_rl = array();		// Caching of root line data
151 153
	var $fe_groups_required = array();	// Required fe_groups memberships for display of a result.
......
185 187
		$this->conf = $conf;
186 188
		$this->pi_loadLL();
187 189
		$this->pi_setPiVarDefaults();
190
		$this->pi_initPIflexForm(); 
188 191

  
189 192
			// Initialize the indexer-class - just to use a few function (for making hashes)
190 193
		$this->indexerObj = t3lib_div::makeInstance('tx_indexedsearch_indexer');
......
192 195
			// Initialize:
193 196
		$this->initialize();
194 197

  
195
			// Do search:
196
			// If there were any search words entered...
197
		if (is_array($this->sWArr))	{
198
			$content = $this->doSearch($this->sWArr);
198
			// Finally compile all the content, form, messages and results:
199
		$this->code = t3lib_div::trimExplode(',', $this->conf['code'],true);
200
		if (!is_array($this->code)) {
201
			return '';
199 202
		}
203
		
204
		$content = '';
205
		foreach ($this->code as $c) {
206
			switch (t3lib_div::strtolower($c)) {
207
				case 'form':
208
					// if conf has only 'form' it's the plugin indexedsearch_box which needs the form all the time,
209
					// when code has more components, make it dependend from the setting 'showForm'
210
					if ($this->conf['code'] != 'form' && !$this->conf['show.']['form']) {
211
						break;
212
					} 
213
					$content .= $this->makeSearchForm($this->optValues);
214
					break;
215
				case 'rules':
216
					if ($this->conf['show.']['rules']) {
217
						$content .= $this->printRules();
218
					}
219
					break;
220
				case 'results':
221
					if ($this->conf['show.']['results']) {
222
						// Do search, if there were any search words entered...
223
						if (is_array($this->sWArr))	{
224
							$content .= $this->doSearch($this->sWArr);
225
						}
226
					}
227
					break;
228
			}
229
		}
200 230

  
201
			// Finally compile all the content, form, messages and results:
202
		$content = $this->makeSearchForm($this->optValues).
203
			$this->printRules().
204
			$content;
231
		return $this->pi_wrapInBaseClass($content);
232
	}
205 233

  
206
        return $this->pi_wrapInBaseClass($content);
207
    }
208

  
209 234
	/**
210 235
	 * Initialize internal variables, especially selector box values for the search form and search words
211 236
	 *
......
214 239
	function initialize()	{
215 240
		global $TYPO3_CONF_VARS;
216 241

  
242
		// use flexfom settings to overwrite conf
243
		if ($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'extendedForm', 'sVIEW')) {
244
			$this->piVars['ext'] = 1;
245
		}
246
		
247
		if ($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'showForm', 'sVIEW')){
248
			$this->conf['show.']['form'] = 1;
249
		}
250
		
251
		if ($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'showRules', 'sVIEW')) {
252
			$this->conf['show.']['rules'] = 1;
253
		}
254
		
255
		if ($this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'showResult', 'sVIEW')) {
256
			$this->conf['show.']['results'] = 1;
257
		}
258
		
259
		if (intval($this->cObj->data['pages'])) {
260
			$this->conf['resultPid'] = intval($this->cObj->data['pages']);
261
		}
262
		
263
		if (!isset($this->conf['resultPid'])) {
264
			$this->conf['resultPid'] = $GLOBALS['TSFE']->id;
265
		}
266
		
217 267
			// Initialize external document parsers for icon display and other soft operations
218 268
		if (is_array($TYPO3_CONF_VARS['EXTCONF']['indexed_search']['external_parsers']))	{
219 269
			foreach ($TYPO3_CONF_VARS['EXTCONF']['indexed_search']['external_parsers'] as $extension => $_objRef)	{
......
243 293
			$this->piVars['sword'] = trim($this->piVars['sword_prev']).' '.$this->piVars['sword'];
244 294
		}
245 295

  
246
		$this->piVars['results'] = t3lib_div::intInRange($this->piVars['results'],1,100000,$this->defaultResultNumber);
296
		$this->piVars['results'] = t3lib_div::intInRange($this->piVars['results'], 1, 100000, $this->conf['resultsPerPage']);
247 297

  
248 298
			// Selector-box values defined here:
249 299
		$this->optValues = Array(
......
667 717
	 * @return	string		HTML content to display result.
668 718
	 */
669 719
	function getDisplayResults($sWArr, $resData, $freeIndexUid=-1)	{
720
		
721
		$markerArray = array();
722
		$html_results = $this->cObj->getSubpart($this->templateCode, '###SEARCH_RESULTS###');
723
		$html_no_results = $this->cObj->getSubpart($this->templateCode, '###SEARCH_NO_RESULTS###');
724
		
725
			// Print a message telling which words we searched for, and in which sections etc.
726
		$what = $this->tellUsWhatIsSeachedFor($sWArr) .
727
				(substr($this->piVars['sections'], 0, 2) == 'rl' ? ' ' . $this->pi_getLL('inSection', '', 1) . ' "' . 
728
				 substr($this->getPathFromPageId(substr($this->piVars['sections'], 4)), 1) . '"' : '');
729
		$markerArray['###WHATIS###'] = $this->cObj->stdWrap($what, $this->conf['whatis_stdWrap.']);
730
		$markerArray['###SEARCH_FOR###'] = $this->tellUsWhatIsSeachedFor($sWArr);
731
		
670 732
			// Perform display of result rows array:
671 733
		if ($resData)	{
672 734
			$GLOBALS['TT']->push('Display Final result');
......
675 737
			$this->firstRow = $resData['firstRow'];
676 738

  
677 739
				// Result display here:
678
			$rowcontent = '';
679
			$rowcontent.= $this->compileResult($resData['resultRows'], $freeIndexUid);
740
			$markerArray['###RESULTS###'] = $this->compileResult($resData['resultRows'], $freeIndexUid);     
680 741

  
681 742
				// Browsing box:
682 743
			if ($resData['count'])	{
......
684 745
				$this->internal['results_at_a_time'] = $this->piVars['results'];
685 746
				$this->internal['maxPages'] = t3lib_div::intInRange($this->conf['search.']['page_links'],1,100,10);
686 747
				$addString = ($resData['count']&&$this->piVars['group']=='sections'&&$freeIndexUid<=0 ? ' '.sprintf($this->pi_getLL(count($this->resultSections)>1?'inNsections':'inNsection'),count($this->resultSections)):'');
687
				$browseBox1 = $this->pi_list_browseresults(1,$addString,$this->printResultSectionLinks(),$freeIndexUid);
688
				$browseBox2 = $this->pi_list_browseresults(0,'','',$freeIndexUid);
748
				$markerArray['###BROWSE_BOX_TOP###'] = $this->pi_list_browseresults(1, $addString, $this->printResultSectionLinks(), $freeIndexUid);
749
				$markerArray['###BROWSE_BOX_BOTTOM###'] = $this->pi_list_browseresults(0, '', '', $freeIndexUid);
689 750
			}
690 751

  
691 752
				// Browsing nav, bottom.
753
				// Browsing nav, bottom.
692 754
			if ($resData['count'])	{
693
				$content = $browseBox1.$rowcontent.$browseBox2;
755
				$content = $this->cObj->substituteMarkerArrayCached($html_results, $markerArray, array(), array());       
694 756
			} else {
695
				$content = '<p'.$this->pi_classParam('noresults').'>'.$this->pi_getLL('noResults','',1).'</p>';
757
				$markerArray['###CLASS###'] = $this->pi_classParam('noresults');
758
				$markerArray['###NO_RESULT_MESSAGE###'] = $this->pi_getLL('noResults','',1);
759
				$content = $this->cObj->substituteMarkerArrayCached($html_no_results, $markerArray, array(), array());
696 760
			}
697 761

  
698 762
			$GLOBALS['TT']->pull();
699 763
		} else {
700
			$content.='<p'.$this->pi_classParam('noresults').'>'.$this->pi_getLL('noResults','',1).'</p>';
764
			$markerArray['###CLASS###'] = $this->pi_classParam('noresults');
765
			$markerArray['###NO_RESULT_MESSAGE###'] = $this->pi_getLL('noResults','',1);
766
			$content = $this->cObj->substituteMarkerArrayCached($html_no_results, $markerArray, array(), array());
701 767
		}
702 768

  
703
			// Print a message telling which words we searched for, and in which sections etc.
704
		$what = $this->tellUsWhatIsSeachedFor($sWArr).
705
				(substr($this->piVars['sections'],0,2)=='rl'?' '.$this->pi_getLL('inSection','',1).' "'.substr($this->getPathFromPageId(substr($this->piVars['sections'],4)),1).'"':'');
706
		$what = '<div'.$this->pi_classParam('whatis').'>'.$this->cObj->stdWrap($what, $this->conf['whatis_stdWrap.']).'</div>';
707
		$content = $what.$content;
769
		
708 770

  
709 771
			// Return content:
710 772
		return $content;
......
1112 1174
					across different queries on the same index. Score for each document is
1113 1175
					computed using the standard Salton formula:
1114 1176

  
1115
					    3f(1+log(N/n))
1177
						3f(1+log(N/n))
1116 1178

  
1117 1179
					Where f is the frequency of the search term in the document, N is the total
1118 1180
					number of rows in the table, and n is the number of rows which contain the
......
1345 1407
			$html = $this->cObj->substituteSubpart($html, '###ADDITONAL_KEYWORD###', '');
1346 1408
		}
1347 1409

  
1348
		$markerArray['###ACTION_URL###'] = htmlspecialchars($this->pi_getPageLink($GLOBALS['TSFE']->id, $GLOBALS['TSFE']->sPre));
1410
		$markerArray['###ACTION_URL###'] = htmlspecialchars($this->pi_getPageLink($this->conf['resultPid'], $GLOBALS['TSFE']->sPre));
1349 1411

  
1350 1412
		$hiddenFieldCode = $this->cObj->getSubpart($this->templateCode, '###HIDDEN_FIELDS###');
1351 1413
		$hiddenFieldCode = preg_replace('/^\n\t(.+)/ms', '$1', $hiddenFieldCode);		// Remove first newline and tab (cosmetical issue)
......
1464 1526
			// Write all hidden fields
1465 1527
		$html = $this->cObj->substituteSubpart($html, '###HIDDEN_FIELDS###', implode('',$hiddenFieldArr));
1466 1528

  
1467
		$substitutedContent = $this->cObj->substituteMarkerArrayCached($html, $markerArray, array(), array());
1529
		return $this->cObj->substituteMarkerArrayCached($html, $markerArray, array(), array());
1530
	}
1531
	
1532
	/**
1533
	 * Make hidden search form HTML. This form is needed when page browser is displayed.
1534
	 *
1535
	 * @param	array		Value/Labels pairs for search form selector boxes.
1536
	 * @return	string		Search form HTML
1537
	 */
1538
	function makeHiddenSearchForm($optValues) {
1539
		$html = $this->cObj->getSubpart($this->templateCode, '###SEARCH_FORM_HIDDEN###');
1540
		
1541
		$markerArray['###ACTION_URL###'] = htmlspecialchars($this->pi_getPageLink($this->conf['resultPid'], $GLOBALS['TSFE']->sPre));
1468 1542

  
1469
		return $substitutedContent;
1543
		$hiddenFieldCode = $this->cObj->getSubpart($this->templateCode, '###HIDDEN_FIELDS###');
1544
		$hiddenFieldCode = preg_replace('/^\n\t(.+)/ms', '$1', $hiddenFieldCode);		// Remove first newline and tab (cosmetical issue)
1545
		$hiddenFieldArr = array();
1546

  
1547
		// put search params to hidden fields
1548
		$hiddenFieldList = $this->hiddenFieldList . ',sword';
1549
		
1550
		foreach (t3lib_div::trimExplode(',', $hiddenFieldList) as $fieldName)	{
1551
			$hiddenFieldMarkerArray = array();
1552
			$hiddenFieldMarkerArray['###HIDDEN_FIELDNAME###'] = $this->prefixId.'['.$fieldName.']';
1553
			$hiddenFieldMarkerArray['###HIDDEN_VALUE###'] = htmlspecialchars((string)$this->piVars[$fieldName]);
1554

  
1555
			$hiddenFieldArr[$fieldName] = $this->cObj->substituteMarkerArrayCached($hiddenFieldCode, $hiddenFieldMarkerArray, array(), array());
1556
		}
1557
		
1558
		
1559
		
1560
		// Write all hidden fields
1561
		$html = $this->cObj->substituteSubpart($html, '###HIDDEN_FIELDS###', implode('', $hiddenFieldArr));
1562

  
1563
		return $this->cObj->substituteMarkerArrayCached($html, $markerArray, array(), array());
1564
		
1565
		
1470 1566
	}
1471 1567

  
1472 1568
	/**
......
1638 1734
	 * @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!
1639 1735
	 * @return	string		HTML output
1640 1736
	 */
1641
	function pi_list_browseresults($showResultCount=1,$addString='',$addPart='',$freeIndexUid=-1)	{
1737
	function pi_list_browseresults($renderTopBrowseBox=1, $addString='', $addPart='', $freeIndexUid=-1)	{
1642 1738

  
1739
		$markerArray = $subpartArray = array();
1740
		$html = $this->cObj->getSubpart($this->templateCode, '###BROWSE_BOX_' . ($renderTopBrowseBox ? 'TOP' : 'BOTTOM') . '###');  
1741
		$browseLinks = $this->cObj->getSubpart($html, '###BROWSE_LINKS###');
1742
		
1643 1743
			// Initializing variables:
1644 1744
		$pointer=$this->piVars['pointer'];
1645 1745
		$count=$this->internal['res_count'];
......
1649 1749
		$sTables = '';
1650 1750

  
1651 1751
		if ($pageCount > 1)	{	// only show the result browser if more than one page is needed
1652
			$pointer=intval($pointer);
1653
			$links=array();
1654

  
1752
			
1753
			// look if form is present, if not display a hidden form
1754
			$markerArray['###HIDDENFORM###'] = (in_array('form', $this->code) && $this->conf['show.']['form']) ? '' : $this->makeHiddenSearchForm($this->optValues);
1755
			
1756
			$pointer = intval($pointer);
1757
			
1655 1758
				// Make browse-table/links:
1656 1759
			if ($pointer>0)	{	// all pages after the 1st one
1657
				$links[]='<li>'.$this->makePointerSelector_link($this->pi_getLL('pi_list_browseresults_prev','< Previous',1),$pointer-1,$freeIndexUid).'</li>';
1760
				$markerArray['###PREVIOUS###'] = $this->cObj->stdWrap($this->makePointerSelector_link($this->pi_getLL('pi_list_browseresults_prev','< Previous', 1), $pointer - 1, $freeIndexUid), $this->conf['pageBrowser.']['previous_stdWrap.']);
1761
			} else {
1762
				$markerArray['###PREVIOUS###'] = '';
1658 1763
			}
1659

  
1660
			for($a=0;$a<$pageCount;$a++)	{
1661
				$min = max(0, $pointer+1-ceil($maxPages/2));
1662
				$max = $min+$maxPages;
1663
				if($max>$pageCount)	{
1664
					$min = $min - ($max-$pageCount);
1764
			$markerArray['###PAGES###'] = '';
1765
			for($a=0; $a<$pageCount; $a++)	{
1766
				$min = max(0, $pointer +1 - ceil($maxPages / 2));
1767
				$max = $min + $maxPages;
1768
				if($max > $pageCount)	{
1769
					$min = $min - ($max - $pageCount);
1665 1770
				}
1666

  
1771
				 
1772
				$linkText = $this->cObj->stdWrap($a+1, $this->conf['pageBrowser.']['pageLinks_stdWrap.']);
1667 1773
				if($a >= $min && $a < $max)	{
1668
					if($a==$pointer)	{
1669
						$links[]='<li'.$this->pi_classParam('browselist-currentPage').'><strong>'.$this->makePointerSelector_link(trim($this->pi_getLL('pi_list_browseresults_page','Page',1).' '.($a+1)),$a,$freeIndexUid).'</strong></li>';
1774
					if($a == $pointer)	{   //current
1775
						$markerArray['###PAGES###'] .= $this->cObj->stdWrap($this->conf['pageBrowser.']['doNotLinkCurrent'] ? $linkText : $this->makePointerSelector_link($linkText, $a, $freeIndexUid), $this->conf['pageBrowser.']['current_stdWrap.']); 
1670 1776
					} else {
1671
						$links[]='<li>'.$this->makePointerSelector_link(trim($this->pi_getLL('pi_list_browseresults_page','Page',1).' '.($a+1)),$a,$freeIndexUid).'</li>';
1777
						$markerArray['###PAGES###'] .= $this->cObj->stdWrap($this->makePointerSelector_link($linkText, $a, $freeIndexUid), $this->conf['pageBrowser.']['pages_stdWrap.']); 
1672 1778
					}
1673 1779
				}
1674 1780
			}
1675
			if ($pointer+1 < $pageCount)	{
1676
				$links[]='<li>'.$this->makePointerSelector_link($this->pi_getLL('pi_list_browseresults_next','Next >',1),$pointer+1,$freeIndexUid).'</li>';
1781
			if ($pointer + 1 < $pageCount)	{
1782
				$markerArray['###NEXT###'] = $this->cObj->stdWrap($this->makePointerSelector_link($this->pi_getLL('pi_list_browseresults_next','Next >', 1), $pointer + 1, $freeIndexUid), $this->conf['pageBrowser.']['next_stdWrap.']);
1783
			} else {
1784
				$markerArray['###NEXT###'] =  '';
1677 1785
			}
1786
			$subpartArray['###BROWSE_LINKS###'] = $this->cObj->stdWrap($this->cObj->substituteMarkerArrayCached($browseLinks, $markerArray, array(), array()), $this->conf['pageBrowser.']['general_stdWrap.']);
1787
		} else {
1788
			$subpartArray['###BROWSE_LINKS###'] = '';
1678 1789
		}
1790
		
1791
		
1792
		$pR1 = $pointer * $results_at_a_time + 1;
1793
		$pR2 = $pointer * $results_at_a_time + $results_at_a_time;
1794
		
1679 1795

  
1680
		$pR1 = $pointer*$results_at_a_time+1;
1681
		$pR2 = $pointer*$results_at_a_time+$results_at_a_time;
1682
		if(is_array($links))	{
1683
			$addPart .= '
1684
		<ul class="browsebox">
1685
			'.implode('',$links).'
1686
		</ul>';
1687
		}
1688

  
1689 1796
		$label = $this->pi_getLL('pi_list_browseresults_display','Displaying results ###TAG_BEGIN###%s to %s###TAG_END### out of ###TAG_BEGIN###%s###TAG_END###');
1690 1797
		$label = str_replace('###TAG_BEGIN###','<strong>',$label);
1691 1798
		$label = str_replace('###TAG_END###','</strong>',$label);
1692 1799

  
1693
		$sTables = '<div'.$this->pi_classParam('browsebox').'>'.
1694
			($showResultCount ? '<p>'.sprintf(
1800
		$markerArray['###RESULTCOUNT###'] = sprintf(
1695 1801
				$label,
1696 1802
				$pR1,
1697 1803
				min(array($this->internal['res_count'],$pR2)),
1698
				$this->internal['res_count']
1699
				).$addString.'</p>':''
1700
			).$addPart.'</div>';
1701

  
1702
		return $sTables;
1804
				$this->internal['res_count']);
1805
				
1806
		$markerArray['###ADDSTRING###'] = $addString;
1807
		$markerArray['###ADDPART###'] = $addPart;
1808
		
1809
		return $this->cObj->substituteMarkerArrayCached($html, $markerArray, $subpartArray, array());
1703 1810
	}
1704 1811

  
1705 1812

  
......
1791 1898
			if ($c)	{
1792 1899
				switch($v['oper'])	{
1793 1900
					case 'OR':
1794
						$searchingFor.= ' '.$this->pi_getLL('searchFor_or','',1).' '.$this->wrapSW($this->utf8_to_currentCharset($v['sword']));
1901
						$searchingFor .= ' ' . $this->pi_getLL('searchFor_or', '', 1) . ' ' . $this->cObj->stdWrap($this->utf8_to_currentCharset($v['sword']), $this->conf['searchWord_stdWrap.']);
1795 1902
					break;
1796 1903
					case 'AND NOT':
1797
						$searchingFor.= ' '.$this->pi_getLL('searchFor_butNot','',1).' '.$this->wrapSW($this->utf8_to_currentCharset($v['sword']));
1904
						$searchingFor .= ' ' . $this->pi_getLL('searchFor_butNot', '', 1) . ' ' . $this->cObj->stdWrap($this->utf8_to_currentCharset($v['sword']), $this->conf['searchWord_stdWrap.']);
1798 1905
					break;
1799 1906
					default:	// AND...
1800
						$searchingFor.= ' '.$this->pi_getLL('searchFor_and','',1).' '.$this->wrapSW($this->utf8_to_currentCharset($v['sword']));
1907
						$searchingFor .= ' ' . $this->pi_getLL('searchFor_and', '', 1) . ' ' . $this->cObj->stdWrap($this->utf8_to_currentCharset($v['sword']), $this->conf['searchWord_stdWrap.']);
1801 1908
					break;
1802 1909
				}
1803 1910
			} else {
1804
				$searchingFor = $this->pi_getLL('searchFor','',1).' '.$this->wrapSW($this->utf8_to_currentCharset($v['sword']));
1911
				$searchingFor = $this->pi_getLL('searchFor','',1).' '.$this->cObj->stdWrap($this->utf8_to_currentCharset($v['sword']), $this->conf['searchWord_stdWrap.']);
1805 1912
			}
1806 1913
			$c++;
1807 1914
		}
......
1809 1916
	}
1810 1917

  
1811 1918
	/**
1812
	 * Wraps the search words in the search-word list display (from ->tellUsWhatIsSeachedFor())
1813
	 *
1814
	 * @param	string		search word to wrap (in local charset!)
1815
	 * @return	string		Search word wrapped in <span> tag.
1816
	 */
1817
	function wrapSW($str)	{
1818
		return '"<span'.$this->pi_classParam('sw').'>'.htmlspecialchars($str).'</span>"';
1819
	}
1820

  
1821
	/**
1822 1919
	 * Makes a selector box
1823 1920
	 *
1824 1921
	 * @param	string		Name of selector box
......
2048 2145
				}
2049 2146
			} else {
2050 2147
				$summaryLgd+= $GLOBALS['TSFE']->csConvObj->strlen('utf-8',$strP);
2051
				$output[$k] = '<strong class="tx-indexedsearch-redMarkup">'.htmlspecialchars($parts[$k]).'</strong>';
2148
				$output[$k] = $this->cObj->stdWrap(htmlspecialchars($parts[$k]), $this->conf['markup_stdWrap.']); 
2052 2149
			}
2053 2150
		}
2054 2151

  
typo3/sysext/indexed_search/pi/indexed_search.tmpl (working copy)
254 254
<!-- ###RESULT_OUTPUT### end -->
255 255
<br /><br />
256 256

  
257
<h2>TEMPLATE_SEARCH_FORM_INVISIBLE</h2>
258
<p><em>Template for hidden search form used by page browser</em></p>
257 259

  
260
<!-- ###SEARCH_FORM_HIDDEN### begin -->
261
<div style="display:none">
262
	<form action="###ACTION_URL###" method="post" name="tx_indexedsearch">
263
		<input type="hidden" name="tx_indexedsearch[_sections]" value="0" />
264
		<input type="hidden" name="tx_indexedsearch[_freeIndexUid]" value="_" />
265
		<input type="hidden" name="tx_indexedsearch[pointer]" value="0" />
266
		<!-- ###HIDDEN_FIELDS### begin -->
267
		<input type="hidden" name="###HIDDEN_FIELDNAME###" value="###HIDDEN_VALUE###" />
268
		<!-- ###HIDDEN_FIELDS### end -->
269
	<form>
270
</div>
271
 <!-- ###SEARCH_FORM_HIDDEN### end -->
272
 
273
<!-- ###BROWSE_BOX_TOP### begin-->
274
<div class="tx-indexedsearch-browsebox">
275
<p>###RESULTCOUNT### ###ADDSTRING###</p>
276
###ADDPART###
277
<!-- ###BROWSE_LINKS### -->###PREVIOUS### ###PAGES### ###NEXT###<!-- ###BROWSE_LINKS### -->
278
</div>
279
<!-- ###BROWSE_BOX_TOP### end-->
280

  
281
<!-- ###BROWSE_BOX_BOTTOM### begin-->
282
<div class="tx-indexedsearch-browsebox"> 
283
<!-- ###BROWSE_LINKS### -->###PREVIOUS### ###PAGES### ###NEXT###<!-- ###BROWSE_LINKS### -->
284
</div>
285
<!-- ###BROWSE_BOX_BOTTOM### end-->
286

  
287

  
288

  
289
<h2>Search Results</h2>
290
<! -- ###SEARCH_RESULTS### begin--> 
291
###WHATIS###   
292
###BROWSE_BOX_TOP###
293
###RESULTS###
294
###BROWSE_BOX_BOTTOM###
295
<! -- ###SEARCH_RESULTS### end-->
296

  
297
<! -- ###SEARCH_NO_RESULTS### begin-->
298
<p ###CLASS###>###NO_RESULT_MESSAGE###</p>
299
<! -- ###SEARCH_NO_RESULTS### end-->
300

  
258 301
</body>
259 302
</html>
typo3/sysext/indexed_search/pi/template_css.tmpl (working copy)
122 122
<br /><br />
123 123

  
124 124

  
125
<h2>TEMPLATE_SEARCH_FORM_INVISIBLE</h2>
126
<p><em>Template for hidden search form used by page browser</em></p>
125 127

  
128
<!-- ###SEARCH_FORM_HIDDEN### begin -->
129
<div style="display:none">
130
	<form action="###ACTION_URL###" method="post" name="tx_indexedsearch">
131
		<input type="hidden" name="tx_indexedsearch[_sections]" value="0" />
132
		<input type="hidden" name="tx_indexedsearch[_freeIndexUid]" value="_" />
133
		<input type="hidden" name="tx_indexedsearch[pointer]" value="0" />
134
		<!-- ###HIDDEN_FIELDS### begin -->
135
		<input type="hidden" name="###HIDDEN_FIELDNAME###" value="###HIDDEN_VALUE###" />
136
		<!-- ###HIDDEN_FIELDS### end -->
137
	<form>
138
</div>
139
 <!-- ###SEARCH_FORM_HIDDEN### end -->
140
<br /><br />
126 141

  
127 142
<h2>TEMPLATE_RULES</h2>
128 143
<p><em>Template for displaying the search rules.</em></p>
......
168 183
<br /><br />
169 184

  
170 185

  
186
<h2>Browsebox for the top</h2>
187
<!-- ###BROWSE_BOX_TOP### begin-->
188
###HIDDENFORM###
189
<div class="tx-indexedsearch-browsebox">
190
<p>###RESULTCOUNT### ###ADDSTRING###</p>
191
###ADDPART###
192
<!-- ###BROWSE_LINKS### -->###PREVIOUS### ###PAGES### ###NEXT###<!-- ###BROWSE_LINKS### -->
193
</div>
194
<!-- ###BROWSE_BOX_TOP### end-->
171 195

  
196
<h2>Browsebox for the bottom</h2>
197
<!-- ###BROWSE_BOX_BOTTOM### begin-->
198
<div class="tx-indexedsearch-browsebox"> 
199
<!-- ###BROWSE_LINKS### -->###PREVIOUS### ###PAGES### ###NEXT###<!-- ###BROWSE_LINKS### -->
200
</div>
201
<!-- ###BROWSE_BOX_BOTTOM### end-->
172 202

  
203

  
204

  
173 205
<h2>TEMPLATE_RESULT_OUTPUT</h2>
174 206
<p><em>Template for the search result list.</em></p>
175 207
<!-- ###RESULT_OUTPUT### begin -->
......
207 239
<br /><br />
208 240

  
209 241

  
242

  
243
<h2>Search Results with Browseboxes - this is the main utput for the search results</h2>
244
<!-- ###SEARCH_RESULTS### begin-->  
245
###BROWSE_BOX_TOP###
246
###RESULTS###
247
###BROWSE_BOX_BOTTOM###
248
<!-- ###SEARCH_RESULTS### end-->
249

  
250
<!-- ###SEARCH_NO_RESULTS### begin-->
251
<p ###CLASS###>###NO_RESULT_MESSAGE###</p>
252
<!-- ###SEARCH_NO_RESULTS### end-->
253

  
254

  
210 255
</body>
211 256
</html>
(1-1/6)