cash/Tidypics — Issue #5: new viewimage.php elgg 1.8
Author: lianglee
Created: 2011-11-13 03:26:05+00:00
State: open

getContainerEntity();
if ($album) {
elgg_set_page_owner_guid($album->getContainerGUID());
}
$owner = page_owner_entity();

//set the title
$title = elgg_echo('album:user');
// set up breadcrumbs
elgg_push_breadcrumb(elgg_echo('photos'), $CONFIG->wwwroot . "photos/all");
elgg_push_breadcrumb($owner->name, "photos/owner/".$owner->username);
elgg_push_breadcrumb($album->title, $album->getURL());
elgg_push_breadcrumb($photo->title);

// add download button to title menu
elgg_register_menu_item('title', array(
'name' => 'download',
'href' => "photos/download/$photo_guid",
'text' => elgg_echo('image:download'),
'link_class' => 'elgg-button elgg-button-action',
));

$content = elgg_view_entity($photo, true);

$body = elgg_view_layout('content', array(
'filter' => false,
'content' => $content,
'title' => $photo->title,
'sidebar' => elgg_view('tidypics/sidebar', array(
'page' => 'view',
'image' => $photo,
)),
));

echo elgg_view_page($title, $body);