From 84de3a9ab57277bbaedb30c5e24070f8a5ad4431 Mon Sep 17 00:00:00 2001 From: Sem Date: Sun, 6 Nov 2011 22:42:30 +0100 Subject: Videolist objects all in one view. --- views/default/object/videolist.php | 54 -------------------- views/default/object/videolist_item.php | 90 +++++++++++++++++++++++++++++++++ views/default/object/watch.php | 52 ------------------- 3 files changed, 90 insertions(+), 106 deletions(-) delete mode 100644 views/default/object/videolist.php create mode 100644 views/default/object/videolist_item.php delete mode 100644 views/default/object/watch.php (limited to 'views/default') diff --git a/views/default/object/videolist.php b/views/default/object/videolist.php deleted file mode 100644 index d67d35b23..000000000 --- a/views/default/object/videolist.php +++ /dev/null @@ -1,54 +0,0 @@ - -/* YouTube/vimeo/metacafe video Object file -/* @copyright Prateek.Choudhary -/*****************************************************************************************/ - -$video_file = $vars['entity']; - -if(!empty($video_file)) { - $url = $video_file->url; - $title = $video_file->title; - $video_guid = $video_file->guid; - $video_id = $video_file->video_id; - $videotype = $video_file->videotype; - $videothumbnail = $video_file->thumbnail; - $owner = $vars['entity']->getOwnerEntity(); - $friendlytime = friendly_time($vars['entity']->time_created); - - $mime = "image/html"; - $thumbnail = $videothumbnail; - $watch_URL = $vars['url']."videolist/watch/".$video_guid; - - $object_acl = get_readable_access_level($video_file->access_id); - // metadata block, - access level, edit, delete, + options view extender - $info = "
" . $object_acl . ""; - - // view for plugins to extend - $info .= elgg_view('videolist/options', array('entity' => $video_file)); - - // include edit and delete options - if ($owner->canEdit()) { - $info .= "" . elgg_echo('edit') . ""; - $info .= "" . elgg_view('output/confirmlink',array('href' => $vars['url'] . "action/videolist/delete?video=" . $video_guid, 'text' => elgg_echo("delete"),'confirm' => elgg_echo("videolist:delete:confirm"),)). ""; - } - $info .= "
"; - - if(get_input('show_viewtype') == "all") { - $info .= '

'.$title.'

'; - $info .= "

username}\">{$owner->name} {$friendlytime}"; - $info .= "

"; - $icon = "" . elgg_view("videolist/icon", array("mimetype" => $mime, 'thumbnail' => $thumbnail, 'video_guid' => $video_guid, 'size' => 'small')) . ""; - echo "
".elgg_view_listing($icon, $info)."
"; - } else { - $info .= '

'.$title.'

'; - $info .= "

username}\">{$owner->name} {$friendlytime}"; - $info .= "

"; - $icon = "" . elgg_view("videolist/icon", array("mimetype" => $mime, 'thumbnail' => $thumbnail, 'video_guid' => $video_guid, 'size' => 'small')) . ""; - echo "
".elgg_view_listing($icon, $info)."
"; - } -} else { - echo "

".elgg_echo('videolist:none:found')."

"; -} diff --git a/views/default/object/videolist_item.php b/views/default/object/videolist_item.php new file mode 100644 index 000000000..35946579b --- /dev/null +++ b/views/default/object/videolist_item.php @@ -0,0 +1,90 @@ + +/* YouTube/vimeo/metacafe video Object file +/* @copyright Prateek.Choudhary +/*****************************************************************************************/ + +$video_file = $vars['entity']; +$full_view = $vars['full_view']; + +if(!$full_view) { + $url = $video_file->url; + $title = $video_file->title; + $video_guid = $video_file->guid; + $video_id = $video_file->video_id; + $videotype = $video_file->videotype; + $videothumbnail = $video_file->thumbnail; + $owner = $vars['entity']->getOwnerEntity(); + $friendlytime = friendly_time($vars['entity']->time_created); + + $mime = "image/html"; + $thumbnail = $videothumbnail; + $watch_URL = $vars['url']."videolist/watch/".$video_guid; + + $object_acl = get_readable_access_level($video_file->access_id); + // metadata block, - access level, edit, delete, + options view extender + $info = "
" . $object_acl . ""; + + // view for plugins to extend + $info .= elgg_view('videolist/options', array('entity' => $video_file)); + + // include edit and delete options + if ($owner->canEdit()) { + $info .= "" . elgg_echo('edit') . ""; + $info .= "" . elgg_view('output/confirmlink',array('href' => $vars['url'] . "action/videolist/delete?video=" . $video_guid, 'text' => elgg_echo("delete"),'confirm' => elgg_echo("videolist:delete:confirm"),)). ""; + } + $info .= "
"; + + if(get_input('show_viewtype') == "all") { + $info .= '

