Feature #23156 » 23156.diff

Dmitry Dulepov, 2013-06-05 16:27

View differences:

typo3/sysext/indexed_search/Classes/Controller/SearchController.php
235 235
		}
236 236
		// Print a message telling which words in which sections we searched for
237 237
		if (substr($this->searchData['sections'], 0, 2) == 'rl') {
238
			$result['searchedInSectionInfo'] = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('result.inSection', 'indexed_search') . ' "' . substr($this->getPathFromPageId(substr($this->searchData['sections'], 4)), 1) . '"';
238
			$result['searchedInSectionInfo'] = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('result.inSection', 'indexed_search') . ' "' . $this->getPathFromPageId(substr($this->searchData['sections'], 4)) . '"';
239 239
		}
240 240
		return $result;
241 241
	}
......
300 300
					$sectionTitleLinked = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('result.unnamedSection', 'indexed_search') . ':';
301 301
				} else {
302 302
					$onclick = 'document.' . $this->prefixId . '[\'' . $this->prefixId . '[_sections]\'].value=\'' . $theRLid . '\';document.' . $this->prefixId . '.submit();return false;';
303
					$sectionTitleLinked = '<a href="#" onclick="' . htmlspecialchars($onclick) . '">' . htmlspecialchars($sectionName) . ':</a>';
303
					$sectionTitleLinked = '<a href="#" onclick="' . htmlspecialchars($onclick) . '">' . $sectionName . ':</a>';
304 304
				}
305 305
				$this->resultSections[$id] = array($sectionName, count($resultRows));
306 306
				// Add section header
......
393 393
		} else {
394 394
			$pathId = $row['data_page_id'] ? $row['data_page_id'] : $row['page_id'];
395 395
			$pathMP = $row['data_page_id'] ? $row['data_page_mp'] : '';
396
			$pathStr = htmlspecialchars($this->getPathFromPageId($pathId, $pathMP));
396
			$pathStr = $this->getPathFromPageId($pathId, $pathMP);
397 397
			$resultData['path'] = $this->linkPage($pathId, $pathStr, array(
398 398
				'cHashParams' => $row['cHashParams'],
399 399
				'data_page_type' => $row['data_page_type'],
......
1210 1210
	 * Returns the path to the page $id
1211 1211
	 *
1212 1212
	 * @param integer $id Page ID
1213
	 * @param string MP variable content
1214
	 * @return string Path
1213
	 * @param string $pathMP variable content
1214
	 * @return string Path (HTML-escaped)
1215 1215
	 */
1216 1216
	protected function getPathFromPageId($id, $pathMP = '') {
1217 1217
		$identStr = $id . '|' . $pathMP;
......
1220 1220
			$this->domainRecords[$id] = array();
1221 1221
			$rl = $GLOBALS['TSFE']->sys_page->getRootLine($id, $pathMP);
1222 1222
			$path = '';
1223
			if (is_array($rl) && count($rl)) {
1223
			$pageCount = count($rl);
1224
			if (is_array($rl) && $pageCount) {
1225
				$index = 0;
1226
				$pathSeparator = isset($this->conf['pathCharacter']) ? $this->conf['pathCharacter'] : '/';
1227
				$pathSeparators = $GLOBALS['TSFE']->tmpl->splitConfArray(array('separator' => $pathSeparator), $pageCount);
1224 1228
				foreach ($rl as $k => $v) {
1225 1229
					// Check fe_user
1226 1230
					if ($v['fe_group'] && ($v['uid'] == $id || $v['extendToSubpages'])) {
......
1240 1244
					if ($v['uid'] == $GLOBALS['TSFE']->config['rootLine'][0]['uid']) {
1241 1245
						break;
1242 1246
					}
1243
					$path = '/' . $v['title'] . $path;
1247
					$path = $pathSeparators[$index]['separator'] . htmlspecialchars($v['title']) . $path;
1248
					$index++;
1249
				}
1250
				if (isset($this->conf['pathCharacter'])) {
1251
					$path .= $pathSeparators[$index]['separator'];
1244 1252
				}
1245 1253
			}
1246 1254
			$this->pathCache[$identStr] = $path;
typo3/sysext/indexed_search/ext_typoscript_setup.txt
11 11
		modified =
12 12
	}
13 13

  
14
	pathCharacter = / |*| / |*| &#32;
15

  
14 16
	show {
15 17
		rules = 1
16 18
		parsetimes = 0
(2-2/2)