From 78e11786257411c9b823d5c6ac0f4a1ae411a6fd Mon Sep 17 00:00:00 2001 From: Sem Date: Tue, 8 Nov 2011 23:36:51 +0100 Subject: Changes on pagesetup and watch page. --- pages/videolist/watch.php | 91 +++++++++++++---------------------------------- 1 file changed, 24 insertions(+), 67 deletions(-) (limited to 'pages') diff --git a/pages/videolist/watch.php b/pages/videolist/watch.php index 4c92cc63b..fc9bd1a68 100644 --- a/pages/videolist/watch.php +++ b/pages/videolist/watch.php @@ -1,79 +1,36 @@ - * @copyright Prateek Choudhary + * @package ElggFile */ -require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); +$videolist_item = get_entity(get_input('guid')); -// Get objects -$video_id = (int) get_input('video_id'); -$video = get_entity($video_id); +elgg_set_page_owner_guid($videolist_item->container_guid); -// If we can get out the video corresponding to video_id object ... -if ($videos = get_entity($video_id)) { - set_page_owner($videos->container_guid); - $videos_container = get_entity($videos->container_guid); - // 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'), elgg_get_site_url()."videolist/all.php"); - elgg_push_breadcrumb(sprintf(elgg_echo("videolist:user"),$page_owner->name), elgg_get_site_url()."videolist/".$page_owner->username); - elgg_push_breadcrumb(sprintf($video->title)); - $area1 = elgg_view('navigation/breadcrumbs'); +$page_owner = elgg_get_page_owner_entity(); - if($videos_container->type == "group") { - set_context("groupsvideos"); - } - $page_owner = page_owner_entity(); - $pagetitle = sprintf(elgg_echo("videolist:home"),page_owner_entity()->name); - $title = $videos->title; - - $area1 .= "

".$title."

"; - if ($videos->canEdit()) { - $area1 .= "
- getGUID()}\">".elgg_echo('edit').""; +elgg_push_breadcrumb(elgg_echo('videolist'), 'videolist/all'); - $area1 .= elgg_view('output/confirmlink',array( - 'href' => elgg_get_site_url() . "action/videolist/delete?video=" . $videos->getGUID(), - 'text' => elgg_echo('delete'), - 'is_action' => true, - 'confirm' => elgg_echo('document:delete:confirm'), - 'class' => 'action_button disabled'))."
"; - } - $area1 .= "
"; - - // Display it - $area2 .= elgg_view("object/watch",array( - 'entity' => $video_id, - 'entity_owner' => $page_owner, - 'full' => true - )); - - // include a view for plugins to extend - $area3 .= elgg_view("videolist/sidebar", array("object_type" => 'videolist')); - - // get the latest comments on all videos - $comments = get_annotations(0, "object", "videolist", "generic_comment", "", 0, 4, 0, "desc"); - $area3 .= elgg_view('annotation/latest_comments', array('comments' => $comments)); - - // tag-cloud display - $area3 .= display_tagcloud(0, 50, 'tags', 'object', 'videolist'); - - $body = elgg_view_layout("one_column_with_sidebar", $area1.$area2, $area3); +$crumbs_title = $page_owner->name; +if (elgg_instanceof($page_owner, 'group')) { + elgg_push_breadcrumb($crumbs_title, "videolist/group/$page_owner->guid/all"); } else { - // video not found - $body = "

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

"; - $pagetitle = elgg_echo("video:none"); + elgg_push_breadcrumb($crumbs_title, "videolist/owner/$page_owner->username"); } -// Finally draw the page -page_draw($pagetitle, $body); +$title = $videolist_item->title; + +elgg_push_breadcrumb($title); + +$content = elgg_view_entity($videolist_item, array('full_view' => true)); +$content .= elgg_view_comments($videolist_item); + +$body = elgg_view_layout('content', array( + 'content' => $content, + 'title' => $title, + 'filter' => '', +)); + +echo elgg_view_page($title, $body); -- cgit v1.2.3