diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 15:04:14 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-03-15 15:04:14 -0300 |
commit | 4a86fa9b2e63b9d6bb0a07333d4c7d59df621270 (patch) | |
tree | 5770bd548bc70a10dbd5c24aee13c3449bf428a9 /mod/lightbox/pages/lightbox/owner.php | |
parent | d7317abf01cc1f5a6e4ee54f25664e51d23217b9 (diff) | |
parent | 66dd3f3f5f14bb0ba6d2c7ef83b5b612d5ee2e30 (diff) | |
download | elgg-4a86fa9b2e63b9d6bb0a07333d4c7d59df621270.tar.gz elgg-4a86fa9b2e63b9d6bb0a07333d4c7d59df621270.tar.bz2 |
Merge commit '66dd3f3f5f14bb0ba6d2c7ef83b5b612d5ee2e30' as 'mod/lightbox'
Diffstat (limited to 'mod/lightbox/pages/lightbox/owner.php')
-rw-r--r-- | mod/lightbox/pages/lightbox/owner.php | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/mod/lightbox/pages/lightbox/owner.php b/mod/lightbox/pages/lightbox/owner.php new file mode 100644 index 000000000..536790906 --- /dev/null +++ b/mod/lightbox/pages/lightbox/owner.php @@ -0,0 +1,55 @@ +<?php +/** + * Individual's or group's albums + * + * @package ElggLightbox + */ + +// access check for closed groups +group_gatekeeper(); + +$owner = elgg_get_page_owner_entity(); +if (!$owner) { + forward('photos/all'); +} + +elgg_push_breadcrumb(elgg_echo('lightbox'), "photos/all"); +elgg_push_breadcrumb($owner->name); + +elgg_register_title_button(); + +$params = array(); + +if ($owner->guid == elgg_get_logged_in_user_guid()) { + // user looking at own albums + $params['filter_context'] = 'mine'; +} else if (elgg_instanceof($owner, 'user')) { + // someone else's albums + // do not show select a tab when viewing someone else's posts + $params['filter_context'] = 'none'; +} else { + // group albums + $params['filter'] = ''; +} + +$title = elgg_echo("lightbox:user", array($owner->name)); + +// List albums +$content = elgg_list_entities(array( + 'types' => 'object', + 'subtypes' => 'album', + 'container_guid' => $owner->guid, + 'limit' => 10, + 'full_view' => FALSE, +)); +if (!$content) { + $content = elgg_echo("lightbox:none"); +} + +$params['content'] = $content; +$params['title'] = $title; +$params['sidebar'] = elgg_view('lightbox/sidebar'); + +$body = elgg_view_layout('content', $params); + +echo elgg_view_page($title, $body); |