From ef5c47e15604ccd993ed50d466e25f5442c1017f Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 13 Feb 2009 13:16:19 +0000 Subject: Added better content filtering for dashboard git-svn-id: https://code.elgg.org/elgg/trunk@2738 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/riverdashboard/index.php | 13 ++++++++++--- .../views/default/riverdashboard/nav.php | 20 +++++++++++++------- 2 files changed, 23 insertions(+), 10 deletions(-) (limited to 'mod/riverdashboard') diff --git a/mod/riverdashboard/index.php b/mod/riverdashboard/index.php index d4be29b85..9d3a98d81 100644 --- a/mod/riverdashboard/index.php +++ b/mod/riverdashboard/index.php @@ -14,10 +14,16 @@ gatekeeper(); - $subtype = get_input('content',''); + $content = get_input('content',''); + $content = explode(',',$content); + $type = $content[0]; + $subtype = $content[1]; $orient = get_input('display'); - if ($subtype == 'all') $subtype = ''; + if ($type == 'all') { + $type = ''; + $subtype = ''; + } switch($orient) { case 'mine': @@ -32,8 +38,9 @@ break; } - $river = elgg_view_river_items($subject_guid, 0, $relationship_type, '', $subtype, ''); + $river = elgg_view_river_items($subject_guid, 0, $relationship_type, $type, $subtype, ''); $body = elgg_view('riverdashboard/nav',array( + 'type' => $type, 'subtype' => $subtype, 'orient' => $orient )); diff --git a/mod/riverdashboard/views/default/riverdashboard/nav.php b/mod/riverdashboard/views/default/riverdashboard/nav.php index a6e3a9381..6692d2bd0 100644 --- a/mod/riverdashboard/views/default/riverdashboard/nav.php +++ b/mod/riverdashboard/views/default/riverdashboard/nav.php @@ -2,9 +2,15 @@ $contents = array(); $contents['all'] = 'all'; - if (!empty($vars['config']->registered_entities['object'])) { - foreach ($vars['config']->registered_entities['object'] as $object) - $contents['item:object:'.$object] = $object; + if (!empty($vars['config']->registered_entities)) { + foreach ($vars['config']->registered_entities as $type => $ar) { + foreach ($vars['config']->registered_entities[$type] as $object) { + if (!empty($object )) { + $keyname = 'item:'.$type.':'.$object; + } else $keyname = 'item:'.$type; + $contents[$keyname] = "{$type},{$object}"; + } + } } $allselect = ''; $friendsselect = ''; $mineselect = ''; @@ -22,9 +28,9 @@
@@ -34,7 +40,7 @@ $content) { - if (($vars['subtype'] == $content) || + if (("{$vars['type']},{$vars['subtype']}" == $content) || (empty($vars['subtype']) && $content == 'all')) { $selected = 'selected="selected"'; } else $selected = ''; -- cgit v1.2.3