diff options
author | Pete Harris <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-30 14:23:05 +0000 |
---|---|---|
committer | Pete Harris <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-30 14:23:05 +0000 |
commit | 05129a184b2c88cf082ebf230a3dce7b6510ec8f (patch) | |
tree | 744402f97eba2cb76978224eb48c75850604d58f /watch.php | |
parent | 4fa7aaa7e363514dc2def25cceafd8cf4333404c (diff) | |
download | elgg-05129a184b2c88cf082ebf230a3dce7b6510ec8f.tar.gz elgg-05129a184b2c88cf082ebf230a3dce7b6510ec8f.tar.bz2 |
Further updates to VideoList UI. Search results styled to match new elgg list style. Videos from search now play in popup modal with screen greyed out. Individual video page now has edit and delete, breadcrumbs, latest comments etc..
Diffstat (limited to 'watch.php')
-rw-r--r-- | watch.php | 45 |
1 files changed, 36 insertions, 9 deletions
@@ -1,5 +1,4 @@ <?php - /** * Elgg Video Plugin * This plugin allows users to create a library of youtube/vimeo/metacafe videos @@ -9,11 +8,24 @@ * @author Prateek Choudhary <synapticfield@gmail.com> * @copyright Prateek Choudhary */ +global $CONFIG; require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); // Get objects $video_id = (int) get_input('video_id'); +$video = get_entity($video_id); + +// set up breadcrumbs +$page_owner = page_owner_entity(); +if ($page_owner === false || is_null($page_owner)) { + $page_owner = $_SESSION['user']; + set_page_owner($page_owner->getGUID()); +} +elgg_push_breadcrumb(elgg_echo('videolist:all'), $CONFIG->wwwroot."mod/videolist/all.php"); +elgg_push_breadcrumb(sprintf(elgg_echo("videolist:user"),$page_owner->name), $CONFIG->wwwroot."pg/videolist/".$page_owner->username); +elgg_push_breadcrumb(sprintf($video->title)); +$area1 = elgg_view('navigation/breadcrumbs'); // If we can get out the video corresponding to video_id object ... if ($videos = get_entity($video_id)) { @@ -24,19 +36,34 @@ if ($videos = get_entity($video_id)) { set_context("groupsvideos"); } $page_owner = page_owner_entity(); - $title = sprintf(elgg_echo("videolist:home"),page_owner_entity()->name); + $pagetitle = sprintf(elgg_echo("videolist:home"),page_owner_entity()->name); + $title = $videos->title; + + $area1 .= "<div id='content_header' class='clearfloat'><div class='content_header_title'><h2>".$title."</h2></div>"; + if ($videos->canEdit()) { + $area1 .= "<div class='content_header_options'> + <a class='action_button' href=\"{$CONFIG->wwwroot}mod/videolist/edit.php?file_guid={$videos->getGUID()}\">".elgg_echo('edit')."</a>"; + + $area1 .= elgg_view('output/confirmlink',array( + 'href' => $CONFIG->wwwroot . "action/videolist/delete?file=" . $videos->getGUID(), + 'text' => elgg_echo('delete'), + 'confirm' => elgg_echo('document:delete:confirm'), + 'class' => 'action_button disabled'))."</div>"; + } + $area1 .= "</div>"; + // Display it - $area2 = elgg_view("object/watch",array( - 'entity' => $video_id, - 'entity_owner' => $page_owner, - 'full' => true - )); + $area2 .= elgg_view("object/watch",array( + 'entity' => $video_id, + 'entity_owner' => $page_owner, + 'full' => true + )); $body = elgg_view_layout("one_column_with_sidebar", $area1.$area2, $area3); } else { // video not found $body = "<p class='margin_top'>".elgg_echo('videolist:none:found')."</p>"; - $title = elgg_echo("video:none"); + $pagetitle = elgg_echo("video:none"); } // Finally draw the page -page_draw($title, $body); +page_draw($pagetitle, $body); |