'.$title.'

'; + $info .= "

username}\">{$owner->name} {$friendlytime}"; + $info .= "

"; + $icon = "" . elgg_view("videolist/icon", array("mimetype" => $mime, 'thumbnail' => $thumbnail, 'video_guid' => $video_guid, 'size' => 'small')) . ""; + echo "
".elgg_view_listing($icon, $info)."
"; + } else { + $info .= '

'.$title.'

'; + $info .= "

username}\">{$owner->name} {$friendlytime}"; + $info .= "

"; + $icon = "" . elgg_view("videolist/icon", array("mimetype" => $mime, 'thumbnail' => $thumbnail, 'video_guid' => $video_guid, 'size' => 'small')) . ""; + echo "
".elgg_view_listing($icon, $info)."
"; + } +} else { + $videodiv = ''; + $width = "600"; + $height = "400"; + $file = $vars['entity']; + + $videos = get_entity($vars['entity']); + $title = $videos->title; + $url = $videos->url; + $videoid = $videos->video_id; + $tags = $videos->tags; + + $videodiv .= "
"; + + // display any tags for the Video + if (!empty($tags)) { + $videodiv .= "

"; + $videodiv .= elgg_view('output/tags',array('value' => $tags)); + $videodiv .= "

"; + } + + if ($videos->videotype == "youtube") { + $videodiv .= "
"; + } else if($videos->videotype == "metacafe"){ + $videoid_id = $videoid; + $path = explode("/", $videos->thumbnail); + $path = array_reverse($path); + $thumbnailArray = explode(".", $path[0]); + $videoid = $videoid_id."/".$thumbnailArray[0].".swf"; + $videodiv .= "
"; + } else if($videos->videotype == "vimeo") { + $videodiv .= "
"; + } + + $videodiv .= "
"; + $videodiv .= elgg_view_comments($videos); + print $videodiv; +} diff --git a/views/default/object/watch.php b/views/default/object/watch.php deleted file mode 100644 index 5a35bd0ac..000000000 --- a/views/default/object/watch.php +++ /dev/null @@ -1,52 +0,0 @@ - -* @copyright Prateek Choudhary -*/ - -$videodiv = ''; -$width = "600"; -$height = "400"; -$file = $vars['entity']; -if(isset($vars['entity'])) { - $videos = get_entity($vars['entity']); - $title = $videos->title; - $url = $videos->url; - $videoid = $videos->video_id; - $tags = $videos->tags; - - $videodiv .= "
"; - - // view for plugins to extend - $videodiv .= elgg_view('videolist/options', array('entity' => $videos)) . - elgg_view_likes($videos); // include likes - - // display any tags for the Video - if (!empty($tags)) { - $videodiv .= "

"; - $videodiv .= elgg_view('output/tags',array('value' => $tags)); - $videodiv .= "

"; - } - - if ($videos->videotype == "youtube") { - $videodiv .= "
"; - } else if($videos->videotype == "metacafe"){ - $videoid_id = $videoid; - $path = explode("/", $videos->thumbnail); - $path = array_reverse($path); - $thumbnailArray = explode(".", $path[0]); - $videoid = $videoid_id."/".$thumbnailArray[0].".swf"; - $videodiv .= "
"; - } else if($videos->videotype == "vimeo") { - $videodiv .= "
"; - } - - $videodiv .= "
"; - $videodiv .= elgg_view_comments($videos); - print $videodiv; -} \ No newline at end of file -- cgit v1.2.3