aboutsummaryrefslogtreecommitdiff
path: root/mod/thewire/pages
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-12 22:41:25 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-12 22:41:25 +0000
commitda90ff55725a9118ce6111ab2b6371650bf78ade (patch)
tree937da734d50c8147ca8f2cc52791dabf430464c6 /mod/thewire/pages
parentcc6b7d1d223241e397e0d41354924e74606eeffc (diff)
downloadelgg-da90ff55725a9118ce6111ab2b6371650bf78ade.tar.gz
elgg-da90ff55725a9118ce6111ab2b6371650bf78ade.tar.bz2
a mostly completed port of JHU/APL wire plugin to 1.8
git-svn-id: http://code.elgg.org/elgg/trunk@8183 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/thewire/pages')
-rw-r--r--mod/thewire/pages/everyone.php29
-rw-r--r--mod/thewire/pages/friends.php23
-rw-r--r--mod/thewire/pages/previous.php11
-rw-r--r--mod/thewire/pages/reply.php28
-rw-r--r--mod/thewire/pages/tag.php36
-rw-r--r--mod/thewire/pages/thread.php28
-rw-r--r--mod/thewire/pages/user.php33
7 files changed, 188 insertions, 0 deletions
diff --git a/mod/thewire/pages/everyone.php b/mod/thewire/pages/everyone.php
new file mode 100644
index 000000000..75abd282d
--- /dev/null
+++ b/mod/thewire/pages/everyone.php
@@ -0,0 +1,29 @@
+<?php
+/**
+ * All wire posts
+ *
+ */
+
+elgg_push_breadcrumb(elgg_echo('thewire'));
+
+$title = elgg_echo('thewire:everyone');
+
+if (elgg_is_logged_in()) {
+ $content .= elgg_view_form('thewire/add');
+ $content .= elgg_view('input/urlshortener');
+}
+
+$content .= elgg_list_entities(array(
+ 'type' => 'object',
+ 'subtype' => 'thewire',
+ 'limit' => 15,
+));
+
+$body = elgg_view_layout('content', array(
+ 'filter_context' => 'all',
+ 'content' => $content,
+ 'title' => $title,
+ 'buttons' => false,
+));
+
+echo elgg_view_page($title, $body);
diff --git a/mod/thewire/pages/friends.php b/mod/thewire/pages/friends.php
new file mode 100644
index 000000000..239359ec2
--- /dev/null
+++ b/mod/thewire/pages/friends.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Wire posts of your friends
+ */
+
+$owner = elgg_get_page_owner_entity();
+
+$title = elgg_echo('thewire:friends');
+
+elgg_push_breadcrumb(elgg_echo('thewire'), "pg/thewire/all/");
+elgg_push_breadcrumb($owner->name, "pg/thewire/owner/$owner->username");
+elgg_push_breadcrumb(elgg_echo('friends'));
+
+$content = list_user_friends_objects($owner->guid, 'thewire', 15, false);
+
+$body = elgg_view_layout('content', array(
+ 'filter_context' => 'friends',
+ 'content' => $content,
+ 'title' => $title,
+ 'buttons' => false,
+));
+
+echo elgg_view_page($title, $body);
diff --git a/mod/thewire/pages/previous.php b/mod/thewire/pages/previous.php
new file mode 100644
index 000000000..05fc3267e
--- /dev/null
+++ b/mod/thewire/pages/previous.php
@@ -0,0 +1,11 @@
+<?php
+/**
+ * Server up html for a post
+ */
+
+$guid = (int) get_input('guid');
+
+$parent = thewire_get_parent($guid);
+if ($parent) {
+ echo elgg_view_entity($parent);
+} \ No newline at end of file
diff --git a/mod/thewire/pages/reply.php b/mod/thewire/pages/reply.php
new file mode 100644
index 000000000..e349761f2
--- /dev/null
+++ b/mod/thewire/pages/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'), 'pg/thewire/all');
+elgg_push_breadcrumb($title);
+
+$content = elgg_view('thewire/reply', array('post' => $post));
+$content .= elgg_view_form('thewire/add', array(), array('post' => $post));
+$content .= elgg_view('input/urlshortener');
+
+
+$body = elgg_view_layout('content', array(
+ 'filter' => false,
+ 'content' => $content,
+ 'title' => $title,
+ 'buttons' => false,
+));
+
+echo elgg_view_page($title, $body);
diff --git a/mod/thewire/pages/tag.php b/mod/thewire/pages/tag.php
new file mode 100644
index 000000000..7e62a33de
--- /dev/null
+++ b/mod/thewire/pages/tag.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Wire posts tagged with <tag>
+ */
+
+$tag = get_input('tag');
+if (!$tag) {
+ forward('pg/thewire/all');
+}
+
+elgg_push_breadcrumb(elgg_echo('thewire'), 'pg/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,
+ 'buttons' => false,
+));
+
+echo elgg_view_page($title, $body);
diff --git a/mod/thewire/pages/thread.php b/mod/thewire/pages/thread.php
new file mode 100644
index 000000000..49ca3afd1
--- /dev/null
+++ b/mod/thewire/pages/thread.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * View conversation thread
+ */
+
+$thread_id = get_input('thread_id');
+
+$title = elgg_echo('thewire:thread');
+
+elgg_push_breadcrumb(elgg_echo('thewire'), 'pg/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,
+ 'buttons' => false,
+));
+
+echo elgg_view_page($title, $body);
diff --git a/mod/thewire/pages/user.php b/mod/thewire/pages/user.php
new file mode 100644
index 000000000..cc966697f
--- /dev/null
+++ b/mod/thewire/pages/user.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * User's wire posts
+ *
+ */
+
+$owner = elgg_get_page_owner_entity();
+
+$title = elgg_echo('thewire:user', array($owner->name));
+
+elgg_push_breadcrumb(elgg_echo('thewire'), "pg/thewire/all/");
+elgg_push_breadcrumb($owner->name);
+
+if (get_loggedin_userid() == $owner->guid) {
+ $content = elgg_view_form('thewire/add');
+ $content .= elgg_view('input/urlshortener');
+}
+
+$content .= elgg_list_entities(array(
+ 'type' => 'object',
+ 'subtype' => 'thewire',
+ 'owner_guid' => $owner->guid,
+ 'limit' => 15,
+));
+
+$body = elgg_view_layout('content', array(
+ 'filter_context' => 'mine',
+ 'content' => $content,
+ 'title' => $title,
+ 'buttons' => false,
+));
+
+echo elgg_view_page($title, $body);