array (
'criteria' =>
array (
'name' => 'simplesearch',
),
'object' =>
array (
'name' => 'simplesearch',
'path' => '{core_path}components/simplesearch/',
'assets_path' => '{assets_path}components/simplesearch/',
),
),
'ec06bde7ce9e2ceb3222b02ef9cbf7f3' =>
array (
'criteria' =>
array (
'key' => 'simplesearch.driver_class',
),
'object' =>
array (
'key' => 'simplesearch.driver_class',
'value' => 'SimpleSearchDriverBasic',
'xtype' => 'textfield',
'namespace' => 'simplesearch',
'area' => 'Drivers',
'editedon' => NULL,
),
),
'cce671c5e6a128ef84657b263c52ca11' =>
array (
'criteria' =>
array (
'key' => 'simplesearch.driver_class_path',
),
'object' =>
array (
'key' => 'simplesearch.driver_class_path',
'value' => '',
'xtype' => 'textfield',
'namespace' => 'simplesearch',
'area' => 'Drivers',
'editedon' => NULL,
),
),
'9fe0735d2ac62949ee10ec3a568d00e4' =>
array (
'criteria' =>
array (
'key' => 'simplesearch.driver_db_specific',
),
'object' =>
array (
'key' => 'simplesearch.driver_db_specific',
'value' => '1',
'xtype' => 'combo-boolean',
'namespace' => 'simplesearch',
'area' => 'Drivers',
'editedon' => NULL,
),
),
'795fc404c44dc49f4da8c5d2ef87c9c1' =>
array (
'criteria' =>
array (
'key' => 'simplesearch.autosuggest_tv',
),
'object' =>
array (
'key' => 'simplesearch.autosuggest_tv',
'value' => 'simpleSearchAutoSuggestions',
'xtype' => 'textfield',
'namespace' => 'simplesearch',
'area' => 'Autosuggest',
'editedon' => NULL,
),
),
'ccdfeb0db27480f94aae91787e1ca55a' =>
array (
'criteria' =>
array (
'category' => 'SimpleSearch',
),
'object' =>
array (
'id' => 40,
'parent' => 0,
'category' => 'SimpleSearch',
'rank' => 0,
),
),
'bd15e0c6180f37dd5623176fe6bb7071' =>
array (
'criteria' =>
array (
'name' => 'SearchForm',
),
'object' =>
array (
'id' => 102,
'source' => 0,
'property_preprocess' => 0,
'name' => 'SearchForm',
'description' => '',
'editor_type' => 0,
'category' => 40,
'cache_type' => 0,
'snippet' => '
',
'locked' => 0,
'properties' => 'a:0:{}',
'static' => 0,
'static_file' => '',
'content' => '',
),
),
'6dace06a63419d8d8f6ce9d137f3aa8c' =>
array (
'criteria' =>
array (
'name' => 'SearchNoResults',
),
'object' =>
array (
'id' => 103,
'source' => 0,
'property_preprocess' => 0,
'name' => 'SearchNoResults',
'description' => '',
'editor_type' => 0,
'category' => 40,
'cache_type' => 0,
'snippet' => '[[%simplesearch.no_results? &query=`[[+query]]`]]',
'locked' => 0,
'properties' => 'a:0:{}',
'static' => 0,
'static_file' => '',
'content' => '[[%simplesearch.no_results? &query=`[[+query]]`]]',
),
),
'45fd9e5f94bc147cdfb1d62d28b037c9' =>
array (
'criteria' =>
array (
'name' => 'SearchResults',
),
'object' =>
array (
'id' => 104,
'source' => 0,
'property_preprocess' => 0,
'name' => 'SearchResults',
'description' => '',
'editor_type' => 0,
'category' => 40,
'cache_type' => 0,
'snippet' => '[[+resultInfo]]
[[%simplesearch.result_pages? &namespace=`simplesearch` &topic=`default`]][[+paging]]
[[+results]]
[[%simplesearch.result_pages? &namespace=`simplesearch` &topic=`default`]]
[[+paging]]
',
'locked' => 0,
'properties' => 'a:0:{}',
'static' => 0,
'static_file' => '',
'content' => '[[+resultInfo]]
[[%simplesearch.result_pages? &namespace=`simplesearch` &topic=`default`]][[+paging]]
[[+results]]
[[%simplesearch.result_pages? &namespace=`simplesearch` &topic=`default`]]
[[+paging]]
',
),
),
'd3a26a5447593a2ccc6dd05b6f96a509' =>
array (
'criteria' =>
array (
'name' => 'SearchResult',
),
'object' =>
array (
'id' => 105,
'source' => 0,
'property_preprocess' => 0,
'name' => 'SearchResult',
'description' => '',
'editor_type' => 0,
'category' => 40,
'cache_type' => 0,
'snippet' => '',
'locked' => 0,
'properties' => 'a:0:{}',
'static' => 0,
'static_file' => '',
'content' => '',
),
),
'828fc6b1f94f467886f97b6a3a8b4e1d' =>
array (
'criteria' =>
array (
'name' => 'PageLink',
),
'object' =>
array (
'id' => 106,
'source' => 0,
'property_preprocess' => 0,
'name' => 'PageLink',
'description' => '',
'editor_type' => 0,
'category' => 40,
'cache_type' => 0,
'snippet' => '
[[+text]]
',
'locked' => 0,
'properties' => 'a:0:{}',
'static' => 0,
'static_file' => '',
'content' => '
[[+text]]
',
),
),
'059a536091982fab6fa24c0f0ae90c9e' =>
array (
'criteria' =>
array (
'name' => 'CurrentPageLink',
),
'object' =>
array (
'id' => 107,
'source' => 0,
'property_preprocess' => 0,
'name' => 'CurrentPageLink',
'description' => '',
'editor_type' => 0,
'category' => 40,
'cache_type' => 0,
'snippet' => '[[+text]]',
'locked' => 0,
'properties' => 'a:0:{}',
'static' => 0,
'static_file' => '',
'content' => '[[+text]]',
),
),
'1a94d5d43d18393c15fff257947fa5a0' =>
array (
'criteria' =>
array (
'name' => 'SearchResultLi',
),
'object' =>
array (
'id' => 108,
'source' => 0,
'property_preprocess' => 0,
'name' => 'SearchResultLi',
'description' => '',
'editor_type' => 0,
'category' => 40,
'cache_type' => 0,
'snippet' => '
[[+pagetitle]]
',
'locked' => 0,
'properties' => 'a:0:{}',
'static' => 0,
'static_file' => '',
'content' => '
[[+pagetitle]]
',
),
),
'dca659985fa6446281ae0ea934dce1e1' =>
array (
'criteria' =>
array (
'name' => 'SimpleSearch',
),
'object' =>
array (
'id' => 110,
'source' => 0,
'property_preprocess' => 0,
'name' => 'SimpleSearch',
'description' => '',
'editor_type' => 0,
'category' => 40,
'cache_type' => 0,
'snippet' => '/**
* SimpleSearch snippet
*
* @var modX $modx
* @var array $scriptProperties
* @package simplesearch
*/
require_once $modx->getOption(
\'simplesearch.core_path\',
null,
$modx->getOption(\'core_path\') . \'components/simplesearch/\'
) . \'model/simplesearch/simplesearch.class.php\';
$search = new SimpleSearch($modx, $scriptProperties);
/* Find search index and toplaceholder setting */
$searchIndex = $modx->getOption(\'searchIndex\', $scriptProperties, \'search\');
$toPlaceholder = $modx->getOption(\'toPlaceholder\', $scriptProperties, false);
$noResultsTpl = $modx->getOption(\'noResultsTpl\', $scriptProperties, \'SearchNoResults\');
/* Get search string */
if (empty($_REQUEST[$searchIndex])) {
$output = $search->getChunk($noResultsTpl, array(
\'query\' => \'\',
));
return $search->output($output, $toPlaceholder);
}
$searchString = $search->parseSearchString($_REQUEST[$searchIndex]);
if (!$searchString) {
$output = $search->getChunk($noResultsTpl, array(
\'query\' => $searchString,
));
return $search->output($output, $toPlaceholder);
}
/* Setup default properties. */
$tpl = $modx->getOption(\'tpl\', $scriptProperties, \'SearchResult\');
$containerTpl = $modx->getOption(\'containerTpl\', $scriptProperties, \'SearchResults\');
$showExtract = $modx->getOption(\'showExtract\', $scriptProperties, true);
$extractSource = $modx->getOption(\'extractSource\', $scriptProperties, \'content\');
$extractLength = $modx->getOption(\'extractLength\', $scriptProperties, 200);
$extractEllipsis = $modx->getOption(\'extractEllipsis\', $scriptProperties, \'...\');
$highlightResults = $modx->getOption(\'highlightResults\', $scriptProperties, true);
$highlightClass = $modx->getOption(\'highlightClass\', $scriptProperties, \'simplesearch-highlight\');
$highlightTag = $modx->getOption(\'highlightTag\', $scriptProperties, \'span\');
$perPage = $modx->getOption(\'perPage\', $scriptProperties, 10);
$pagingSeparator = $modx->getOption(\'pagingSeparator\', $scriptProperties, \' | \');
$placeholderPrefix = $modx->getOption(\'placeholderPrefix\', $scriptProperties, \'simplesearch.\');
$includeTVs = $modx->getOption(\'includeTVs\', $scriptProperties, \'\');
$processTVs = $modx->getOption(\'processTVs\', $scriptProperties, \'\');
$tvPrefix = $modx->getOption(\'tvPrefix\', $scriptProperties, \'\');
$offsetIndex = $modx->getOption(\'offsetIndex\', $scriptProperties, \'simplesearch_offset\');
$idx = isset($_REQUEST[$offsetIndex]) ? (int) $_REQUEST[$offsetIndex] + 1 : 1;
$postHooks = $modx->getOption(\'postHooks\', $scriptProperties, \'\');
$activeFacet = $modx->getOption(\'facet\',$_REQUEST,$modx->getOption(\'activeFacet\', $scriptProperties, \'default\'));
$activeFacet = $modx->sanitizeString($activeFacet);
$facetLimit = $modx->getOption(\'facetLimit\', $scriptProperties, 5);
$outputSeparator = $modx->getOption(\'outputSeparator\', $scriptProperties, "\\n");
$addSearchToLink = (int) $modx->getOption(\'addSearchToLink\', $scriptProperties, 0);
$searchInLinkName = $modx->getOption(\'searchInLinkName\', $scriptProperties, \'search\');
/* Get results */
$response = $search->getSearchResults($searchString, $scriptProperties);
$placeholders = array(\'query\' => $searchString);
$resultsTpl = array(\'default\' => array(\'results\' => array(), \'total\' => $response[\'total\']));
if (!empty($response[\'results\'])) {
/* iterate through search results */
foreach ($response[\'results\'] as $resourceArray) {
$resourceArray[\'idx\'] = $idx;
if (empty($resourceArray[\'link\'])) {
$ctx = !empty($resourceArray[\'context_key\']) ? $resourceArray[\'context_key\'] : $modx->context->get(\'key\');
$args = \'\';
if ($addSearchToLink) {
$args = array($searchInLinkName => $searchString);
}
$resourceArray[\'link\'] = $modx->makeUrl($resourceArray[\'id\'], $ctx, $args);
}
if ($showExtract) {
$extract = $searchString;
if (array_key_exists($extractSource, $resourceArray)) {
$text = $resourceArray[$extractSource];
} else {
$text = $modx->runSnippet($extractSource, $resourceArray);
}
$extract = $search->createExtract($text,$extractLength,$extract,$extractEllipsis);
/* Cleanup extract */
$extract = strip_tags(preg_replace("#\\