From e7b9401e4e918ec7c4a442e2acb3fb48926e90a9 Mon Sep 17 00:00:00 2001 From: brettp Date: Fri, 11 Jun 2010 21:57:33 +0000 Subject: Some code cleanup on profile plugin. Added wrapper view for profile content. Added ECML for profile content. Moved profile/profile_content/sidebar to profile/sidebar git-svn-id: http://code.elgg.org/elgg/trunk@6464 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/profile/profile_lib.php | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) (limited to 'mod/profile/profile_lib.php') diff --git a/mod/profile/profile_lib.php b/mod/profile/profile_lib.php index b38286e1e..909191847 100644 --- a/mod/profile/profile_lib.php +++ b/mod/profile/profile_lib.php @@ -15,38 +15,24 @@ * @param string $username The username of the profile to display * @param string $section Which section is currently selected. * - * return mixed FALSE or html for the profile. + * @todo - This should really use a plugin hook to get the list of plugin tabs + * + * @return mixed FALSE or html for the profile. */ function profile_get_user_profile_html($user, $section = 'activity') { $body = elgg_view('profile/profile_navigation', array('section' => $section, 'entity' => $user)); $view_options = array('entity' => $user); - switch($section){ - case 'friends': - $body .= elgg_view('profile/profile_contents/friends', $view_options); - break; + if ($section == 'commentwall') { + $comments = $user->getAnnotations('commentwall', 200, 0, 'desc'); + $view_options['comments'] = $comments; + } - case 'twitter': - $body .= elgg_view('profile/profile_contents/twitter', $view_options); - break; - case 'feeds': - $body .= elgg_view('profile/profile_contents/feeds', $view_options); - break; - case 'commentwall': - $comments = $user->getAnnotations('commentwall', 200, 0, 'desc'); - $body .= elgg_view('profile/profile_contents/commentwall', array("entity" => $user, "comments" => $comments)); - break; - case 'details': - $body .= elgg_view('profile/profile_contents/details', $view_options); - break; + $content = elgg_view("profile/profile_contents/$section", $view_options); - default: - case 'activity': - $body .= elgg_view('profile/profile_contents/activity', $view_options); - break; - } + $body .= elgg_view('profile/profile_content', array('content' => $content)); - $body .= elgg_view('profile/profile_contents/sidebar', array('section' => $section)); + $body .= elgg_view('profile/sidebar', array('section' => $section)); return $body; } -- cgit v1.2.3