aboutsummaryrefslogtreecommitdiff
path: root/mod/thewire
diff options
context:
space:
mode:
Diffstat (limited to 'mod/thewire')
-rw-r--r--mod/thewire/pages/thewire/owner.php4
-rw-r--r--mod/thewire/pages/thewire/view.php30
-rw-r--r--mod/thewire/start.php11
3 files changed, 42 insertions, 3 deletions
diff --git a/mod/thewire/pages/thewire/owner.php b/mod/thewire/pages/thewire/owner.php
index f544aa655..6246c1770 100644
--- a/mod/thewire/pages/thewire/owner.php
+++ b/mod/thewire/pages/thewire/owner.php
@@ -14,10 +14,12 @@ $title = elgg_echo('thewire:user', array($owner->name));
elgg_push_breadcrumb(elgg_echo('thewire'), "thewire/all");
elgg_push_breadcrumb($owner->name);
+$context = '';
if (elgg_get_logged_in_user_guid() == $owner->guid) {
$form_vars = array('class' => 'thewire-form');
$content = elgg_view_form('thewire/add', $form_vars);
$content .= elgg_view('input/urlshortener');
+ $context = 'mine';
}
$content .= elgg_list_entities(array(
@@ -28,7 +30,7 @@ $content .= elgg_list_entities(array(
));
$body = elgg_view_layout('content', array(
- 'filter_context' => 'mine',
+ 'filter_context' => $context,
'content' => $content,
'title' => $title,
'sidebar' => elgg_view('thewire/sidebar'),
diff --git a/mod/thewire/pages/thewire/view.php b/mod/thewire/pages/thewire/view.php
new file mode 100644
index 000000000..1818e725a
--- /dev/null
+++ b/mod/thewire/pages/thewire/view.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * View individual wire post
+ */
+
+$post = get_entity(get_input('guid'));
+if (!$post) {
+ register_error(elgg_echo('noaccess'));
+ 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);
diff --git a/mod/thewire/start.php b/mod/thewire/start.php
index ebfe29538..8e3b5224a 100644
--- a/mod/thewire/start.php
+++ b/mod/thewire/start.php
@@ -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]);
@@ -304,7 +311,7 @@ function thewire_save_post($text, $userid, $access_id, $parent_guid = 0, $method
*/
function thewire_send_response_notification($guid, $parent_guid, $user) {
$parent_owner = get_entity($parent_guid)->getOwnerEntity();
- $user = get_loggedin_user();
+ $user = elgg_get_logged_in_user_entity();
// check to make sure user is not responding to self
if ($parent_owner->guid != $user->guid) {