aboutsummaryrefslogtreecommitdiff
path: root/mod/thewire/pages
diff options
context:
space:
mode:
Diffstat (limited to 'mod/thewire/pages')
-rw-r--r--mod/thewire/pages/thewire/everyone.php31
-rw-r--r--mod/thewire/pages/thewire/friends.php31
-rw-r--r--mod/thewire/pages/thewire/owner.php39
-rw-r--r--mod/thewire/pages/thewire/previous.php20
-rw-r--r--mod/thewire/pages/thewire/reply.php28
-rw-r--r--mod/thewire/pages/thewire/tag.php35
-rw-r--r--mod/thewire/pages/thewire/thread.php27
-rw-r--r--mod/thewire/pages/thewire/view.php31
8 files changed, 242 insertions, 0 deletions
diff --git a/mod/thewire/pages/thewire/everyone.php b/mod/thewire/pages/thewire/everyone.php
new file mode 100644
index 000000000..c7438747e
--- /dev/null
+++ b/mod/thewire/pages/thewire/everyone.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * All wire posts
+ *
+ */
+
+elgg_push_breadcrumb(elgg_echo('thewire'));
+
+$title = elgg_echo('thewire:everyone');
+
+$content = '';
+if (elgg_is_logged_in()) {
+ $form_vars = array('class' => 'thewire-form');
+ $content .= elgg_view_form('thewire/add', $form_vars);
+ $content .= elgg_view('input/urlshortener');
+}
+
+$content .= elgg_list_entities(array(
+ 'type' => 'object',
+ 'subtype' => 'thewire',
+ 'limit' => get_input('limit', 15),
+));
+
+$body = elgg_view_layout('content', array(
+ 'filter_context' => 'all',
+ 'content' => $content,
+ 'title' => $title,
+ 'sidebar' => elgg_view('thewire/sidebar'),
+));
+
+echo elgg_view_page($title, $body);
diff --git a/mod/thewire/pages/thewire/friends.php b/mod/thewire/pages/thewire/friends.php
new file mode 100644
index 000000000..efa7e7a56
--- /dev/null
+++ b/mod/thewire/pages/thewire/friends.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Wire posts of your friends
+ */
+
+$owner = elgg_get_page_owner_entity();
+if (!$owner) {
+ forward('', '404');
+}
+
+$title = elgg_echo('thewire:friends');
+
+elgg_push_breadcrumb(elgg_echo('thewire'), "thewire/all");
+elgg_push_breadcrumb($owner->name, "thewire/owner/$owner->username");
+elgg_push_breadcrumb(elgg_echo('friends'));
+
+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');
+}
+
+$content .= list_user_friends_objects($owner->guid, 'thewire', 15, false);
+
+$body = elgg_view_layout('content', array(
+ 'filter_context' => 'friends',
+ 'content' => $content,
+ 'title' => $title,
+));
+
+echo elgg_view_page($title, $body);
diff --git a/mod/thewire/pages/thewire/owner.php b/mod/thewire/pages/thewire/owner.php
new file mode 100644
index 000000000..dc25940e1
--- /dev/null
+++ b/mod/thewire/pages/thewire/owner.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * User's wire posts
+ *
+ */
+
+$owner = elgg_get_page_owner_entity();
+if (!$owner) {
+ forward('', '404');
+}
+
+$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(
+ 'type' => 'object',
+ 'subtype' => 'thewire',
+ 'owner_guid' => $owner->guid,
+ 'limit' => get_input('limit', 15),
+));
+
+$body = elgg_view_layout('content', array(
+ 'filter_context' => $context,
+ 'content' => $content,
+ 'title' => $title,
+ 'sidebar' => elgg_view('thewire/sidebar'),
+));
+
+echo elgg_view_page($title, $body);
diff --git a/mod/thewire/pages/thewire/previous.php b/mod/thewire/pages/thewire/previous.php
new file mode 100644
index 000000000..a3f1cb01c
--- /dev/null
+++ b/mod/thewire/pages/thewire/previous.php
@@ -0,0 +1,20 @@
+<?php
+/**
+ * Serve up html for a post's parent
+ */
+
+$guid = (int) get_input('guid');
+$title = elgg_echo('thewire:previous');
+
+$parent = thewire_get_parent($guid);
+if ($parent) {
+ $body = elgg_view_entity($parent);
+}
+
+$body = elgg_view_layout('content', array(
+ 'filter' => false,
+ 'content' => $body,
+ 'title' => $title,
+));
+
+echo elgg_view_page($title, $body); \ No newline at end of file
diff --git a/mod/thewire/pages/thewire/reply.php b/mod/thewire/pages/thewire/reply.php
new file mode 100644
index 000000000..df4511c51
--- /dev/null
+++ b/mod/thewire/pages/thewire/reply.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Reply page
+ *
+ */
+
+gatekeeper();
+
+$post = get_entity(get_input('guid'));
+
+$title = elgg_echo('thewire:reply');
+
+elgg_push_breadcrumb(elgg_echo('thewire'), 'thewire/all');
+elgg_push_breadcrumb($title);
+
+$content = elgg_view('thewire/reply', array('post' => $post));
+$form_vars = array('class' => 'thewire-form');
+$content .= elgg_view_form('thewire/add', $form_vars, array('post' => $post));
+$content .= elgg_view('input/urlshortener');
+
+
+$body = elgg_view_layout('content', array(
+ 'filter' => false,
+ 'content' => $content,
+ 'title' => $title,
+));
+
+echo elgg_view_page($title, $body);
diff --git a/mod/thewire/pages/thewire/tag.php b/mod/thewire/pages/thewire/tag.php
new file mode 100644
index 000000000..1c88030ec
--- /dev/null
+++ b/mod/thewire/pages/thewire/tag.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Wire posts tagged with <tag>
+ */
+
+$tag = get_input('tag');
+if (!$tag) {
+ forward('thewire/all');
+}
+
+elgg_push_breadcrumb(elgg_echo('thewire'), 'thewire/all');
+elgg_push_breadcrumb('#' . $tag);
+
+// remove # from tag
+$tag = trim($tag, '# ');
+
+$title = elgg_echo('thewire:tags', array($tag));
+
+
+$content = elgg_list_entities_from_metadata(array(
+ 'metadata_name' => 'tags',
+ 'metadata_value' => $tag,
+ 'metadata_case_sensitive' => false,
+ 'type' => 'object',
+ 'subtype' => 'thewire',
+ 'limit' => 15,
+));
+
+$body = elgg_view_layout('content', array(
+ 'filter' => false,
+ 'content' => $content,
+ 'title' => $title,
+));
+
+echo elgg_view_page($title, $body);
diff --git a/mod/thewire/pages/thewire/thread.php b/mod/thewire/pages/thewire/thread.php
new file mode 100644
index 000000000..ec2709430
--- /dev/null
+++ b/mod/thewire/pages/thewire/thread.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * View conversation thread
+ */
+
+$thread_id = get_input('thread_id');
+
+$title = elgg_echo('thewire:thread');
+
+elgg_push_breadcrumb(elgg_echo('thewire'), 'thewire/all');
+elgg_push_breadcrumb($title);
+
+$content = elgg_list_entities_from_metadata(array(
+ "metadata_name" => "wire_thread",
+ "metadata_value" => $thread_id,
+ "type" => "object",
+ "subtype" => "thewire",
+ "limit" => 20,
+));
+
+$body = elgg_view_layout('content', array(
+ 'filter' => false,
+ 'content' => $content,
+ 'title' => $title,
+));
+
+echo elgg_view_page($title, $body);
diff --git a/mod/thewire/pages/thewire/view.php b/mod/thewire/pages/thewire/view.php
new file mode 100644
index 000000000..1709e5e9a
--- /dev/null
+++ b/mod/thewire/pages/thewire/view.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * View individual wire post
+ */
+
+$post = get_entity(get_input('guid'));
+if (!$post) {
+ register_error(elgg_echo('noaccess'));
+ $_SESSION['last_forward_from'] = current_page_url();
+ 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);