diff options
Diffstat (limited to 'mod/thewire/pages')
| -rw-r--r-- | mod/thewire/pages/friends.php | 23 | ||||
| -rw-r--r-- | mod/thewire/pages/previous.php | 11 | ||||
| -rw-r--r-- | mod/thewire/pages/thewire/everyone.php (renamed from mod/thewire/pages/everyone.php) | 60 | ||||
| -rw-r--r-- | mod/thewire/pages/thewire/friends.php | 31 | ||||
| -rw-r--r-- | mod/thewire/pages/thewire/owner.php (renamed from mod/thewire/pages/user.php) | 72 | ||||
| -rw-r--r-- | mod/thewire/pages/thewire/previous.php | 20 | ||||
| -rw-r--r-- | mod/thewire/pages/thewire/reply.php (renamed from mod/thewire/pages/reply.php) | 56 | ||||
| -rw-r--r-- | mod/thewire/pages/thewire/tag.php (renamed from mod/thewire/pages/tag.php) | 5 | ||||
| -rw-r--r-- | mod/thewire/pages/thewire/thread.php (renamed from mod/thewire/pages/thread.php) | 55 | ||||
| -rw-r--r-- | mod/thewire/pages/thewire/view.php | 31 |
10 files changed, 209 insertions, 155 deletions
diff --git a/mod/thewire/pages/friends.php b/mod/thewire/pages/friends.php deleted file mode 100644 index 239359ec2..000000000 --- a/mod/thewire/pages/friends.php +++ /dev/null @@ -1,23 +0,0 @@ -<?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 deleted file mode 100644 index 05fc3267e..000000000 --- a/mod/thewire/pages/previous.php +++ /dev/null @@ -1,11 +0,0 @@ -<?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/everyone.php b/mod/thewire/pages/thewire/everyone.php index 75abd282d..c7438747e 100644 --- a/mod/thewire/pages/everyone.php +++ b/mod/thewire/pages/thewire/everyone.php @@ -1,29 +1,31 @@ -<?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);
+<?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/user.php b/mod/thewire/pages/thewire/owner.php index cc966697f..dc25940e1 100644 --- a/mod/thewire/pages/user.php +++ b/mod/thewire/pages/thewire/owner.php @@ -1,33 +1,39 @@ -<?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);
+<?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/reply.php b/mod/thewire/pages/thewire/reply.php index e349761f2..df4511c51 100644 --- a/mod/thewire/pages/reply.php +++ b/mod/thewire/pages/thewire/reply.php @@ -1,28 +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);
+<?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/tag.php b/mod/thewire/pages/thewire/tag.php index 7e62a33de..1c88030ec 100644 --- a/mod/thewire/pages/tag.php +++ b/mod/thewire/pages/thewire/tag.php @@ -5,10 +5,10 @@ $tag = get_input('tag'); if (!$tag) { - forward('pg/thewire/all'); + forward('thewire/all'); } -elgg_push_breadcrumb(elgg_echo('thewire'), 'pg/thewire/all'); +elgg_push_breadcrumb(elgg_echo('thewire'), 'thewire/all'); elgg_push_breadcrumb('#' . $tag); // remove # from tag @@ -30,7 +30,6 @@ $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/thewire/thread.php index 49ca3afd1..ec2709430 100644 --- a/mod/thewire/pages/thread.php +++ b/mod/thewire/pages/thewire/thread.php @@ -1,28 +1,27 @@ -<?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);
+<?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); |
