aboutsummaryrefslogtreecommitdiff
path: root/mod/bookmarks/pages/bookmarks
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-18 01:31:22 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-18 01:31:22 +0000
commit01435072dc7d9b46bc30a3216501684a72e716a1 (patch)
tree7099a30d696c47302afea2f482e3142f9afec81a /mod/bookmarks/pages/bookmarks
parent231ca23ea10335a03b185d60a07ae3c92e9dfd63 (diff)
downloadelgg-01435072dc7d9b46bc30a3216501684a72e716a1.tar.gz
elgg-01435072dc7d9b46bc30a3216501684a72e716a1.tar.bz2
Refs #3158 namespaced pages for bookmarks and thewire
git-svn-id: http://code.elgg.org/elgg/trunk@8759 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/bookmarks/pages/bookmarks')
-rw-r--r--mod/bookmarks/pages/bookmarks/add.php23
-rw-r--r--mod/bookmarks/pages/bookmarks/all.php28
-rw-r--r--mod/bookmarks/pages/bookmarks/bookmarklet.php36
-rw-r--r--mod/bookmarks/pages/bookmarks/edit.php31
-rw-r--r--mod/bookmarks/pages/bookmarks/friends.php28
-rw-r--r--mod/bookmarks/pages/bookmarks/owner.php47
-rw-r--r--mod/bookmarks/pages/bookmarks/view.php34
7 files changed, 227 insertions, 0 deletions
diff --git a/mod/bookmarks/pages/bookmarks/add.php b/mod/bookmarks/pages/bookmarks/add.php
new file mode 100644
index 000000000..c7fd3cf79
--- /dev/null
+++ b/mod/bookmarks/pages/bookmarks/add.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Add bookmark page
+ *
+ * @package Bookmarks
+ */
+
+$page_owner = elgg_get_page_owner_entity();
+
+$title = elgg_echo('bookmarks:add');
+elgg_push_breadcrumb($title);
+
+$vars = bookmarks_prepare_form_vars();
+$content = elgg_view_form('bookmarks/save', array(), $vars);
+
+$body = elgg_view_layout('content', array(
+ 'filter' => '',
+ 'buttons' => '',
+ 'content' => $content,
+ 'title' => $title,
+));
+
+echo elgg_view_page($title, $body); \ No newline at end of file
diff --git a/mod/bookmarks/pages/bookmarks/all.php b/mod/bookmarks/pages/bookmarks/all.php
new file mode 100644
index 000000000..07ae5d327
--- /dev/null
+++ b/mod/bookmarks/pages/bookmarks/all.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Elgg bookmarks plugin everyone page
+ *
+ * @package ElggBookmarks
+ */
+
+elgg_set_page_owner_guid(elgg_get_logged_in_user_guid());
+
+$offset = (int)get_input('offset', 0);
+$content = elgg_list_entities(array(
+ 'type' => 'object',
+ 'subtype' => 'bookmarks',
+ 'limit' => 10,
+ 'offset' => $offset,
+ 'full_view' => false,
+ 'view_toggle_type' => false
+));
+
+$title = elgg_echo('bookmarks:everyone');
+
+$body = elgg_view_layout('content', array(
+ 'filter_context' => 'all',
+ 'content' => $content,
+ 'title' => $title
+));
+
+echo elgg_view_page($title, $body); \ No newline at end of file
diff --git a/mod/bookmarks/pages/bookmarks/bookmarklet.php b/mod/bookmarks/pages/bookmarks/bookmarklet.php
new file mode 100644
index 000000000..99866e385
--- /dev/null
+++ b/mod/bookmarks/pages/bookmarks/bookmarklet.php
@@ -0,0 +1,36 @@
+<?php
+/**
+* Elgg bookmarks plugin bookmarklet page
+*
+* @package Bookmarks
+*/
+
+gatekeeper();
+
+$container_guid = get_input('container_guid');
+$container = get_entity($container_guid);
+$page_owner = $container;
+
+if (elgg_instanceof($container, 'object')) {
+ $page_owner = $container->getContainerEntity();
+}
+
+elgg_set_page_owner_guid($page_owner->getGUID());
+
+$title = elgg_echo('bookmarks:bookmarklet');
+
+if ($page_owner instanceof ElggGroup) {
+ elgg_push_breadcrumb($page_owner->name, $page_owner->getURL());
+}
+
+elgg_push_breadcrumb($title);
+
+$content = elgg_view("bookmarks/bookmarklet");
+
+$body = elgg_view_layout('content', array(
+ 'content' => $content,
+ 'title' => $title,
+ 'filter' => false
+));
+
+echo elgg_view_page($title, $body); \ No newline at end of file
diff --git a/mod/bookmarks/pages/bookmarks/edit.php b/mod/bookmarks/pages/bookmarks/edit.php
new file mode 100644
index 000000000..24513a960
--- /dev/null
+++ b/mod/bookmarks/pages/bookmarks/edit.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Add bookmark page
+ *
+ * @package ElggBookmarks
+ */
+
+$bookmark_guid = get_input('guid');
+$bookmark = get_entity($bookmark_guid);
+
+if (!elgg_instanceof($bookmark, 'object', 'bookmarks') || !$bookmark->canEdit()) {
+ register_error(elgg_echo('bookmarks:unknown_bookmark'));
+ forward(REFERRER);
+}
+
+$page_owner = elgg_get_page_owner_entity();
+
+$title = elgg_echo('bookmarks:edit');
+elgg_push_breadcrumb($title);
+
+$vars = bookmarks_prepare_form_vars($bookmark);
+$content = elgg_view_form('bookmarks/save', array(), $vars);
+
+$body = elgg_view_layout('content', array(
+ 'filter' => '',
+ 'buttons' => '',
+ 'content' => $content,
+ 'title' => $title,
+));
+
+echo elgg_view_page($title, $body); \ No newline at end of file
diff --git a/mod/bookmarks/pages/bookmarks/friends.php b/mod/bookmarks/pages/bookmarks/friends.php
new file mode 100644
index 000000000..6e3f77cf6
--- /dev/null
+++ b/mod/bookmarks/pages/bookmarks/friends.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Elgg bookmarks plugin friends page
+ *
+ * @package ElggBookmarks
+ */
+
+$owner = elgg_get_page_owner_entity();
+
+elgg_push_breadcrumb($owner->name, "bookmarks/owner/$owner->username");
+elgg_push_breadcrumb(elgg_echo('friends'));
+
+$title = elgg_echo('bookmarks:friends');
+
+$content = list_user_friends_objects($owner->guid, 'bookmarks', 10, false);
+if (!$content) {
+ $content = elgg_echo('bookmarks:none');
+}
+
+$params = array(
+ 'filter_context' => 'friends',
+ 'content' => $content,
+ 'title' => $title,
+);
+
+$body = elgg_view_layout('content', $params);
+
+echo elgg_view_page($title, $body); \ No newline at end of file
diff --git a/mod/bookmarks/pages/bookmarks/owner.php b/mod/bookmarks/pages/bookmarks/owner.php
new file mode 100644
index 000000000..d1564f751
--- /dev/null
+++ b/mod/bookmarks/pages/bookmarks/owner.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Elgg bookmarks plugin everyone page
+ *
+ * @package Bookmarks
+ */
+
+$page_owner = elgg_get_page_owner_entity();
+
+elgg_push_breadcrumb($page_owner->name);
+
+$offset = (int)get_input('offset', 0);
+$content .= elgg_list_entities(array(
+ 'type' => 'object',
+ 'subtype' => 'bookmarks',
+ 'container_guid' => $page_owner->guid,
+ 'limit' => 10,
+ 'offset' => $offset,
+ 'full_view' => false,
+ 'view_toggle_type' => false
+));
+
+if (!$content) {
+ $content = elgg_echo('bookmarks:none');
+}
+
+$title = elgg_echo('bookmarks:owner', array($page_owner->name));
+
+$filter_context = '';
+if ($page_owner->getGUID() == elgg_get_logged_in_user_guid()) {
+ $filter_context = 'mine';
+}
+
+$vars = array(
+ 'filter_context' => $filter_context,
+ 'content' => $content,
+ 'title' => $title
+);
+
+// don't show filter if out of filter context
+if ($page_owner instanceof ElggGroup) {
+ $vars['filter'] = false;
+}
+
+$body = elgg_view_layout('content', $vars);
+
+echo elgg_view_page($title, $body); \ No newline at end of file
diff --git a/mod/bookmarks/pages/bookmarks/view.php b/mod/bookmarks/pages/bookmarks/view.php
new file mode 100644
index 000000000..142e0b246
--- /dev/null
+++ b/mod/bookmarks/pages/bookmarks/view.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * View a bookmark
+ *
+ * @package ElggBookmarks
+ */
+
+$bookmark = get_entity(get_input('guid'));
+
+$page_owner = elgg_get_page_owner_entity();
+
+$crumbs_title = $page_owner->name;
+
+if (elgg_instanceof($page_owner, 'group')) {
+ elgg_push_breadcrumb($crumbs_title, "bookmarks/group/$page_owner->guid/owner");
+} else {
+ elgg_push_breadcrumb($crumbs_title, "bookmarks/owner/$page_owner->username");
+}
+
+$title = $bookmark->title;
+
+elgg_push_breadcrumb($title);
+
+$content = elgg_view_entity($bookmark, true);
+$content .= elgg_view_comments($bookmark);
+
+$body = elgg_view_layout('content', array(
+ 'content' => $content,
+ 'title' => $title,
+ 'filter' => '',
+ 'header' => '',
+));
+
+echo elgg_view_page($title, $body);