diff --git a/modules/comment/helpers/comment_event.php b/modules/comment/helpers/comment_event.php
index bd336cda..12e8d73f 100644
--- a/modules/comment/helpers/comment_event.php
+++ b/modules/comment/helpers/comment_event.php
@@ -76,4 +76,16 @@ class comment_event_Core {
$data[] = $row->text;
}
}
+
+ static function show_user_profile($data) {
+ $view = new View("user_profile_comments.html");
+ $view->comments = ORM::factory("comment")
+ ->order_by("created", "DESC")
+ ->where("state", "=", "published")
+ ->where("author_id", "=", $data->user->id)
+ ->find_all();
+ if ($view->comments->count()) {
+ $data->content[] = (object)array("title" => t("Comments"), "view" => $view);
+ }
+ }
}
diff --git a/modules/comment/views/user_profile_comments.html.php b/modules/comment/views/user_profile_comments.html.php
new file mode 100644
index 00000000..a2a641ba
--- /dev/null
+++ b/modules/comment/views/user_profile_comments.html.php
@@ -0,0 +1,20 @@
+
+
diff --git a/modules/gallery/controllers/user_profile.php b/modules/gallery/controllers/user_profile.php
index 808531da..6159894d 100644
--- a/modules/gallery/controllers/user_profile.php
+++ b/modules/gallery/controllers/user_profile.php
@@ -31,25 +31,16 @@ class User_Profile_Controller extends Controller {
// @todo modify user_home to supply a link to their album,
// @todo add list of watches
- // @todo add all comments
// @todo add rest api key
$v->content->user = $user;
- $v->content->height = 250;
$v->content->not_current = !$is_current_active;
$v->content->editable = identity::is_writable() && $display_all;
$v->content->return = SafeString::of(Input::instance()->get("return"));
- $fields = array("name" => t("Name"), "locale" => t("Locale"), "email" => t("Email"),
- "full_name" => t("Full name"), "url" => "Web site");
- if (!$display_all) {
- $fields = array("name" => t("Name"), "full_name" => t("Full name"), "url" => "Web site");
- }
- $v->content->fields = array();
- foreach ($fields as $field => $label) {
- if (!empty($user->$field)) {
- $v->content->fields[(string)$label->for_html()] = $user->$field;
- }
- }
+ $event_data = (object)array("user" => $user, "display_all" => $display_all, "content" => array());
+ module::event("show_user_profile", $event_data);
+ Kohana_Log::add("error", Kohana::debug($event_data));
+ $v->content->info_parts = $event_data->content;
print $v;
}
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);
+
+ }
}
diff --git a/modules/gallery/views/user_profile.html.php b/modules/gallery/views/user_profile.html.php
index e7ce56b3..bcfa5346 100644
--- a/modules/gallery/views/user_profile.html.php
+++ b/modules/gallery/views/user_profile.html.php
@@ -1,9 +1,7 @@
-
-
-
= t("%name Profile", array("name" => $user->display_name())) ?>
+
+
+ foreach ($info_parts as $info): ?>
+ endforeach ?>