aboutsummaryrefslogtreecommitdiff
path: root/mod/lightbox/pages
diff options
context:
space:
mode:
Diffstat (limited to 'mod/lightbox/pages')
-rw-r--r--mod/lightbox/pages/lightbox/friends.php34
-rw-r--r--mod/lightbox/pages/lightbox/new.php37
-rw-r--r--mod/lightbox/pages/lightbox/owner.php55
-rw-r--r--mod/lightbox/pages/lightbox/view.php39
-rw-r--r--mod/lightbox/pages/lightbox/world.php33
5 files changed, 198 insertions, 0 deletions
diff --git a/mod/lightbox/pages/lightbox/friends.php b/mod/lightbox/pages/lightbox/friends.php
new file mode 100644
index 000000000..6b0bbb03e
--- /dev/null
+++ b/mod/lightbox/pages/lightbox/friends.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Friends albums
+ *
+ * @package ElggLightbox
+ */
+
+$owner = elgg_get_page_owner_entity();
+if (!$owner) {
+ forward('photos/all');
+}
+
+elgg_push_breadcrumb(elgg_echo('lightbox'), "photos/all");
+elgg_push_breadcrumb($owner->name, "photos/owner/$owner->username");
+elgg_push_breadcrumb(elgg_echo('friends'));
+
+elgg_register_title_button();
+
+$title = elgg_echo("lightbox:friends");
+
+// offset is grabbed in list_user_friends_objects
+$content = list_user_friends_objects($owner->guid, 'albums', 10, false);
+if (!$content) {
+ $content = elgg_echo("lightbox:none");
+}
+
+$body = elgg_view_layout('content', array(
+ 'filter_context' => 'friends',
+ 'content' => $content,
+ 'title' => $title,
+ 'sidebar' => $sidebar,
+));
+
+echo elgg_view_page($title, $body);
diff --git a/mod/lightbox/pages/lightbox/new.php b/mod/lightbox/pages/lightbox/new.php
new file mode 100644
index 000000000..117aba293
--- /dev/null
+++ b/mod/lightbox/pages/lightbox/new.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Create a new album
+ *
+ * @package ElggLightbox
+ */
+
+//elgg_load_library('elgg:lightbox');
+
+$owner = elgg_get_page_owner_entity();
+
+gatekeeper();
+group_gatekeeper();
+
+$title = elgg_echo('photos:add');
+
+// set up breadcrumbs
+elgg_push_breadcrumb(elgg_echo('lightbox'), "photos/all");
+if (elgg_instanceof($owner, 'user')) {
+ elgg_push_breadcrumb($owner->name, "photos/owner/$owner->username");
+} else {
+ elgg_push_breadcrumb($owner->name, "photos/group/$owner->guid/all");
+}
+elgg_push_breadcrumb($title);
+
+// create form
+$form_vars = array('enctype' => 'multipart/form-data');
+$body_vars = array();
+$content = elgg_view_form('lightbox/edit', $form_vars, $body_vars);
+
+$body = elgg_view_layout('content', array(
+ 'content' => $content,
+ 'title' => $title,
+ 'filter' => '',
+));
+
+echo elgg_view_page($title, $body);
diff --git a/mod/lightbox/pages/lightbox/owner.php b/mod/lightbox/pages/lightbox/owner.php
new file mode 100644
index 000000000..536790906
--- /dev/null
+++ b/mod/lightbox/pages/lightbox/owner.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Individual's or group's albums
+ *
+ * @package ElggLightbox
+ */
+
+// access check for closed groups
+group_gatekeeper();
+
+$owner = elgg_get_page_owner_entity();
+if (!$owner) {
+ forward('photos/all');
+}
+
+elgg_push_breadcrumb(elgg_echo('lightbox'), "photos/all");
+elgg_push_breadcrumb($owner->name);
+
+elgg_register_title_button();
+
+$params = array();
+
+if ($owner->guid == elgg_get_logged_in_user_guid()) {
+ // user looking at own albums
+ $params['filter_context'] = 'mine';
+} else if (elgg_instanceof($owner, 'user')) {
+ // someone else's albums
+ // do not show select a tab when viewing someone else's posts
+ $params['filter_context'] = 'none';
+} else {
+ // group albums
+ $params['filter'] = '';
+}
+
+$title = elgg_echo("lightbox:user", array($owner->name));
+
+// List albums
+$content = elgg_list_entities(array(
+ 'types' => 'object',
+ 'subtypes' => 'album',
+ 'container_guid' => $owner->guid,
+ 'limit' => 10,
+ 'full_view' => FALSE,
+));
+if (!$content) {
+ $content = elgg_echo("lightbox:none");
+}
+
+$params['content'] = $content;
+$params['title'] = $title;
+$params['sidebar'] = elgg_view('lightbox/sidebar');
+
+$body = elgg_view_layout('content', $params);
+
+echo elgg_view_page($title, $body);
diff --git a/mod/lightbox/pages/lightbox/view.php b/mod/lightbox/pages/lightbox/view.php
new file mode 100644
index 000000000..6fa703895
--- /dev/null
+++ b/mod/lightbox/pages/lightbox/view.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * View an album or an image
+ *
+ * @package ElggLightbox
+ */
+
+$entity = get_entity(get_input('guid'));
+
+$owner = $entity->getContainerEntity();
+
+elgg_push_breadcrumb(elgg_echo('lightbox'), 'photos/all');
+
+$crumbs_title = $owner->name;
+if (elgg_instanceof($owner, 'group')) {
+ elgg_push_breadcrumb($crumbs_title, "photos/group/$owner->guid/all");
+} else {
+ elgg_push_breadcrumb($crumbs_title, "photos/owner/$owner->username");
+}
+
+if($entity->countEntitiesFromRelationship('in_album', true) > 0) {
+ $album = $entity->getEntitiesFromRelationship('in_album', true, 1);
+ elgg_push_breadcrumb($album[0]->title, $album[0]->getURL());
+}
+
+$title = $entity->title;
+
+elgg_push_breadcrumb($title);
+
+$content = elgg_view_entity($entity, array('full_view' => true));
+$content .= elgg_view_comments($entity);
+
+$body = elgg_view_layout('content', array(
+ 'content' => $content,
+ 'title' => $title,
+ 'filter' => '',
+));
+
+echo elgg_view_page($title, $body);
diff --git a/mod/lightbox/pages/lightbox/world.php b/mod/lightbox/pages/lightbox/world.php
new file mode 100644
index 000000000..6262faa1e
--- /dev/null
+++ b/mod/lightbox/pages/lightbox/world.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * All albums
+ *
+ * @package ElggLightbox
+ */
+
+elgg_push_breadcrumb(elgg_echo('lightbox'));
+
+elgg_register_title_button();
+
+$limit = get_input("limit", 10);
+
+$title = elgg_echo('lightbox:all');
+
+$content = elgg_list_entities(array(
+ 'types' => 'object',
+ 'subtypes' => 'album',
+ 'limit' => $limit,
+ 'full_view' => FALSE,
+));
+if (!$content) {
+ $content = elgg_echo('lightbox:none');
+}
+
+$body = elgg_view_layout('content', array(
+ 'filter_context' => 'all',
+ 'content' => $content,
+ 'title' => $title,
+ 'sidebar' => elgg_view('lightbox/sidebar'),
+));
+
+echo elgg_view_page($title, $body);