]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4567 adds a wire post view
authorCash Costello <cash.costello@gmail.com>
Wed, 13 Jun 2012 01:56:35 +0000 (21:56 -0400)
committerCash Costello <cash.costello@gmail.com>
Wed, 13 Jun 2012 01:56:35 +0000 (21:56 -0400)
mod/thewire/pages/thewire/view.php [new file with mode: 0644]
mod/thewire/start.php

diff --git a/mod/thewire/pages/thewire/view.php b/mod/thewire/pages/thewire/view.php
new file mode 100644 (file)
index 0000000..f45f94b
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+/**
+ * View individual wire post
+ */
+
+$post = get_entity(get_input('guid'));
+if (!$post) {
+       // @todo need special handling for not getting access to entity (check for existence, access)
+       forward();
+}
+$owner = $post->getOwnerEntity();
+if (!$owner) {
+       forward();
+}
+
+$title = elgg_echo('thewire:by', array($owner->name));
+
+elgg_push_breadcrumb(elgg_echo('thewire'), 'thewire/all');
+elgg_push_breadcrumb($owner->name, 'thewire/owner/' . $owner->username);
+elgg_push_breadcrumb($title);
+
+$content = elgg_view_entity($post);
+
+$body = elgg_view_layout('content', array(
+       'filter' => false,
+       'content' => $content,
+       'title' => $title,
+));
+
+echo elgg_view_page($title, $body);
index 5d5786e2fe77b29a65f2ed753c1e066cd071f66d..8e3b5224a8e39fc75d7a74aa6ae89deacd802e3c 100644 (file)
@@ -77,7 +77,8 @@ function thewire_init() {
  * thewire/owner/<username>     View this user's wire posts
  * thewire/following/<username> View the posts of those this user follows
  * thewire/reply/<guid>         Reply to a post
- * thewire/view/<guid>          View a conversation thread
+ * thewire/view/<guid>          View a post
+ * thewire/thread/<id>          View a conversation thread
  * thewire/tag/<tag>            View wire posts tagged with <tag>
  *
  * @param array $page From the page_handler function
@@ -104,6 +105,12 @@ function thewire_page_handler($page) {
                        include "$base_dir/owner.php";
                        break;
 
+               case "view":
+                       if (isset($page[1])) {
+                               set_input('guid', $page[1]);
+                       }
+                       include "$base_dir/view.php";
+
                case "thread":
                        if (isset($page[1])) {
                                set_input('thread_id', $page[1]);