New display options for advanced search page
This commit is contained in:
parent
5e5f48a090
commit
78a3d9a6f2
6 changed files with 32 additions and 8 deletions
|
@ -17,4 +17,4 @@ input.custom-search-default-value { color:#999;}
|
||||||
height: 0;
|
height: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
$node_types = db_query("SELECT type, name FROM {node_type} WHERE type IN (" . db_placeholders($searchable_node_types, 'varchar') . ")", $searchable_node_types);
|
||||||
// Build menu
|
// Build menu
|
||||||
$items = array();
|
$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)) {
|
while ($node_type = db_fetch_array($node_types)) {
|
||||||
// count # of results per type
|
// count # of results per type
|
||||||
$nbresults = 0;
|
$nbresults = 0;
|
||||||
foreach ($variables['results'] as $result) {
|
foreach ($variables['results'] as $result) {
|
||||||
if ($result['node']->type == $node_type['type']) $nbresults++;
|
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'])) {
|
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']);
|
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'])) {
|
if (isset($variables['info_split'])) {
|
||||||
foreach ($variables['info_split'] as $key => $info) {
|
foreach ($variables['info_split'] as $key => $info) {
|
||||||
if (!is_numeric($key)) {
|
if (!is_numeric($key)) {
|
||||||
|
if ($key == 'type') $info = t($info);
|
||||||
if (variable_get('custom_search_results_info_' . $key, TRUE)) array_push($infos, $info);
|
if (variable_get('custom_search_results_info_' . $key, TRUE)) array_push($infos, $info);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -65,4 +66,4 @@ function custom_search_preprocess_search_result(&$variables) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$variables['info'] = implode(' - ', $infos);
|
$variables['info'] = implode(' - ', $infos);
|
||||||
}
|
}
|
||||||
|
|
|
@ -990,7 +990,7 @@ function storm_dashboard($type = 'page') {
|
||||||
$link_blocks = storm_dashboard_get_links(TRUE, $type);
|
$link_blocks = storm_dashboard_get_links(TRUE, $type);
|
||||||
if (!empty($link_blocks)) {
|
if (!empty($link_blocks)) {
|
||||||
// ALWAYS DISPLAY A PAIR NUMBER OF ITEMS
|
// ALWAYS DISPLAY A PAIR NUMBER OF ITEMS
|
||||||
if (count($link_blocks) % 2) {
|
if ($type == 'page' && count($link_blocks) % 2) {
|
||||||
$link_blocks[] = array(
|
$link_blocks[] = array(
|
||||||
'theme' => 'storm_dashboard_link',
|
'theme' => 'storm_dashboard_link',
|
||||||
'title' => t('Advanced search'),
|
'title' => t('Advanced search'),
|
||||||
|
|
|
@ -34,6 +34,29 @@
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* "Advanced search" page.
|
||||||
|
*/
|
||||||
|
.custom-search-filter ul {
|
||||||
|
margin: 0;
|
||||||
|
padding: 12px 0;
|
||||||
|
}
|
||||||
|
.custom-search-filter ul li {
|
||||||
|
list-style: none;
|
||||||
|
display: inline-block;
|
||||||
|
background-color: #3c8dbc;
|
||||||
|
padding: 3px 10px;
|
||||||
|
margin: 0 4px 12px 0;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-size: .92em;
|
||||||
|
}
|
||||||
|
.custom-search-filter ul li:hover {
|
||||||
|
background-color: #307095;
|
||||||
|
}
|
||||||
|
.custom-search-filter ul li a {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "Storm list" blocks.
|
* "Storm list" blocks.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -377,7 +377,7 @@ function zuitedesk_breadcrumb($breadcrumb) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
// No breadcrumb in home page and others:
|
// No breadcrumb in home page and others:
|
||||||
if (in_array(arg(0), array('user', 'ideas'))) {
|
if (in_array(arg(0), array('user', 'search', 'ideas'))) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
// No breadcrumb if it's only one link to home page:
|
// No breadcrumb if it's only one link to home page:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name = SuiteDesk Theme
|
name = SuiteDesk Theme
|
||||||
description = SuiteDesk Theme Zen.
|
description = SuiteDesk Theme Zen.
|
||||||
version = 0.2.58
|
version = 0.2.59
|
||||||
|
|
||||||
screenshot = screenshot.png
|
screenshot = screenshot.png
|
||||||
|
|
||||||
|
|
Reference in a new issue