New display options for advanced search page

This commit is contained in:
Manuel Cillero 2017-09-20 23:25:14 +02:00
parent 5e5f48a090
commit 78a3d9a6f2
6 changed files with 32 additions and 8 deletions

View file

@ -17,4 +17,4 @@ input.custom-search-default-value { color:#999;}
height: 0;
overflow: hidden;
position: absolute;
}
}

View file

@ -27,17 +27,17 @@ function custom_search_preprocess_search_results(&$variables) {
$node_types = db_query("SELECT type, name FROM {node_type} WHERE type IN (" . db_placeholders($searchable_node_types, 'varchar') . ")", $searchable_node_types);
// Build menu
$items = array();
$items[] = l(variable_get('custom_search_type_selector_all', CUSTOM_SEARCH_ALL_TEXT_DEFAULT), 'search/node/' . $keys);
$items[] = l(t(variable_get('custom_search_type_selector_all', CUSTOM_SEARCH_ALL_TEXT_DEFAULT)), 'search/node/' . $keys);
while ($node_type = db_fetch_array($node_types)) {
// count # of results per type
$nbresults = 0;
foreach ($variables['results'] as $result) {
if ($result['node']->type == $node_type['type']) $nbresults++;
}
if ($nbresults) $items[] = l($node_type['name'], 'search/node/' . $keys . ' type:' . $node_type['type']);
if ($nbresults) $items[] = l(t($node_type['name']), 'search/node/' . $keys . ' type:' . $node_type['type']);
}
if (!isset($variables['filter-title'])) {
$variables['filter-title'] = filter_xss(variable_get('custom_search_filter_label', CUSTOM_SEARCH_FILTER_LABEL_DEFAULT));
$variables['filter-title'] = filter_xss(t(variable_get('custom_search_filter_label', CUSTOM_SEARCH_FILTER_LABEL_DEFAULT)));
}
if (count($items) > 2) $variables['filter'] = theme('item_list', $items, $variables['filter-title']);
}
@ -56,6 +56,7 @@ function custom_search_preprocess_search_result(&$variables) {
if (isset($variables['info_split'])) {
foreach ($variables['info_split'] as $key => $info) {
if (!is_numeric($key)) {
if ($key == 'type') $info = t($info);
if (variable_get('custom_search_results_info_' . $key, TRUE)) array_push($infos, $info);
}
else {
@ -65,4 +66,4 @@ function custom_search_preprocess_search_result(&$variables) {
}
}
$variables['info'] = implode(' - ', $infos);
}
}

View file

@ -990,7 +990,7 @@ function storm_dashboard($type = 'page') {
$link_blocks = storm_dashboard_get_links(TRUE, $type);
if (!empty($link_blocks)) {
// ALWAYS DISPLAY A PAIR NUMBER OF ITEMS
if (count($link_blocks) % 2) {
if ($type == 'page' && count($link_blocks) % 2) {
$link_blocks[] = array(
'theme' => 'storm_dashboard_link',
'title' => t('Advanced search'),