aboutsummaryrefslogtreecommitdiff
path: root/mod/videolist/views/default
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2013-11-09 16:11:25 +0100
committerSem <sembrestels@riseup.net>2013-11-09 16:11:25 +0100
commit59448d8a9864573c05477a63a6dda404c455fdb6 (patch)
tree8222848ea99b84a33b07a3113ff63bb07ab46692 /mod/videolist/views/default
parent4cf4e4d3969ab43978c95f88238547530b01422d (diff)
parent17d7adcb317d25e37d3091e94b66e3f16de54196 (diff)
downloadelgg-59448d8a9864573c05477a63a6dda404c455fdb6.tar.gz
elgg-59448d8a9864573c05477a63a6dda404c455fdb6.tar.bz2
Add 'mod/videolist/' from commit '17d7adcb317d25e37d3091e94b66e3f16de54196'
git-subtree-dir: mod/videolist git-subtree-mainline: 4cf4e4d3969ab43978c95f88238547530b01422d git-subtree-split: 17d7adcb317d25e37d3091e94b66e3f16de54196
Diffstat (limited to 'mod/videolist/views/default')
-rw-r--r--mod/videolist/views/default/forms/videolist/edit.php55
-rw-r--r--mod/videolist/views/default/icon/object/videolist_item.php47
-rw-r--r--mod/videolist/views/default/object/videolist_item.php108
-rw-r--r--mod/videolist/views/default/page/elements/videolist_block.php36
-rw-r--r--mod/videolist/views/default/river/object/videolist_item/create.php15
-rw-r--r--mod/videolist/views/default/videolist/css.php23
-rw-r--r--mod/videolist/views/default/videolist/group_module.php43
-rw-r--r--mod/videolist/views/default/videolist/sidebar.php28
-rw-r--r--mod/videolist/views/default/videolist/watch.php8
-rw-r--r--mod/videolist/views/default/videolist/watch/bliptv.php6
-rw-r--r--mod/videolist/views/default/videolist/watch/gisstv.php7
-rw-r--r--mod/videolist/views/default/videolist/watch/metacafe.php6
-rw-r--r--mod/videolist/views/default/videolist/watch/vimeo.php5
-rw-r--r--mod/videolist/views/default/videolist/watch/youtube.php5
-rw-r--r--mod/videolist/views/default/widgets/videolist/content.php32
-rw-r--r--mod/videolist/views/default/widgets/videolist/edit.php24
16 files changed, 448 insertions, 0 deletions
diff --git a/mod/videolist/views/default/forms/videolist/edit.php b/mod/videolist/views/default/forms/videolist/edit.php
new file mode 100644
index 000000000..18fb6ded4
--- /dev/null
+++ b/mod/videolist/views/default/forms/videolist/edit.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Videolist edit form body
+ *
+ * @package ElggVideolist
+ */
+
+$variables = elgg_get_config('videolist');
+
+if(empty($vars['guid'])){
+ unset($variables['title']);
+ unset($variables['description']);
+} else {
+ unset($variables['video_url']);
+}
+
+foreach ($variables as $name => $type) {
+?>
+<div>
+ <label><?php echo elgg_echo("videolist:$name") ?></label>
+ <?php
+ if ($type != 'longtext') {
+ echo '<br />';
+ }
+ ?>
+ <?php echo elgg_view("input/$type", array(
+ 'name' => $name,
+ 'value' => $vars[$name],
+ ));
+ ?>
+</div>
+<?php
+}
+
+$cats = elgg_view('categories', $vars);
+if (!empty($cats)) {
+ echo $cats;
+}
+
+
+echo '<div class="elgg-foot">';
+if ($vars['guid']) {
+ echo elgg_view('input/hidden', array(
+ 'name' => 'video_guid',
+ 'value' => $vars['guid'],
+ ));
+}
+echo elgg_view('input/hidden', array(
+ 'name' => 'container_guid',
+ 'value' => $vars['container_guid'],
+));
+
+echo elgg_view('input/submit', array('value' => elgg_echo('save')));
+
+echo '</div>';
diff --git a/mod/videolist/views/default/icon/object/videolist_item.php b/mod/videolist/views/default/icon/object/videolist_item.php
new file mode 100644
index 000000000..24a5b5fe8
--- /dev/null
+++ b/mod/videolist/views/default/icon/object/videolist_item.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Generic icon view.
+ *
+ * @package Elgg
+ * @subpackage Core
+ *
+ * @uses $vars['entity'] The entity the icon represents - uses getIconURL() method
+ * @uses $vars['size'] topbar, tiny, small, medium (default), large, master
+ * @uses $vars['href'] Optional override for link
+ */
+
+$entity = $vars['entity'];
+/* @var ElggObject $entity */
+
+$sizes = array('small', 'medium', 'large', 'tiny', 'master', 'topbar');
+$img_width = array('tiny' => 25, 'small' => 40, 'medium' => 100, 'large' => 200);
+
+// Get size
+if (!in_array($vars['size'], $sizes)) {
+ $size = "medium";
+} else {
+ $size = $vars['size'];
+}
+
+if (isset($entity->name)) {
+ $title = $entity->name;
+} else {
+ $title = $entity->title;
+}
+
+$url = $entity->getURL();
+if (isset($vars['href'])) {
+ $url = $vars['href'];
+}
+
+$img_src = $entity->getIconURL($vars['size']);
+$img = "<img src=\"$img_src\" alt=\"$title\" width=\"{$img_width[$size]}\" />";
+
+if ($url) {
+ echo elgg_view('output/url', array(
+ 'href' => $url,
+ 'text' => $img,
+ ));
+} else {
+ echo $img;
+}
diff --git a/mod/videolist/views/default/object/videolist_item.php b/mod/videolist/views/default/object/videolist_item.php
new file mode 100644
index 000000000..5789c8475
--- /dev/null
+++ b/mod/videolist/views/default/object/videolist_item.php
@@ -0,0 +1,108 @@
+<?php
+/**
+ * Videolist item renderer.
+ *
+ * @package ElggVideolist
+ */
+
+$full = elgg_extract('full_view', $vars, FALSE);
+$entity = elgg_extract('entity', $vars, FALSE);
+/* @var ElggObject $entity */
+
+if (!$entity) {
+ return TRUE;
+}
+
+$owner = $entity->getOwnerEntity();
+$container = $entity->getContainerEntity();
+$categories = elgg_view('output/categories', $vars);
+$excerpt = elgg_get_excerpt($entity->description);
+
+$body = elgg_view('output/longtext', array('value' => $entity->description));
+
+$owner_link = elgg_view('output/url', array(
+ 'href' => "videolist/owner/$owner->username",
+ 'text' => $owner->name,
+));
+$author_text = elgg_echo('byline', array($owner_link));
+
+$entity_icon = elgg_view_entity_icon($entity, 'medium');
+$owner_icon = elgg_view_entity_icon($owner, 'small');
+
+$tags = elgg_view('output/tags', array('tags' => $entity->tags));
+$date = elgg_view_friendly_time($entity->time_created);
+
+$comments_count = $entity->countComments();
+//only display if there are commments
+if ($comments_count != 0) {
+ $text = elgg_echo("comments") . " ($comments_count)";
+ $comments_link = elgg_view('output/url', array(
+ 'href' => $entity->getURL() . '#videolist-item-comments',
+ 'text' => $text,
+ ));
+} else {
+ $comments_link = '';
+}
+
+$metadata = elgg_view_menu('entity', array(
+ 'entity' => $vars['entity'],
+ 'handler' => 'videolist',
+ 'sort_by' => 'priority',
+ 'class' => 'elgg-menu-hz',
+));
+
+$subtitle = "$author_text $date $categories $comments_link";
+
+// do not show the metadata and controls in widget view
+if (elgg_in_context('widgets')) {
+ $metadata = '';
+ $excerpt = '';
+}
+
+if ($full && !elgg_in_context('gallery')) {
+
+ $content = elgg_view("videolist/watch", $vars);
+ $content = "<div class=\"videolist-watch\">$content</div>";
+
+ $params = array(
+ 'entity' => $entity,
+ 'title' => false,
+ 'content' => $content,
+ 'metadata' => $metadata,
+ 'subtitle' => $subtitle,
+ 'tags' => $tags,
+ );
+ $params = $params + $vars;
+ $list_body = elgg_view('object/elements/summary', $params);
+
+ $entity_info = elgg_view_image_block($owner_icon, $list_body);
+
+ echo <<<HTML
+$entity_info
+$body
+HTML;
+
+} elseif (elgg_in_context('gallery')) {
+ echo '<div class="videolist-gallery-item">';
+ $content = elgg_view('output/url', array(
+ 'text' => elgg_get_excerpt($entity->title, 25),
+ 'href' => $entity->getURL(),
+ ));
+ $content .= "<p class='subtitle'>$owner_link $date</p>";
+ echo elgg_view_image_block($entity_icon, $content);
+ echo '</div>';
+} else {
+ // brief view
+
+ $params = array(
+ 'entity' => $entity,
+ 'metadata' => $metadata,
+ 'subtitle' => $subtitle,
+ 'tags' => $tags,
+ 'content' => $excerpt,
+ );
+ $params = $params + $vars;
+ $list_body = elgg_view('object/elements/summary', $params);
+
+ echo elgg_view_image_block($entity_icon, $list_body);
+}
diff --git a/mod/videolist/views/default/page/elements/videolist_block.php b/mod/videolist/views/default/page/elements/videolist_block.php
new file mode 100644
index 000000000..a0653a09e
--- /dev/null
+++ b/mod/videolist/views/default/page/elements/videolist_block.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Display the latest videolist items
+ *
+ * Generally used in a sidebar.
+ *
+ * @uses $vars['container_guid'] The videolist container
+ * @uses $vars['limit'] The number of comments to display
+ */
+
+$entity_guid = get_input('guid', ELGG_ENTITIES_ANY_VALUE);
+$container_guid = elgg_extract('container_guid', $vars, ELGG_ENTITIES_ANY_VALUE);
+
+$container = get_entity($container_guid);
+
+$options = array(
+ 'container_guid' => $container_guid,
+ 'limit' => elgg_extract('limit', $vars, 6),
+ 'type' => 'object',
+ 'subtypes' => 'videolist_item',
+ 'full_view' => false,
+ 'pagination' => false,
+ 'wheres' => array('guid <> ' . $entity_guid), // exclude this item from list.
+);
+
+if($container) {
+ $title = elgg_echo('videolist:owner', array($container->name));
+} else {
+ $title = elgg_echo('videolist');
+}
+
+elgg_push_context('gallery');
+$content = elgg_list_entities($options);
+elgg_pop_context('gallery');
+
+echo elgg_view_module('aside', $title, $content);
diff --git a/mod/videolist/views/default/river/object/videolist_item/create.php b/mod/videolist/views/default/river/object/videolist_item/create.php
new file mode 100644
index 000000000..ea9f8394b
--- /dev/null
+++ b/mod/videolist/views/default/river/object/videolist_item/create.php
@@ -0,0 +1,15 @@
+<?php
+/**
+ * Videolist item river view.
+ */
+
+$object = $vars['item']->getObjectEntity();
+$thumbnail = elgg_view('icon/object/videolist_item', array(
+ 'entity' => $object,
+ 'size' => 'medium',
+));
+
+echo elgg_view('river/item', array(
+ 'item' => $vars['item'],
+ 'message' => $thumbnail,
+));
diff --git a/mod/videolist/views/default/videolist/css.php b/mod/videolist/views/default/videolist/css.php
new file mode 100644
index 000000000..625935451
--- /dev/null
+++ b/mod/videolist/views/default/videolist/css.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Elgg Videolist CSS
+ */
+?>
+
+.videolist-watch {
+ margin-top: 40px;
+ position: relative;
+ padding-bottom: 56.25%;
+ padding-top: 30px;
+ height: 0;
+}
+
+.videolist-watch iframe,
+.videolist-watch object,
+.videolist-watch embed {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+} \ No newline at end of file
diff --git a/mod/videolist/views/default/videolist/group_module.php b/mod/videolist/views/default/videolist/group_module.php
new file mode 100644
index 000000000..0e0a1ab63
--- /dev/null
+++ b/mod/videolist/views/default/videolist/group_module.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Group videolist module
+ */
+
+$group = elgg_get_page_owner_entity();
+
+if ($group->videolist_enable == "no") {
+ return true;
+}
+
+$all_link = elgg_view('output/url', array(
+ 'href' => "videolist/group/$group->guid/all",
+ 'text' => elgg_echo('link:view:all'),
+));
+
+elgg_push_context('widgets');
+$options = array(
+ 'type' => 'object',
+ 'subtype' => 'videolist_item',
+ 'container_guid' => elgg_get_page_owner_guid(),
+ 'limit' => 6,
+ 'full_view' => false,
+ 'pagination' => false,
+);
+$content = elgg_list_entities($options);
+elgg_pop_context();
+
+if (!$content) {
+ $content = '<p>' . elgg_echo('videolist:none') . '</p>';
+}
+
+$new_link = elgg_view('output/url', array(
+ 'href' => "videolist/add/$group->guid",
+ 'text' => elgg_echo('videolist:add'),
+));
+
+echo elgg_view('groups/profile/module', array(
+ 'title' => elgg_echo('videolist:group'),
+ 'content' => $content,
+ 'all_link' => $all_link,
+ 'add_link' => $new_link,
+));
diff --git a/mod/videolist/views/default/videolist/sidebar.php b/mod/videolist/views/default/videolist/sidebar.php
new file mode 100644
index 000000000..4a9e1cdda
--- /dev/null
+++ b/mod/videolist/views/default/videolist/sidebar.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Videolist sidebar
+ */
+
+$show_comments = elgg_extract('show_comments', $vars, true);
+$show_tags = elgg_extract('show_tags', $vars, true);
+$show_videolist = elgg_extract('show_videolist', $vars, false);
+
+if($show_videolist){
+ echo elgg_view('page/elements/videolist_block', array(
+ 'container_guid' => elgg_get_page_owner_guid(),
+ ));
+}
+
+if($show_comments) {
+ echo elgg_view('page/elements/comments_block', array(
+ 'subtypes' => 'videolist_item',
+ 'owner_guid' => elgg_get_page_owner_guid(),
+ ));
+}
+
+if($show_tags) {
+ echo elgg_view('page/elements/tagcloud_block', array(
+ 'subtypes' => 'videolist_item',
+ 'owner_guid' => elgg_get_page_owner_guid(),
+ ));
+}
diff --git a/mod/videolist/views/default/videolist/watch.php b/mod/videolist/views/default/videolist/watch.php
new file mode 100644
index 000000000..2e1dbacec
--- /dev/null
+++ b/mod/videolist/views/default/videolist/watch.php
@@ -0,0 +1,8 @@
+<?php
+
+$entity = elgg_extract('entity', $vars);
+if (elgg_view_exists("videolist/watch/$entity->videotype")) {
+ echo elgg_view("videolist/watch/$entity->videotype", $vars);
+} else {
+ echo elgg_view("videolist/watch/default", $vars);
+}
diff --git a/mod/videolist/views/default/videolist/watch/bliptv.php b/mod/videolist/views/default/videolist/watch/bliptv.php
new file mode 100644
index 000000000..ae3d75901
--- /dev/null
+++ b/mod/videolist/views/default/videolist/watch/bliptv.php
@@ -0,0 +1,6 @@
+<?php
+
+$embedurl = $vars['entity']->embedurl;
+$embedurl = preg_replace('/https?:/', 'https:', $embedurl);
+
+echo "<iframe src=\"$embedurl\" frameborder=\"0\" allowfullscreen></iframe>";
diff --git a/mod/videolist/views/default/videolist/watch/gisstv.php b/mod/videolist/views/default/videolist/watch/gisstv.php
new file mode 100644
index 000000000..a96894ada
--- /dev/null
+++ b/mod/videolist/views/default/videolist/watch/gisstv.php
@@ -0,0 +1,7 @@
+<?php
+
+$video_id = $vars['entity']->video_id;
+
+echo "<video controls=\"\" tabindex=\"0\">
+ <source type=\"video/ogg\" src=\"http://giss.tv/dmmdb//contents/$video_id\"></source>
+</video>";
diff --git a/mod/videolist/views/default/videolist/watch/metacafe.php b/mod/videolist/views/default/videolist/watch/metacafe.php
new file mode 100644
index 000000000..ce8e257d5
--- /dev/null
+++ b/mod/videolist/views/default/videolist/watch/metacafe.php
@@ -0,0 +1,6 @@
+<?php
+
+$embedurl = $vars['entity']->embedurl;
+$embedurl = preg_replace('/https?:/', 'https:', $embedurl);
+
+echo "<embed flashVars=\"playerVars=autoPlay=no\" src=\"$embedurl\" wmode=\"transparent\" allowFullScreen=\"true\" allowScriptAccess=\"always\" name=\"Metacafe_$video_id\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\"></embed>";
diff --git a/mod/videolist/views/default/videolist/watch/vimeo.php b/mod/videolist/views/default/videolist/watch/vimeo.php
new file mode 100644
index 000000000..cdb4b6bfb
--- /dev/null
+++ b/mod/videolist/views/default/videolist/watch/vimeo.php
@@ -0,0 +1,5 @@
+<?php
+
+$video_id = $vars['entity']->video_id;
+
+echo "<iframe src=\"https://player.vimeo.com/video/$video_id?byline=0\" frameborder=\"0\" webkitAllowFullScreen allowFullScreen></iframe>";
diff --git a/mod/videolist/views/default/videolist/watch/youtube.php b/mod/videolist/views/default/videolist/watch/youtube.php
new file mode 100644
index 000000000..b0b758718
--- /dev/null
+++ b/mod/videolist/views/default/videolist/watch/youtube.php
@@ -0,0 +1,5 @@
+<?php
+
+$video_id = $vars['entity']->video_id;
+
+echo "<iframe src=\"https://www.youtube-nocookie.com/embed/$video_id\" frameborder=\"0\" allowfullscreen></iframe>";
diff --git a/mod/videolist/views/default/widgets/videolist/content.php b/mod/videolist/views/default/widgets/videolist/content.php
new file mode 100644
index 000000000..aaf6076a3
--- /dev/null
+++ b/mod/videolist/views/default/widgets/videolist/content.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Elgg video list widget
+ *
+ * @package ElggVideolist
+ */
+
+$num = (int) $vars['entity']->videos_num;
+
+$options = array(
+ 'type' => 'object',
+ 'subtype' => 'videolist_item',
+ 'container_guid' => $vars['entity']->owner_guid,
+ 'limit' => $num,
+ 'full_view' => FALSE,
+ 'pagination' => FALSE,
+);
+$content = elgg_list_entities($options);
+
+echo $content;
+
+if ($content) {
+ $url = "pages/owner/" . elgg_get_page_owner_entity()->username;
+ $more_link = elgg_view('output/url', array(
+ 'href' => $url,
+ 'text' => elgg_echo('videolist:more'),
+ 'is_trusted' => true,
+ ));
+ echo "<span class=\"elgg-widget-more\">$more_link</span>";
+} else {
+ echo elgg_echo('videolist:none');
+}
diff --git a/mod/videolist/views/default/widgets/videolist/edit.php b/mod/videolist/views/default/widgets/videolist/edit.php
new file mode 100644
index 000000000..a2865848e
--- /dev/null
+++ b/mod/videolist/views/default/widgets/videolist/edit.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Elgg video list widget edit
+ *
+ * @package ElggVideolist
+ */
+
+// set default value
+if (!isset($vars['entity']->videos_num)) {
+ $vars['entity']->videos_num = 4;
+}
+
+$params = array(
+ 'name' => 'params[videos_num]',
+ 'value' => $vars['entity']->videos_num,
+ 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
+);
+$dropdown = elgg_view('input/dropdown', $params);
+
+?>
+<div>
+ <?php echo elgg_echo('videolist:num_videos'); ?>:
+ <?php echo $dropdown; ?>
+</div>