From 78a3d9a6f20815af645358bb64ee7f16d89cff84 Mon Sep 17 00:00:00 2001 From: Manuel Cillero Date: Wed, 20 Sep 2017 23:25:14 +0200 Subject: [PATCH] New display options for advanced search page --- modules/custom_search/custom_search.css | 2 +- .../theme/custom_search.pages.inc | 9 ++++---- modules/storm/storm.module | 2 +- themes/zuitedesk/css/suitedesk.css | 23 +++++++++++++++++++ themes/zuitedesk/template.php | 2 +- themes/zuitedesk/zuitedesk.info | 2 +- 6 files changed, 32 insertions(+), 8 deletions(-) diff --git a/modules/custom_search/custom_search.css b/modules/custom_search/custom_search.css index adddaff..c715a25 100644 --- a/modules/custom_search/custom_search.css +++ b/modules/custom_search/custom_search.css @@ -17,4 +17,4 @@ input.custom-search-default-value { color:#999;} height: 0; overflow: hidden; position: absolute; -} \ No newline at end of file +} diff --git a/modules/custom_search/theme/custom_search.pages.inc b/modules/custom_search/theme/custom_search.pages.inc index a1a6b1f..2bb56a5 100644 --- a/modules/custom_search/theme/custom_search.pages.inc +++ b/modules/custom_search/theme/custom_search.pages.inc @@ -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); -} \ No newline at end of file +} diff --git a/modules/storm/storm.module b/modules/storm/storm.module index cba4e7c..ffe6b75 100644 --- a/modules/storm/storm.module +++ b/modules/storm/storm.module @@ -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'), diff --git a/themes/zuitedesk/css/suitedesk.css b/themes/zuitedesk/css/suitedesk.css index ac8805a..f8dd77d 100644 --- a/themes/zuitedesk/css/suitedesk.css +++ b/themes/zuitedesk/css/suitedesk.css @@ -34,6 +34,29 @@ 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. */ diff --git a/themes/zuitedesk/template.php b/themes/zuitedesk/template.php index 1f505a0..7a5d967 100644 --- a/themes/zuitedesk/template.php +++ b/themes/zuitedesk/template.php @@ -377,7 +377,7 @@ function zuitedesk_breadcrumb($breadcrumb) { return ''; } // 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 ''; } // No breadcrumb if it's only one link to home page: diff --git a/themes/zuitedesk/zuitedesk.info b/themes/zuitedesk/zuitedesk.info index 1f589fb..6f93994 100644 --- a/themes/zuitedesk/zuitedesk.info +++ b/themes/zuitedesk/zuitedesk.info @@ -1,6 +1,6 @@ name = SuiteDesk Theme description = SuiteDesk Theme Zen. -version = 0.2.58 +version = 0.2.59 screenshot = screenshot.png