From 7c06e21ec443a46bd78bc9e99d8284283ff85c59 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sun, 24 Jan 2010 15:27:33 -0800 Subject: Refactor creating the user profile page content into the the event module. The show_user_profile is used to provide content to the user profile page. Add the list of the users comments to the profile page. --- modules/gallery/helpers/gallery_event.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'modules/gallery/helpers') diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 29940ac6..6b70513a 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -377,4 +377,22 @@ class gallery_event_Core { } } } + + static function show_user_profile($data) { + $v = new View("user_profile_info.html"); + + $fields = array("name" => t("Name"), "locale" => t("Locale"), "email" => t("Email"), + "full_name" => t("Full name"), "url" => "Web site"); + if (!$data->display_all) { + $fields = array("name" => t("Name"), "full_name" => t("Full name"), "url" => "Web site"); + } + $v->fields = array(); + foreach ($fields as $field => $label) { + if (!empty($data->user->$field)) { + $v->fields[(string)$label->for_html()] = $data->user->$field; + } + } + $data->content[] = (object)array("title" => t("User information"), "view" => $v); + + } } -- cgit v1.2.3