diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-06-11 21:57:33 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-06-11 21:57:33 +0000 |
commit | e7b9401e4e918ec7c4a442e2acb3fb48926e90a9 (patch) | |
tree | 3450eca9500facc192da0fd1373898962ae6fe8f /mod/profile/profile_lib.php | |
parent | 9cff8b2cbf16d11fe0861229347edf5e62dac2b5 (diff) | |
download | elgg-e7b9401e4e918ec7c4a442e2acb3fb48926e90a9.tar.gz elgg-e7b9401e4e918ec7c4a442e2acb3fb48926e90a9.tar.bz2 |
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
Diffstat (limited to 'mod/profile/profile_lib.php')
-rw-r--r-- | mod/profile/profile_lib.php | 34 |
1 files changed, 10 insertions, 24 deletions
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; } |