]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Search types without a subtype now display properly.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 2 Dec 2009 22:24:13 +0000 (22:24 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 2 Dec 2009 22:24:13 +0000 (22:24 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@3717 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/search/views/default/search/listing.php

index a747f43e5c071412a66a02c14b9dc17f09cf247f..c650d0e530f543b87d8a8d610c438e6a2cec829f 100644 (file)
@@ -41,12 +41,22 @@ if (array_key_exists('pagination', $vars) && $vars['pagination']) {
        $nav = '';
 }
 
-// figure out what we're deal with.
+// figure out what we're dealing with.
+$type_str = NULL;
+
 if (array_key_exists('type', $vars['params']) && array_key_exists('subtype', $vars['params'])) {
-       $type_str = elgg_echo("item:{$vars['params']['type']}:{$vars['params']['subtype']}");
-} elseif (array_key_exists('type', $vars['params'])) {
+       $type_str_tmp = "item:{$vars['params']['type']}:{$vars['params']['subtype']}";
+       $type_str_echoed = elgg_echo($type_str_tmp);
+       if ($type_str_echoed != $type_str_tmp) {
+               $type_str = $type_str_echoed;
+       }
+}
+
+if (!$type_str && array_key_exists('type', $vars['params'])) {
        $type_str = elgg_echo("item:{$vars['params']['type']}");
-} else {
+}
+
+if (!$type_str) {
        $type_str = elgg_echo('search:unknown_entity');
 }