aboutsummaryrefslogtreecommitdiff
path: root/views/default
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2011-11-09 01:35:57 +0100
committerSem <sembrestels@riseup.net>2011-11-09 01:35:57 +0100
commit6b16fa9b322ae12a54c66ba5160cc7547d6e7667 (patch)
tree3fc01c57d72c0d76a0dfefa5d6e5c2136ec79117 /views/default
parent314f5c66f927a3b542e908e0794a8602129f2f8f (diff)
downloadelgg-6b16fa9b322ae12a54c66ba5160cc7547d6e7667.tar.gz
elgg-6b16fa9b322ae12a54c66ba5160cc7547d6e7667.tar.bz2
Videolist on groups and edit/delete functionalities.
Diffstat (limited to 'views/default')
-rw-r--r--views/default/object/videolist_item.php7
-rw-r--r--views/default/videolist/group_module.php43
-rw-r--r--views/default/videolist/groupprofile_videolist.php47
3 files changed, 47 insertions, 50 deletions
diff --git a/views/default/object/videolist_item.php b/views/default/object/videolist_item.php
index f2543dd19..63f3e6334 100644
--- a/views/default/object/videolist_item.php
+++ b/views/default/object/videolist_item.php
@@ -22,7 +22,7 @@ $base_type = substr($mime, 0, strpos($mime,'/'));
$body = elgg_view('output/longtext', array('value' => $entity->description));
$owner_link = elgg_view('output/url', array(
- 'href' => "file/owner/$owner->username",
+ 'href' => "videolist/owner/$owner->username",
'text' => $owner->name,
));
$author_text = elgg_echo('byline', array($owner_link));
@@ -38,7 +38,7 @@ $comments_count = $entity->countComments();
if ($comments_count != 0) {
$text = elgg_echo("comments") . " ($comments_count)";
$comments_link = elgg_view('output/url', array(
- 'href' => $entity->getURL() . '#file-comments',
+ 'href' => $entity->getURL() . '#videolist-item-comments',
'text' => $text,
));
} else {
@@ -47,7 +47,7 @@ if ($comments_count != 0) {
$metadata = elgg_view_menu('entity', array(
'entity' => $vars['entity'],
- 'handler' => 'file',
+ 'handler' => 'videolist',
'sort_by' => 'priority',
'class' => 'elgg-menu-hz',
));
@@ -57,6 +57,7 @@ $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')) {
diff --git a/views/default/videolist/group_module.php b/views/default/videolist/group_module.php
new file mode 100644
index 000000000..0e0a1ab63
--- /dev/null
+++ b/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/views/default/videolist/groupprofile_videolist.php b/views/default/videolist/groupprofile_videolist.php
deleted file mode 100644
index 33a22ab68..000000000
--- a/views/default/videolist/groupprofile_videolist.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-/**
- * Elgg Video Plugin
- * This plugin allows users to create a library of videos for groups
- *
- * @package ElggProfile
- * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
- * @author Prateek Choudhary <synapticfield@gmail.com>
- * @copyright Prateek Choudhary
- */
-
-?>
-<div class="group_tool_widget video">
-<span class="group_widget_link"><a href="<?php echo $vars['url'] . "videolist/owned/" . page_owner_entity()->username; ?>"><?php echo elgg_echo('link:view:all')?></a></span>
-<h3><?php echo elgg_echo("videolist:group"); ?></h3>
-
-<?php
-
-//the number of files to display
-$number = (int) $vars['entity']->num_display;
-if (!$number)
- $number = 5;
-
-//get the user's files
-$videos = elgg_get_entities(array('types' => 'object', 'subtypes' => 'videolist', 'container_guids' => page_owner(), 'limit' => $number));
-
-//if there are some files, go get them
-if ($videos) {
- foreach($videos as $f){
- $mime = $f->mimetype;
- $owner = get_entity($f->getOwner());
- $numcomments = elgg_count_comments($f);
- echo "<div class='entity_listing clearfloat'>";
- echo "<div class='entity_listing_icon'><a href=\"{$vars['url']}videolist/watch/{$f->guid}\"><img src=\"".$f->thumbnail."\" border=\"0\" width=\"85\" /></a></div>";
- echo "<div class='entity_listing_info'>";
- echo "<p class='entity_title'><a href=\"{$vars['url']}videolist/watch/{$f->guid}\">" . $f->title ."</a></p><p class='entity_subtext'><a href=\"{$vars['url']}profile/{$owner->username}\">{$owner->name}</a> ";
- echo friendly_time($f->time_created) . "</p>";
- echo "</div></div>";
-
- }
-
-} else {
- $upload_video = $vars['url'] . "videolist/browse/" . page_owner_entity()->username;
- echo "<p class='margin_top'><a href=\"{$upload_video}\">" . elgg_echo("videolist:add") . "</a></p>";
-}
-echo "</div>";
-?>