aboutsummaryrefslogtreecommitdiff
path: root/mod/videolist/pages
diff options
context:
space:
mode:
Diffstat (limited to 'mod/videolist/pages')
-rw-r--r--mod/videolist/pages/videolist/add.php39
-rw-r--r--mod/videolist/pages/videolist/all.php34
-rw-r--r--mod/videolist/pages/videolist/edit.php49
-rw-r--r--mod/videolist/pages/videolist/friends.php33
-rw-r--r--mod/videolist/pages/videolist/owner.php54
-rw-r--r--mod/videolist/pages/videolist/watch.php42
6 files changed, 251 insertions, 0 deletions
diff --git a/mod/videolist/pages/videolist/add.php b/mod/videolist/pages/videolist/add.php
new file mode 100644
index 000000000..6dd6a2f1f
--- /dev/null
+++ b/mod/videolist/pages/videolist/add.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Add a new video
+ *
+ * @package ElggVideolist
+ */
+
+$page_owner = elgg_get_page_owner_entity();
+
+gatekeeper();
+group_gatekeeper();
+
+$title = elgg_echo('videolist:add');
+
+// set up breadcrumbs
+elgg_push_breadcrumb(elgg_echo('videolist'), "file/all");
+if (elgg_instanceof($page_owner, 'user')) {
+ elgg_push_breadcrumb($page_owner->name, "videolist/owner/$page_owner->username");
+} else {
+ elgg_push_breadcrumb($page_owner->name, "videolist/group/$page_owner->guid/all");
+}
+elgg_push_breadcrumb($title);
+
+// create form
+$form_vars = array();
+$body_vars = array(
+ 'container_guid' => $page_owner->guid,
+ 'access_id' => elgg_instanceof($page_owner, 'user') ? ACCESS_DEFAULT : $page_owner->group_acl,
+);
+
+$content = elgg_view_form('videolist/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/videolist/pages/videolist/all.php b/mod/videolist/pages/videolist/all.php
new file mode 100644
index 000000000..6fe68f3eb
--- /dev/null
+++ b/mod/videolist/pages/videolist/all.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * All videos
+ *
+ * @package ElggVideolist
+ */
+
+elgg_push_breadcrumb(elgg_echo('videolist'));
+
+elgg_register_title_button();
+
+$limit = get_input("limit", 10);
+
+$title = elgg_echo('videolist:all');
+
+$content = elgg_list_entities(array(
+ 'types' => 'object',
+ 'subtypes' => 'videolist_item',
+ 'limit' => $limit,
+ 'full_view' => FALSE
+));
+
+$sidebar = elgg_view('videolist/sidebar');
+
+elgg_set_context('videolist');
+$body = elgg_view_layout('content', array(
+ 'filter_context' => 'all',
+ 'content' => $content,
+ 'title' => $title,
+ 'sidebar' => $sidebar,
+));
+
+// Finally draw the page
+echo elgg_view_page($title, $body);
diff --git a/mod/videolist/pages/videolist/edit.php b/mod/videolist/pages/videolist/edit.php
new file mode 100644
index 000000000..916d9d280
--- /dev/null
+++ b/mod/videolist/pages/videolist/edit.php
@@ -0,0 +1,49 @@
+<?php
+/**
+ * Edit a videolist item
+ *
+ * @package ElggVideolist
+ */
+
+gatekeeper();
+
+$guid = (int) get_input('guid');
+$videolist_item = get_entity($guid);
+if (!$videolist_item) {
+ forward();
+}
+if (!$videolist_item->canEdit()) {
+ forward();
+}
+
+$title = elgg_echo('videolist:edit');
+$container = get_entity($videolist_item->getContainerGUID());
+
+elgg_push_breadcrumb(elgg_echo('videolist'), "videolist/all");
+if(elgg_instanceof($container, 'user')){
+ elgg_push_breadcrumb($container->name, "videolist/owner/$container->username/");
+} else {
+ elgg_push_breadcrumb($container->name, "videolist/group/$container->guid/");
+}
+elgg_push_breadcrumb($videolist_item->title, $videolist_item->getURL());
+elgg_push_breadcrumb($title);
+
+elgg_set_page_owner_guid($container->guid);
+
+$form_vars = array();
+$body_vars = array('guid' => $guid);
+
+foreach(array_keys(elgg_get_config('videolist')) as $variable) {
+ $body_vars[$variable] = $videolist_item->$variable;
+}
+$body_vars['container_guid'] = $videolist_item->container_guid;
+
+$content = elgg_view_form('videolist/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/videolist/pages/videolist/friends.php b/mod/videolist/pages/videolist/friends.php
new file mode 100644
index 000000000..8bbb34698
--- /dev/null
+++ b/mod/videolist/pages/videolist/friends.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Friends Videolist
+ *
+ * @package ElggVideolist
+ */
+
+$page_owner = elgg_get_page_owner_entity();
+
+elgg_push_breadcrumb(elgg_echo('videolist'), "videolist/all");
+elgg_push_breadcrumb($page_owner->name, "videolist/owner/$page_owner->username");
+elgg_push_breadcrumb(elgg_echo('friends'));
+
+elgg_register_title_button();
+
+$title = elgg_echo("videolist:friends");
+
+// offset is grabbed in list_user_friends_objects
+$content = list_user_friends_objects($page_owner->guid, 'videolist_items', 10, false);
+if (!$content) {
+ $content = elgg_echo("videolist:none");
+}
+
+$sidebar = elgg_view('videolist/sidebar', array());
+
+$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/videolist/pages/videolist/owner.php b/mod/videolist/pages/videolist/owner.php
new file mode 100644
index 000000000..74917354e
--- /dev/null
+++ b/mod/videolist/pages/videolist/owner.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Individual's or group's videolist
+ *
+ * @package ElggVideolist
+ */
+
+// access check for closed groups
+group_gatekeeper();
+
+$page_owner = elgg_get_page_owner_entity();
+
+elgg_push_breadcrumb(elgg_echo('videolist'), "videolist/all");
+elgg_push_breadcrumb($page_owner->name);
+
+elgg_register_title_button();
+
+$params = array();
+
+if ($page_owner->guid == elgg_get_logged_in_user_guid()) {
+ // user looking at own videolist
+ $params['filter_context'] = 'mine';
+} else if (elgg_instanceof($page_owner, 'user')) {
+ // someone else's videolist
+ // do not show select a tab when viewing someone else's posts
+ $params['filter_context'] = 'none';
+} else {
+ // group videolist
+ $params['filter'] = '';
+}
+
+$title = elgg_echo("videolist:owner", array($page_owner->name));
+
+// List videolist
+$content = elgg_list_entities(array(
+ 'types' => 'object',
+ 'subtypes' => 'videolist_item',
+ 'container_guid' => $page_owner->guid,
+ 'limit' => 10,
+ 'full_view' => FALSE,
+));
+if (!$content) {
+ $content = elgg_echo("videolist:none");
+}
+
+$sidebar = elgg_view('videolist/sidebar');
+
+$params['content'] = $content;
+$params['title'] = $title;
+$params['sidebar'] = $sidebar;
+
+$body = elgg_view_layout('content', $params);
+
+echo elgg_view_page($title, $body);
diff --git a/mod/videolist/pages/videolist/watch.php b/mod/videolist/pages/videolist/watch.php
new file mode 100644
index 000000000..3a740f396
--- /dev/null
+++ b/mod/videolist/pages/videolist/watch.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * View a file
+ *
+ * @package ElggFile
+ */
+
+$videolist_item = get_entity(get_input('guid'));
+
+elgg_set_page_owner_guid($videolist_item->container_guid);
+
+$page_owner = elgg_get_page_owner_entity();
+
+elgg_push_breadcrumb(elgg_echo('videolist'), 'videolist/all');
+
+$crumbs_title = $page_owner->name;
+if (elgg_instanceof($page_owner, 'group')) {
+ elgg_push_breadcrumb($crumbs_title, "videolist/group/$page_owner->guid/all");
+} else {
+ elgg_push_breadcrumb($crumbs_title, "videolist/owner/$page_owner->username");
+}
+
+$title = $videolist_item->title;
+
+elgg_push_breadcrumb($title);
+
+$content = elgg_view_entity($videolist_item, array('full_view' => true));
+$content .= elgg_view_comments($videolist_item);
+
+$sidebar = elgg_view('videolist/sidebar', array(
+ 'show_comments' => false,
+ 'show_videolist' => true,
+));
+
+$body = elgg_view_layout('content', array(
+ 'content' => $content,
+ 'title' => $title,
+ 'filter' => '',
+ 'sidebar' => $sidebar,
+));
+
+echo elgg_view_page($title, $body);