aboutsummaryrefslogtreecommitdiff
path: root/mod/bookmarks/pages
diff options
context:
space:
mode:
Diffstat (limited to 'mod/bookmarks/pages')
-rw-r--r--mod/bookmarks/pages/bookmarks/add.php22
-rw-r--r--mod/bookmarks/pages/bookmarks/all.php34
-rw-r--r--mod/bookmarks/pages/bookmarks/bookmarklet.php36
-rw-r--r--mod/bookmarks/pages/bookmarks/edit.php30
-rw-r--r--mod/bookmarks/pages/bookmarks/friends.php33
-rw-r--r--mod/bookmarks/pages/bookmarks/owner.php51
-rw-r--r--mod/bookmarks/pages/bookmarks/view.php38
7 files changed, 244 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..d80d4a4bc
--- /dev/null
+++ b/mod/bookmarks/pages/bookmarks/add.php
@@ -0,0 +1,22 @@
+<?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' => '',
+ '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..bdb8fc793
--- /dev/null
+++ b/mod/bookmarks/pages/bookmarks/all.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Elgg bookmarks plugin everyone page
+ *
+ * @package ElggBookmarks
+ */
+
+elgg_pop_breadcrumb();
+elgg_push_breadcrumb(elgg_echo('bookmarks'));
+
+elgg_register_title_button();
+
+$content = elgg_list_entities(array(
+ 'type' => 'object',
+ 'subtype' => 'bookmarks',
+ 'limit' => 10,
+ 'full_view' => false,
+ 'view_toggle_type' => false
+));
+
+if (!$content) {
+ $content = elgg_echo('bookmarks:none');
+}
+
+$title = elgg_echo('bookmarks:everyone');
+
+$body = elgg_view_layout('content', array(
+ 'filter_context' => 'all',
+ 'content' => $content,
+ 'title' => $title,
+ 'sidebar' => elgg_view('bookmarks/sidebar'),
+));
+
+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..93b143c36
--- /dev/null
+++ b/mod/bookmarks/pages/bookmarks/edit.php
@@ -0,0 +1,30 @@
+<?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' => '',
+ '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..15b1da098
--- /dev/null
+++ b/mod/bookmarks/pages/bookmarks/friends.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Elgg bookmarks plugin friends page
+ *
+ * @package ElggBookmarks
+ */
+
+$page_owner = elgg_get_page_owner_entity();
+if (!$page_owner) {
+ forward('bookmarks/all');
+}
+
+elgg_push_breadcrumb($page_owner->name, "bookmarks/owner/$page_owner->username");
+elgg_push_breadcrumb(elgg_echo('friends'));
+
+elgg_register_title_button();
+
+$title = elgg_echo('bookmarks:friends');
+
+$content = list_user_friends_objects($page_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);
diff --git a/mod/bookmarks/pages/bookmarks/owner.php b/mod/bookmarks/pages/bookmarks/owner.php
new file mode 100644
index 000000000..a024ff352
--- /dev/null
+++ b/mod/bookmarks/pages/bookmarks/owner.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Elgg bookmarks plugin everyone page
+ *
+ * @package Bookmarks
+ */
+
+$page_owner = elgg_get_page_owner_entity();
+if (!$page_owner) {
+ forward('bookmarks/all');
+}
+
+elgg_push_breadcrumb($page_owner->name);
+
+elgg_register_title_button();
+
+$content .= elgg_list_entities(array(
+ 'type' => 'object',
+ 'subtype' => 'bookmarks',
+ 'container_guid' => $page_owner->guid,
+ 'limit' => 10,
+ '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,
+ 'sidebar' => elgg_view('bookmarks/sidebar'),
+);
+
+// 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..70a6a5bfe
--- /dev/null
+++ b/mod/bookmarks/pages/bookmarks/view.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * View a bookmark
+ *
+ * @package ElggBookmarks
+ */
+
+$bookmark = get_entity(get_input('guid'));
+if (!$bookmark) {
+ register_error(elgg_echo('noaccess'));
+ $_SESSION['last_forward_from'] = current_page_url();
+ forward('');
+}
+
+$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/all");
+} else {
+ elgg_push_breadcrumb($crumbs_title, "bookmarks/owner/$page_owner->username");
+}
+
+$title = $bookmark->title;
+
+elgg_push_breadcrumb($title);
+
+$content = elgg_view_entity($bookmark, array('full_view' => true));
+$content .= elgg_view_comments($bookmark);
+
+$body = elgg_view_layout('content', array(
+ 'content' => $content,
+ 'title' => $title,
+ 'filter' => '',
+));
+
+echo elgg_view_page($title, $body);