aboutsummaryrefslogtreecommitdiff
path: root/mod/search
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-14 02:37:45 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-01-14 02:37:45 +0000
commit73a5af81b7be538ce318d708d19154dfc5c62b23 (patch)
tree3dcd1d76abe9314a3af591e370fa18710d4ce3a8 /mod/search
parentf7f0bf90892fdc8b0a3e611883498f1708b15807 (diff)
downloadelgg-73a5af81b7be538ce318d708d19154dfc5c62b23.tar.gz
elgg-73a5af81b7be538ce318d708d19154dfc5c62b23.tar.bz2
using new menu system and page layouts in search
git-svn-id: http://code.elgg.org/elgg/trunk@7883 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/search')
-rw-r--r--mod/search/index.php21
-rw-r--r--mod/search/views/default/search/layout.php2
-rw-r--r--mod/search/views/default/search/no_results.php6
3 files changed, 19 insertions, 10 deletions
diff --git a/mod/search/index.php b/mod/search/index.php
index 82182dd75..8662283e4 100644
--- a/mod/search/index.php
+++ b/mod/search/index.php
@@ -66,7 +66,7 @@ $params = array(
$types = get_registered_entity_types();
$custom_types = elgg_trigger_plugin_hook('search_types', 'get_types', $params, array());
-// add submenu items for all and native types
+// add sidebar items for all and native types
// @todo should these maintain any existing type / subtype filters or reset?
$data = htmlspecialchars(http_build_query(array(
'q' => $query,
@@ -77,7 +77,8 @@ $data = htmlspecialchars(http_build_query(array(
//'friends' => $friends
)));
$url = elgg_get_site_url()."pg/search/?$data";
-add_submenu_item(elgg_echo('all'), $url);
+$menu_item = new ElggMenuItem('all', elgg_echo('all'), $url);
+elgg_register_menu_item('page', $menu_item);
foreach ($types as $type => $subtypes) {
// @todo when using index table, can include result counts on each of these.
@@ -95,8 +96,8 @@ foreach ($types as $type => $subtypes) {
)));
$url = elgg_get_site_url()."pg/search/?$data";
-
- add_submenu_item(elgg_echo($label), $url);
+ $menu_item = new ElggMenuItem($label, elgg_echo($label), $url);
+ elgg_register_menu_item('page', $menu_item);
}
} else {
$label = "item:$type";
@@ -111,11 +112,12 @@ foreach ($types as $type => $subtypes) {
$url = elgg_get_site_url()."pg/search/?$data";
- add_submenu_item(elgg_echo($label), $url);
+ $menu_item = new ElggMenuItem($label, elgg_echo($label), $url);
+ elgg_register_menu_item('page', $menu_item);
}
}
-// add submenu for custom searches
+// add sidebar for custom searches
foreach ($custom_types as $type) {
$label = "search_types:$type";
@@ -130,7 +132,8 @@ foreach ($custom_types as $type) {
$url = elgg_get_site_url()."pg/search/?$data";
- add_submenu_item(elgg_echo($label), $url);
+ $menu_item = new ElggMenuItem($label, elgg_echo($label), $url);
+ elgg_register_menu_item('page', $menu_item);
}
@@ -138,7 +141,7 @@ foreach ($custom_types as $type) {
if (!$query) {
$body = elgg_view_title(elgg_echo('search:search_error'));
$body .= elgg_echo('search:no_query');
- $layout = elgg_view_layout('one_column_with_sidebar', array('content' => $body));
+ $layout = elgg_view_layout('one_sidebar', array('content' => $body));
echo elgg_view_page($title, $layout);
return;
@@ -246,7 +249,7 @@ $highlighted_query = search_highlight_words($searched_words, $query);
$body = elgg_view_title(elgg_echo('search:results', array("\"$highlighted_query\"")));
if (!$results_html) {
- $body .= elgg_view('page/elements/contentwrapper', array('body' => elgg_echo('search:no_results')));
+ $body .= elgg_view('search/no_results');
} else {
$body .= $results_html;
}
diff --git a/mod/search/views/default/search/layout.php b/mod/search/views/default/search/layout.php
index 82f191e8c..6882f252d 100644
--- a/mod/search/views/default/search/layout.php
+++ b/mod/search/views/default/search/layout.php
@@ -6,4 +6,4 @@
* @subpackage Core
*/
-echo elgg_view_layout('one_column_with_sidebar', array('content' => $vars['body'])); \ No newline at end of file
+echo elgg_view_layout('one_sidebar', array('content' => $vars['body'])); \ No newline at end of file
diff --git a/mod/search/views/default/search/no_results.php b/mod/search/views/default/search/no_results.php
new file mode 100644
index 000000000..74b5b2cfa
--- /dev/null
+++ b/mod/search/views/default/search/no_results.php
@@ -0,0 +1,6 @@
+<?php
+/**
+ * No results from search
+ */
+
+echo autop(elgg_echo('search:no_results'));