From bf1e40afcf8da4ea6e9d663531dfe3bc934483dc Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 11 Aug 2008 10:18:29 +0000 Subject: Added a search submenu. git-svn-id: https://code.elgg.org/elgg/trunk@1819 36083f99-b078-4883-b0ff-0f9b5a30f544 --- search/index.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'search') diff --git a/search/index.php b/search/index.php index 375d2fbdc..71e223d37 100644 --- a/search/index.php +++ b/search/index.php @@ -29,7 +29,24 @@ } $owner_guid = get_input('owner_guid',0); if (substr_count($owner_guid,',')) { - $owner_guid = explode(",",$owner_guid); + $owner_guid_array = explode(",",$owner_guid); + } else { + $owner_guid_array = $owner_guid; + } + + // Set up submenus + if ($object_types = get_registered_entity_types()) { + + foreach($object_types as $object_type => $subtype_array) { + if (is_array($subtype_array) && sizeof($subtype_array)) + foreach($subtype_array as $object_subtype) { + $label = 'item:' . $object_type; + if (!empty($object_subtype)) $label .= ':' . $object_subtype; + global $CONFIG; + add_submenu_item(elgg_echo($label), $CONFIG->wwwroot . "search/?tag=". urlencode($tag) ."&object=". urlencode($object_type) ."&tagtype=" . urlencode($md_type) . "&owner_guid=" . urlencode($owner_guid)); + } + } + } if (!empty($tag)) { @@ -37,7 +54,7 @@ $body .= elgg_view_title(sprintf(elgg_echo('searchtitle'),$tag)); $body .= trigger_plugin_hook('search','',$tag,""); $body .= elgg_view('search/startblurb',array('tag' => $tag)); - $body .= list_entities_from_metadata($md_type, $tag, $objecttype, $subtype, $owner_guid, 10, false, false); + $body .= list_entities_from_metadata($md_type, $tag, $objecttype, $subtype, $owner_guid_array, 10, false, false); $body = elgg_view_layout('two_column_left_sidebar','',$body); } -- cgit v1.2.3