17 require_once SQ_PACKAGES_PATH.
'/cms/listing_engine/listing_engine.inc';
18 require_once SQ_INCLUDE_PATH.
'/general_occasional.inc';
43 parent::__construct($assetid);
87 $search_page_link = $GLOBALS[
'SQ_SYSTEM']->am->getLink($this->
id, SQ_LINK_NOTICE,
'', FALSE,
'search_page');
88 if (!empty($search_page_link)) {
89 $search_page = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($search_page_link[
'minorid']);
91 if (is_null($search_page))
return Array();
93 $sm = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'search_manager');
94 $plugin =& $sm->_getDBPlugin();
95 $children = $plugin->getSearchListAssets($this, $search_page);
100 $this->_tmp[
'no_asset_info_url_cache'] = TRUE;
102 $this->_tmp[
'search_terms'] = $children;
138 $search_field_name = $this->
attr(
'search_field');
139 if (empty($search_field_name))
return;
142 $search_page_link = $GLOBALS[
'SQ_SYSTEM']->am->getLink($this->
id, SQ_LINK_NOTICE,
'', FALSE,
'search_page');
143 if (!empty($search_page_link)) {
144 $search_page = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($search_page_link[
'minorid']);
146 if (is_null($search_page))
return;
148 $this->_tmp[
'search_url'] = $search_page->getURL().
'?mode=results&queries_'.$search_field_name.
'_query=';
167 $format = $this->
attr(
'default_format');
169 'search_term' =>
'<a href="'.$this->_tmp[
'search_url'].$word.
'">'.$word.
'</a>',
170 'number_of_occurrences' => $this->_tmp[
'search_terms'][$word][
'num_values'],
173 echo replace_keywords($format, $keywords);