144 if (is_array($this->settings[
'defaultOptions'])) {
148 $this->indexerConfig = unserialize(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXT'][
'extConf'][
'indexed_search']);
149 $this->enableMetaphoneSearch = $this->indexerConfig[
'enableMetaphoneSearch'] ? TRUE : FALSE;
169 $this->searchRootPageIdList = (int)
$GLOBALS[
'TSFE']->config[
'rootLine'][0][
'uid'];
178 if ($this->settings[
'rootPidList']) {
182 $this->searchRepository->initialize($this->settings,
$searchData, $this->externalParsers, $this->searchRootPageIdList);
185 if ($hookObj = $this->
hookRequest(
'initialize_postProc')) {
186 $hookObj->initialize_postProc();
202 if ($freeIndexUid == -2) {
203 $freeIndexUid = $this->settings[
'defaultFreeIndexUidList'];
209 $resultsets = array();
210 foreach ($indexCfgs as $freeIndexUid) {
213 if ($hookObj = $this->
hookRequest(
'getResultRows')) {
214 $resultData = $hookObj->getResultRows($this->searchWords, $freeIndexUid);
216 $resultData = $this->searchRepository->doSearch($this->searchWords, $freeIndexUid);
220 if ($hookObj = $this->
hookRequest(
'getDisplayResults')) {
221 $resultsets[$freeIndexUid] = $hookObj->getDisplayResults($this->searchWords, $resultData, $freeIndexUid);
223 $resultsets[$freeIndexUid] = $this->
getDisplayResults($this->searchWords, $resultData, $freeIndexUid);
227 if (count($indexCfgs) > 1) {
228 if ($freeIndexUid > 0) {
229 $indexCfgRec =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetSingleRow(
'title',
'index_config',
'uid=' . (
int)$freeIndexUid .
$GLOBALS[
'TSFE']->cObj->enableFields(
'index_config'));
230 $categoryTitle = $indexCfgRec[
'title'];
234 $resultsets[$freeIndexUid][
'categoryTitle'] = $categoryTitle;
239 $this->view->assign(
'resultsets', $resultsets);
241 $this->view->assign(
'searchWords', $this->searchWords);
258 'count' => $resultData[
'count'],
264 $this->firstRow = $resultData[
'firstRow'];
269 if ($resultData[
'count']) {
271 if ($this->searchData[
'group'] ==
'sections' && $freeIndexUid <= 0) {
272 $result[
'sectionText'] = sprintf(\
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'result.' . (count($this->resultSections) > 1 ?
'inNsections' :
'inNsection'),
'IndexedSearch'), count($this->resultSections));
277 if (substr($this->searchData[
'sections'], 0, 2) ==
'rl') {
292 $finalResultRows = array();
295 $newResultRows = array();
296 foreach ($resultRows as $row) {
297 $id = md5($row[
'phash_grouping']);
298 if (is_array($newResultRows[$id])) {
300 if (!$newResultRows[$id][
'show_resume'] && $row[
'show_resume']) {
302 $subrows = $newResultRows[$id][
'_sub'];
303 unset($newResultRows[$id][
'_sub']);
304 $subrows[] = $newResultRows[$id];
306 $newResultRows[$id] = $row;
307 $newResultRows[$id][
'_sub'] = $subrows;
309 $newResultRows[$id][
'_sub'][] = $row;
312 $newResultRows[$id] = $row;
315 $resultRows = $newResultRows;
316 $this->resultSections = array();
317 if ($freeIndexUid <= 0 && $this->searchData[
'group'] ==
'sections') {
318 $rl2flag = substr($this->searchData[
'sections'], 0, 2) ==
'rl';
320 foreach ($resultRows as $row) {
321 $id = $row[
'rl0'] .
'-' . $row[
'rl1'] . ($rl2flag ?
'-' . $row[
'rl2'] :
'');
322 $sections[$id][] = $row;
324 $this->resultSections = array();
325 foreach ($sections as $id => $resultRows) {
326 $rlParts = explode(
'-', $id);
328 $theId = $rlParts[2];
329 $theRLid =
'rl2_' . $rlParts[2];
330 } elseif ($rlParts[1]) {
331 $theId = $rlParts[1];
332 $theRLid =
'rl1_' . $rlParts[1];
334 $theId = $rlParts[0];
338 $sectionName = ltrim($sectionName,
'/');
339 if (!trim($sectionName)) {
342 $onclick =
'document.forms[\'tx_indexedsearch\'][\'tx_indexedsearch_pi2[search][_sections]\'].value=' .
GeneralUtility::quoteJSvalue($theRLid) .
';document.forms[\'tx_indexedsearch\'].submit();return false;';
343 $sectionTitleLinked =
'<a href="#" onclick="' . htmlspecialchars($onclick) .
'">' . htmlspecialchars($sectionName) .
':</a>';
345 $this->resultSections[$id] = array($sectionName, count($resultRows));
347 $finalResultRows[] = array(
348 'isSectionHeader' => TRUE,
349 'numResultRows' => count($resultRows),
351 'sectionTitle' => $sectionTitleLinked
354 foreach ($resultRows as $row) {
360 foreach ($resultRows as $row) {
364 return $finalResultRows;
377 $resultData[
'headerOnly'] = $headerOnly;
378 $resultData[
'CSSsuffix'] = $specRowConf[
'CSSsuffix'] ?
'-' . $specRowConf[
'CSSsuffix'] :
'';
380 $dat = unserialize($row[
'cHashParams']);
381 $pp = explode(
'-', $dat[
'key']);
382 if ($pp[0] != $pp[1]) {
388 $title = $resultData[
'item_title'] . $resultData[
'titleaddition'];
390 if ($row[
'item_type']) {
391 if ($row[
'show_resume']) {
393 $targetAttribute =
'';
394 if (
$GLOBALS[
'TSFE']->config[
'config'][
'fileTarget']) {
395 $targetAttribute =
' target="' . htmlspecialchars(
$GLOBALS[
'TSFE']->config[
'config'][
'fileTarget']) .
'"';
397 $title =
'<a href="' . htmlspecialchars($row[
'data_filename']) .
'"' . $targetAttribute .
'>' . htmlspecialchars($title) .
'</a>';
401 unset($copiedRow[
'cHashParams']);
402 $title = $this->
linkPage($row[
'page_id'], $title, $copiedRow);
407 if ($this->settings[
'forwardSearchWordsInResultLink']) {
408 $markUpSwParams = array(
'no_cache' => 1);
409 foreach ($this->searchWords as $d) {
410 $markUpSwParams[
'sword_list'][] = $d[
'sword'];
413 $markUpSwParams = array();
415 $title = $this->
linkPage($row[
'data_page_id'], $title, $row, $markUpSwParams);
417 $resultData[
'title'] = $title;
418 $resultData[
'icon'] = $this->makeItemTypeIcon($row[
'item_type'],
'', $specRowConf);
419 $resultData[
'rating'] = $this->
makeRating($row);
420 $resultData[
'description'] = $this->
makeDescription($row, $this->searchData[
'extResume'] && !$headerOnly ? 0 : 1);
421 $resultData[
'language'] = $this->makeLanguageIndication($row);
423 $resultData[
'created'] = $row[
'item_crdate'];
424 $resultData[
'modified'] = $row[
'item_mtime'];
425 $pI = parse_url($row[
'data_filename']);
427 $targetAttribute =
'';
428 if (
$GLOBALS[
'TSFE']->config[
'config'][
'fileTarget']) {
429 $targetAttribute =
' target="' . htmlspecialchars(
$GLOBALS[
'TSFE']->config[
'config'][
'fileTarget']) .
'"';
431 $resultData[
'path'] =
'<a href="' . htmlspecialchars($row[
'data_filename']) .
'"' . $targetAttribute .
'>' . htmlspecialchars($row[
'data_filename']) .
'</a>';
433 $pathId = $row[
'data_page_id'] ?: $row[
'page_id'];
434 $pathMP = $row[
'data_page_id'] ? $row[
'data_page_mp'] :
'';
436 $resultData[
'path'] = $this->
linkPage($pathId, $pathStr, array(
437 'cHashParams' => $row[
'cHashParams'],
438 'data_page_type' => $row[
'data_page_type'],
439 'data_page_mp' => $pathMP,
440 'sys_language_uid' => $row[
'sys_language_uid']
443 if (is_array($this->requiredFrontendUsergroups[$pathId]) && count($this->requiredFrontendUsergroups[$pathId])) {
444 $resultData[
'access'] =
'<img src="' .
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath(
'indexed_search') .
'pi/res/locked.gif" width="12" height="15" vspace="5" title="' . sprintf(\
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'result.memberGroups',
'IndexedSearch'), implode(
',', array_unique($this->requiredFrontendUsergroups[$pathId]))) .
'" alt="" />';
449 if (is_array($row[
'_sub'])) {
450 $resultData[
'subresults'] = array();
453 foreach ($row[
'_sub'] as $subRow) {
472 $pathId = $row[
'data_page_id'] ?: $row[
'page_id'];
473 $pathMP = $row[
'data_page_id'] ? $row[
'data_page_mp'] :
'';
474 $rl =
$GLOBALS[
'TSFE']->sys_page->getRootLine($pathId, $pathMP);
475 $specConf = $this->settings[
'specialConfiguration'][
'0'];
477 foreach ($rl as $dat) {
478 if (is_array($this->settings[
'specialConfiguration'][$dat[
'uid']])) {
479 $specConf = $this->settings[
'specialConfiguration'][$dat[
'uid']];
480 $specConf[
'_pid'] = $dat[
'uid'];
496 switch ((
string) $this->searchData[
'sortOrder']) {
501 return ceil(\
TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange((255 - $row[
'order_val']), 1, 255) / 255 * 100) .
'%';
504 if ($this->firstRow[
'order_val2']) {
506 $base = $row[
'order_val1'] * 256;
508 $freqNumber = $row[
'order_val2'] / $this->firstRow[
'order_val2'] * pow(2, 12);
510 return ceil(log($total) / log(32767) * 100) .
'%';
516 return ceil(log($total) / log($max) * 100) .
'%';
519 return $GLOBALS[
'TSFE']->cObj->calcAge(
$GLOBALS[
'EXEC_TIME'] - $row[
'item_crdate'], 0);
522 return $GLOBALS[
'TSFE']->cObj->calcAge(
$GLOBALS[
'EXEC_TIME'] - $row[
'item_mtime'], 0);
535 protected function makeLanguageIndication($row) {
538 if ((
string) $row[
'item_type'] ===
'0') {
540 if (is_array($this->settings[
'flagRendering'])) {
543 $cObj->setCurrentVal($row[
'sys_language_uid']);
544 $typoScriptArray = $this->typoScriptService->convertPlainArrayToTypoScriptArray($this->settings[
'flagRendering']);
545 $output = $cObj->cObjGetSingle($this->settings[
'flagRendering'][
'_typoScriptNodeValue'], $typoScriptArray);
548 $languageRow =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetSingleRow(
'flag, title',
'sys_language',
'uid=' . (
int)$row[
'sys_language_uid'] .
$GLOBALS[
'TSFE']->cObj->enableFields(
'sys_language'));
550 $flag = $languageRow[
'flag'];
555 $imgInfo = @getimagesize((PATH_site . $file));
556 if (is_array($imgInfo)) {
557 $output =
'<img src="' . $file .
'" ' . $imgInfo[3] .
' title="' . htmlspecialchars($languageRow[
'title']) .
'" alt="' . htmlspecialchars($languageRow[
'title']) .
'" />';
574 public function makeItemTypeIcon($imageType, $alt, $specRowConf) {
577 if ($imageType ===
'0' && $specRowConf[
'_pid'] && is_array($specRowConf[
'pageIcon']) && !is_array($this->settings[
'iconRendering'])) {
578 $imageType .=
':' . $specRowConf[
'_pid'];
580 if (!isset($this->iconFileNameCache[$imageType])) {
581 $this->iconFileNameCache[$imageType] =
'';
583 if (is_array($this->settings[
'iconRendering'])) {
586 $cObj->setCurrentVal($imageType);
587 $typoScriptArray = $this->typoScriptService->convertPlainArrayToTypoScriptArray($this->settings[
'iconRendering']);
588 $this->iconFileNameCache[$imageType] = $cObj->cObjGetSingle($this->settings[
'iconRendering'][
'_typoScriptNodeValue'], $typoScriptArray);
592 if ($imageType ===
'0' || substr($imageType, 0, 2) ==
'0:') {
593 if (is_array($specRowConf[
'pageIcon'])) {
594 $this->iconFileNameCache[$imageType] =
$GLOBALS[
'TSFE']->cObj->cObjGetSingle(
'IMAGE', $specRowConf[
'pageIcon']);
596 $icon =
'EXT:indexed_search/pi/res/pages.gif';
598 } elseif ($this->externalParsers[$imageType]) {
599 $icon = $this->externalParsers[$imageType]->getIcon($imageType);
604 $info = @getimagesize($fullPath);
606 $this->iconFileNameCache[$imageType] = is_array($info) ?
'<img src="' . $iconPath .
'" ' . $info[3] .
' title="' . htmlspecialchars($alt) .
'" alt="" />' :
'';
611 return $this->iconFileNameCache[$imageType];
624 if ($row[
'show_resume']) {
627 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'*',
'index_fulltext',
'phash=' . (
int)$row[
'phash']);
628 if ($ftdrow =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
630 $content = preg_replace(
'/(http:\\/\\/[^ ]{60})([^ ]+)/i',
'$1...', $ftdrow[
'fulltextdata']);
633 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
635 if (!trim($markedSW)) {
636 $outputStr =
$GLOBALS[
'TSFE']->csConvObj->crop(
'utf-8', $row[
'item_description'], $length);
637 $outputStr = htmlspecialchars($outputStr);
639 $output = $outputStr ?: $markedSW;
640 $output =
$GLOBALS[
'TSFE']->csConv($output,
'utf-8');
656 $str = str_replace(
' ',
' ', $htmlParser->bidir_htmlspecialchars($str, -1));
657 $str = preg_replace(
'/\\s\\s+/',
' ', $str);
660 foreach ($this->searchWords as $d) {
661 $swForReg[] = preg_quote($d[
'sword'],
'/');
663 $regExString =
'(' . implode(
'|', $swForReg) .
')';
665 $parts = preg_split(
'/' . $regExString .
'/i',
' ' . $str .
' ', 20000, PREG_SPLIT_DELIM_CAPTURE);
669 $postPreLgd_offset = 5;
671 $occurencies = (count($parts) - 1) / 2;
679 foreach ($parts as $k => $strP) {
682 $strLen =
$GLOBALS[
'TSFE']->csConvObj->strlen(
'utf-8', $parts[$k]);
683 $output[$k] = $parts[$k];
687 if ($strLen > $postPreLgd) {
688 $output[$k] = $divider . preg_replace(
'/^[^[:space:]]+[[:space:]]/',
'',
$GLOBALS[
'TSFE']->csConvObj->crop(
'utf-8', $parts[$k], -($postPreLgd - $postPreLgd_offset)));
690 } elseif ($summaryLgd > $summaryMax || !isset($parts[($k + 1)])) {
692 if ($strLen > $postPreLgd) {
693 $output[$k] = preg_replace(
'/[[:space:]][^[:space:]]+$/',
'',
$GLOBALS[
'TSFE']->csConvObj->crop(
'utf-8', $parts[$k], ($postPreLgd - $postPreLgd_offset))) . $divider;
696 if ($strLen > $postPreLgd * 2) {
697 $output[$k] = preg_replace(
'/[[:space:]][^[:space:]]+$/',
'',
$GLOBALS[
'TSFE']->csConvObj->crop(
'utf-8', $parts[$k], ($postPreLgd - $postPreLgd_offset))) . $divider . preg_replace(
'/^[^[:space:]]+[[:space:]]/',
'',
$GLOBALS[
'TSFE']->csConvObj->crop(
'utf-8', $parts[$k], -($postPreLgd - $postPreLgd_offset)));
700 $summaryLgd +=
$GLOBALS[
'TSFE']->csConvObj->strlen(
'utf-8', $output[$k]);
702 $output[$k] = htmlspecialchars($output[$k]);
704 if ($summaryLgd > $summaryMax) {
708 $summaryLgd +=
$GLOBALS[
'TSFE']->csConvObj->strlen(
'utf-8', $strP);
709 $output[$k] =
'<strong class="tx-indexedsearch-redMarkup">' . htmlspecialchars($parts[$k]) .
'</strong>';
713 return implode(
'', $output);
726 $insertFields = array(
727 'searchstring' => $this->sword,
728 'searchoptions' => serialize(array($searchParams,
$searchWords, $pt)),
729 'feuser_id' => (
int)
$GLOBALS[
'TSFE']->fe_user->user[
'uid'],
731 'cookie' =>
$GLOBALS[
'TSFE']->fe_user->id,
735 'hits' => (
int)$count,
739 $GLOBALS[
'TYPO3_DB']->exec_INSERTquery(
'index_stat_search', $insertFields);
740 $newId =
$GLOBALS[
'TYPO3_DB']->sql_insert_id();
743 $insertFields = array(
744 'word' => $val[
'sword'],
745 'index_stat_search_id' => $newId,
751 $GLOBALS[
'TYPO3_DB']->exec_INSERTquery(
'index_stat_word', $insertFields);
778 if ($hookObj = $this->
hookRequest(
'getSearchWords')) {
779 $sWordArray = $hookObj->getSearchWords_splitSWords(
$searchWords, $defaultOperator);
782 if ($this->searchData[
'searchType'] == 20) {
792 $operatorTranslateTable = array(
795 array(
'-',
'AND NOT'),
798 array(
$GLOBALS[
'TSFE']->csConvObj->conv_case(
'utf-8',
$GLOBALS[
'TSFE']->csConvObj->utf8_encode(\
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'localizedOperandAnd',
'IndexedSearch'),
$GLOBALS[
'TSFE']->renderCharset),
'toLower'),
'AND'),
799 array(
$GLOBALS[
'TSFE']->csConvObj->conv_case(
'utf-8',
$GLOBALS[
'TSFE']->csConvObj->utf8_encode(\
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'localizedOperandOr',
'IndexedSearch'),
$GLOBALS[
'TSFE']->renderCharset),
'toLower'),
'OR'),
800 array(
$GLOBALS[
'TSFE']->csConvObj->conv_case(
'utf-8',
$GLOBALS[
'TSFE']->csConvObj->utf8_encode(\
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'localizedOperandNot',
'IndexedSearch'),
$GLOBALS[
'TSFE']->renderCharset),
'toLower'),
'AND NOT')
803 $search->default_operator = $defaultOperator == 1 ?
'OR' :
'AND';
804 $search->operator_translate_table = $operatorTranslateTable;
805 $search->register_and_explode_search_string(
$searchWords);
806 if (is_array($search->sword_array)) {
809 $sWordArray = array();
824 $newSearchWords = array();
826 $lexerObjRef =
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'indexed_search'][
'lexer'] ?
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'indexed_search'][
'lexer'] :
'EXT:indexed_search/Classes/Lexer.php:&TYPO3\\CMS\\IndexedSearch\\Lexer';
831 if (strpos($wordDef[
'sword'],
' ') === FALSE) {
833 $res = $this->lexerObj->split2Words($wordDef[
'sword']);
835 foreach ($res as $word) {
836 $newSearchWords[] = array(
838 'oper' => $wordDef[
'oper']
842 $newSearchWords[] = $wordDef;
845 return $newSearchWords;
858 $this->view->assign(
'sword', $this->sword);
860 $showAdditionalKeywordSearch = $this->settings[
'clearSearchBox'] && $this->settings[
'clearSearchBox'][
'enableSubSearchCheckBox'];
861 if ($showAdditionalKeywordSearch) {
862 $this->view->assign(
'previousSearchWord', $this->settings[
'clearSearchBox'] ?
'' : $this->sword);
864 $this->view->assign(
'showAdditionalKeywordSearch', $showAdditionalKeywordSearch);
866 if ($search[
'extendedSearch']) {
869 $this->view->assign(
'allSearchTypes', $allSearchTypes);
871 $this->view->assign(
'allDefaultOperands', $allDefaultOperands);
872 $showTypeSearch = count($allSearchTypes) || count($allDefaultOperands);
873 $this->view->assign(
'showTypeSearch', $showTypeSearch);
876 $this->view->assign(
'allMediaTypes', $allMediaTypes);
878 $this->view->assign(
'allLanguageUids', $allLanguageUids);
879 $showMediaAndLanguageSearch = count($allMediaTypes) || count($allLanguageUids);
880 $this->view->assign(
'showMediaAndLanguageSearch', $showMediaAndLanguageSearch);
883 $this->view->assign(
'allSections', $allSections);
886 $this->view->assign(
'allIndexConfigurations', $allIndexConfigurations);
889 $this->view->assign(
'allSortOrders', $allSortOrders);
891 $this->view->assign(
'allSortDescendings', $allSortDescendings);
892 $showSortOrders = count($allSortOrders) || count($allSortDescendings);
893 $this->view->assign(
'showSortOrders', $showSortOrders);
896 $this->view->assign(
'allNumberOfResults', $allNumberOfResults);
898 $this->view->assign(
'allGroups', $allGroups);
912 $allOptions = array();
913 $types = array(0, 1, 2, 3, 10, 20);
914 $blindSettings = $this->settings[
'blind'];
915 if (!$blindSettings[
'searchType']) {
916 foreach ($types as $typeNum) {
921 if (!$this->enableMetaphoneSearch) {
922 unset($allOptions[10]);
935 $allOptions = array();
936 $blindSettings = $this->settings[
'blind'];
937 if (!$blindSettings[
'defaultOperand']) {
939 0 => \
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'defaultOperands.0',
'IndexedSearch'),
940 1 => \
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'defaultOperands.1',
'IndexedSearch')
954 $allOptions = array();
955 $mediaTypes = array(-1, 0, -2);
956 $blindSettings = $this->settings[
'blind'];
957 if (!$blindSettings[
'mediaType']) {
958 foreach ($mediaTypes as $mediaType) {
962 $additionalMedia = trim($this->settings[
'mediaList']);
963 if (strlen($additionalMedia) > 0) {
966 $additionalMedia = array();
968 foreach ($this->externalParsers as $extension => $obj) {
970 if (count($additionalMedia) && !in_array($extension, $additionalMedia)) {
973 if ($name = $obj->searchTypeMediaTitle($extension)) {
975 $allOptions[$extension] = $translatedName ?: $name;
991 '-1' => \
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'languageUids.-1',
'IndexedSearch'),
992 '0' => \
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'languageUids.0',
'IndexedSearch')
994 $blindSettings = $this->settings[
'blind'];
995 if (!$blindSettings[
'languageUid']) {
997 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'*',
'sys_language',
'1=1' .
$GLOBALS[
'TSFE']->cObj->enableFields(
'sys_language'));
999 while ($lang =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
1000 $allOptions[$lang[
'uid']] = $lang[
'title'];
1006 $allOptions = array();
1021 $allOptions = array();
1022 $sections = array(0, -1, -2, -3);
1023 $blindSettings = $this->settings[
'blind'];
1024 if (!$blindSettings[
'sections']) {
1025 foreach ($sections as $section) {
1031 if ($this->settings[
'displayLevel1Sections']) {
1032 $firstLevelMenu = $this->
getMenuOfPages($this->searchRootPageIdList);
1035 foreach ($firstLevelMenu as $firstLevelKey => $menuItem) {
1036 if (!$menuItem[
'nav_hide']) {
1037 $allOptions[
'rl1_' . $menuItem[
'uid']] = trim($labelLevel1 .
' ' . $menuItem[
'title']);
1038 if ($this->settings[
'displayLevel2Sections']) {
1040 foreach ($secondLevelMenu as $secondLevelKey => $menuItemLevel2) {
1041 if (!$menuItemLevel2[
'nav_hide']) {
1042 $allOptions[
'rl2_' . $menuItemLevel2[
'uid']] = trim($labelLevel2 .
' ' . $menuItemLevel2[
'title']);
1044 unset($secondLevelMenu[$secondLevelKey]);
1050 unset($firstLevelMenu[$firstLevelKey]);
1066 $allOptions = array(
1067 '-1' => \
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'indexingConfigurations.-1',
'IndexedSearch'),
1068 '-2' => \
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'indexingConfigurations.-2',
'IndexedSearch'),
1069 '0' => \
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'indexingConfigurations.0',
'IndexedSearch')
1071 $blindSettings = $this->settings[
'blind'];
1072 if (!$blindSettings[
'indexingConfigurations']) {
1074 if ($this->settings[
'defaultFreeIndexUidList']) {
1076 $indexCfgRecords =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
'uid,title',
'index_config',
'uid IN (' . implode(
',', $uidList) .
')' .
$GLOBALS[
'TSFE']->cObj->enableFields(
'index_config'),
'',
'',
'',
'uid');
1077 foreach ($uidList as $uidValue) {
1078 if (is_array($indexCfgRecords[$uidValue])) {
1079 $allOptions[$uidValue] = $indexCfgRecords[$uidValue][
'title'];
1086 $allOptions = array();
1101 $allOptions = array();
1102 $sortOrders = array(
'rank_flag',
'rank_freq',
'rank_first',
'rank_count',
'mtime',
'title',
'crdate');
1103 $blindSettings = $this->settings[
'blind'];
1104 if (!$blindSettings[
'sortOrder']) {
1105 foreach ($sortOrders as $order) {
1120 $allOptions = array();
1121 $blindSettings = $this->settings[
'blind'];
1122 if (!$blindSettings[
'groupBy']) {
1123 $allOptions = array(
1124 'sections' => \
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'groupBy.sections',
'IndexedSearch'),
1125 'flat' => \
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'groupBy.flat',
'IndexedSearch')
1139 $allOptions = array();
1140 $blindSettings = $this->settings[
'blind'];
1141 if (!$blindSettings[
'descending']) {
1142 $allOptions = array(
1143 0 => \
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'sortOrders.descending',
'IndexedSearch'),
1144 1 => \
TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
'sortOrders.ascending',
'IndexedSearch')
1158 $allOptions = array();
1159 $blindSettings = $this->settings[
'blind'];
1160 if (!$blindSettings[
'numberOfResults']) {
1161 $allOptions = array(
1181 if (is_array($blindOptions)) {
1182 foreach ($blindOptions as $key => $val) {
1184 unset($allOptions[$key]);
1201 protected function linkPage($pageUid, $linkText, $row = array(), $markUpSwParams = array()) {
1203 $urlParameters = (array) unserialize($row[
'cHashParams']);
1205 if ($row[
'data_page_mp']) {
1206 $urlParameters[
'MP'] = $row[
'data_page_mp'];
1208 if ($row[
'sys_language_uid']) {
1209 $urlParameters[
'L'] = $row[
'sys_language_uid'];
1212 $urlParameters = array_merge($urlParameters, $markUpSwParams);
1215 if (!is_array($this->domainRecords[$pageUid])) {
1220 if (count($this->domainRecords[$pageUid])) {
1222 $firstDomain = reset($this->domainRecords[$pageUid]);
1223 $additionalParams =
'';
1224 if (is_array($urlParameters)) {
1225 if (count($urlParameters)) {
1229 $uri = $scheme . $firstDomain .
'/index.php?id=' . $pageUid . $additionalParams;
1230 if ($target = $this->settings[
'detectDomainRecords.'][
'target']) {
1231 $target =
' target="' . $target .
'"';
1234 $uriBuilder = $this->controllerContext->getUriBuilder();
1235 $uri =
$uriBuilder->setTargetPageUid($pageUid)->setTargetPageType($row[
'data_page_type'])->setUseCacheHash(TRUE)->setArguments($urlParameters)->build();
1237 return '<a href="' . htmlspecialchars($uri) .
'"' . $target .
'>' . htmlspecialchars($linkText) .
'</a>';
1247 if ($this->settings[
'displayLevelxAllTypes']) {
1249 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'title,uid',
'pages',
'pid=' . (
int)$pageUid .
$GLOBALS[
'TSFE']->cObj->enableFields(
'pages'),
'',
'sorting');
1250 while ($row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res)) {
1251 $menu[$row[
'uid']] =
$GLOBALS[
'TSFE']->sys_page->getPageOverlay($row);
1253 $GLOBALS[
'TYPO3_DB']->sql_free_result($res);
1255 $menu =
$GLOBALS[
'TSFE']->sys_page->getMenu($pageUid);
1268 $identStr = $id .
'|' . $pathMP;
1269 if (!isset($this->pathCache[$identStr])) {
1270 $this->requiredFrontendUsergroups[$id] = array();
1271 $this->domainRecords[$id] = array();
1272 $rl =
$GLOBALS[
'TSFE']->sys_page->getRootLine($id, $pathMP);
1274 if (is_array($rl) && count($rl)) {
1275 foreach ($rl as $k => $v) {
1277 if ($v[
'fe_group'] && ($v[
'uid'] == $id || $v[
'extendToSubpages'])) {
1278 $this->requiredFrontendUsergroups[$id][] = $v[
'fe_group'];
1281 if ($this->settings[
'detectDomainRcords']) {
1284 $this->domainRecords[$id][] = $domainName;
1286 $path = $domainName . $path;
1291 if ($v[
'uid'] ==
$GLOBALS[
'TSFE']->config[
'rootLine'][0][
'uid']) {
1294 $path =
'/' . $v[
'title'] . $path;
1297 $this->pathCache[$identStr] = $path;
1299 return $this->pathCache[$identStr];
1309 $res =
$GLOBALS[
'TYPO3_DB']->exec_SELECTquery(
'domainName',
'sys_domain',
'pid=' . (
int)$id .
$GLOBALS[
'TSFE']->cObj->enableFields(
'sys_domain'),
'',
'sorting');
1310 $row =
$GLOBALS[
'TYPO3_DB']->sql_fetch_assoc($res);
1311 return rtrim($row[
'domainName'],
'/');
1322 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'indexed_search'][
'external_parsers'])) {
1323 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'indexed_search'][
'external_parsers'] as $extension => $_objRef) {
1326 if (!$this->externalParsers[$extension]->softInit($extension)) {
1327 unset($this->externalParsers[$extension]);
1341 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'indexed_search'][
'pi1_hooks'][$functionName]) {
1343 if (method_exists($hookObj, $functionName)) {
1344 $hookObj->pObj = $this;
1358 return is_object($this->externalParsers[$item_type]) && $this->externalParsers[$item_type]->isMultiplePageExtension($item_type);
getFirstSysDomainRecordForPage($id)
getPathFromPageId($id, $pathMP='')
getDisplayResults($searchWords, $resultData, $freeIndexUid=-1)
compileResultRows($resultRows, $freeIndexUid=-1)
formAction($search=array())
compileSingleResultRow($row, $headerOnly=0)
getSearchWords($defaultOperator)
static forceIntegerInRange($theInt, $min, $max=2000000000, $defaultValue=0)
static quoteJSvalue($value)
static intExplode($delimiter, $string, $removeEmptyValues=FALSE, $limit=0)
multiplePagesType($item_type)
static getIndpEnv($getEnvName)
static getUserObj($classRef, $checkPrefix='', $silent=FALSE)
getAllAvailableIndexConfigurationsOptions()
initializeExternalParsers()
getAllAvailableSectionsOptions()
getAllAvailableOperandsOptions()
getAllAvailableGroupOptions()
removeOptionsFromOptionList($allOptions, $blindOptions)
static makeInstance($className)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
makeDescription($row, $noMarkup=FALSE, $length=180)
getAllAvailableLanguageOptions()
procSearchWordsByLexer($searchWords)
getAllAvailableMediaTypesOptions()
getAllAvailableNumberOfResultsOptions()
linkPage($pageUid, $linkText, $row=array(), $markUpSwParams=array())
getSpecialConfigurationForResultRow($row)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
initialize($searchData=array())
markupSWpartsOfString($str)
static implodeArrayForUrl($name, array $theArray, $str='', $skipBlank=FALSE, $rawurlencodeParamName=FALSE)
getAllAvailableSortDescendingOptions()
static formatSize($sizeInBytes, $labels='')
getAllAvailableSortOrderOptions()
hookRequest($functionName)
getAllAvailableSearchTypeOptions()
static translate($key, $extensionName, $arguments=NULL)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
searchAction($search=array())
static getFileAbsFileName($filename, $onlyRelative=TRUE, $relToTYPO3_mainDir=FALSE)
static stripPathSitePrefix($path)
writeSearchStat($searchParams, $searchWords, $count, $pt)
$requiredFrontendUsergroups