summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2010-01-24 15:27:33 -0800
committerTim Almdal <tnalmdal@shaw.ca>2010-01-24 15:27:33 -0800
commit7c06e21ec443a46bd78bc9e99d8284283ff85c59 (patch)
treef30063fc106eaace4a02c01a9c857924213f7eb9 /modules/gallery/helpers
parent3b16d0662b8a4b06f4be72165c858a1231e9bd67 (diff)
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.
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/gallery_event.php18
1 files changed, 18 insertions, 0 deletions
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);
+
+ }
}