diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/default/object/album.php | 6 | ||||
-rw-r--r-- | views/default/object/album/gallery.php (renamed from views/default/object/album/summary.php) | 0 | ||||
-rw-r--r-- | views/default/object/album/list.php | 52 | ||||
-rw-r--r-- | views/default/photos/group_module.php | 45 |
4 files changed, 102 insertions, 1 deletions
diff --git a/views/default/object/album.php b/views/default/object/album.php index 51b25b7da..bfcfd96d2 100644 --- a/views/default/object/album.php +++ b/views/default/object/album.php @@ -14,5 +14,9 @@ $full_view = elgg_extract('full_view', $vars, false); if ($full_view) { echo elgg_view('object/album/full', $vars); } else { - echo elgg_view('object/album/summary', $vars); + if (elgg_in_context('widgets')) { + echo elgg_view('object/album/list', $vars); + } else { + echo elgg_view('object/album/gallery', $vars); + } } diff --git a/views/default/object/album/summary.php b/views/default/object/album/gallery.php index 78eec3517..78eec3517 100644 --- a/views/default/object/album/summary.php +++ b/views/default/object/album/gallery.php diff --git a/views/default/object/album/list.php b/views/default/object/album/list.php new file mode 100644 index 000000000..ccbd01cd1 --- /dev/null +++ b/views/default/object/album/list.php @@ -0,0 +1,52 @@ +<?php +/** + * Display an album as an item in a list + * + * @uses $vars['entity'] TidypicsAlbum + * + * @author Cash Costello + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 + */ + +$album = elgg_extract('entity', $vars); +$owner = $album->getOwnerEntity(); + +$owner_link = elgg_view('output/url', array( + 'href' => "photos/owner/$owner->username", + 'text' => $owner->name, + 'is_trusted' => true, +)); +$author_text = elgg_echo('byline', array($owner_link)); +$date = elgg_view_friendly_time($album->time_created); +$categories = elgg_view('output/categories', $vars); + +$subtitle = "$author_text $date $categories"; + +$title = elgg_view('output/url', array( + 'text' => $album->getTitle(), + 'href' => $album->getURL(), +)); + +$params = array( + 'entity' => $album, + 'title' => $title, + 'metadata' => null, + 'subtitle' => $subtitle, + 'tags' => elgg_view('output/tags', array('tags' => $album->tags)), +); +$params = $params + $vars; +$summary = elgg_view('object/elements/summary', $params); + +$cover = elgg_view('output/img', array( + 'src' => $album->getCoverImageURL('thumb'), + 'alt' => $album->getTitle(), + 'class' => 'elgg-photo', +)); +$icon = elgg_view('output/url', array( + 'text' => $cover, + 'href' => $album->getURL(), + 'encode_text' => false, + 'is_trusted' => true, +)); + +echo $header = elgg_view_image_block($icon, $summary); diff --git a/views/default/photos/group_module.php b/views/default/photos/group_module.php new file mode 100644 index 000000000..aa0e7b3ff --- /dev/null +++ b/views/default/photos/group_module.php @@ -0,0 +1,45 @@ +<?php +/** + * Group blog module + */ + +$group = elgg_get_page_owner_entity(); + +if ($group->photos_enable == "no") { + return true; +} + +$all_link = elgg_view('output/url', array( + 'href' => "photos/group/$group->guid/all", + 'text' => elgg_echo('link:view:all'), + 'is_trusted' => true, +)); + +elgg_push_context('widgets'); +$options = array( + 'type' => 'object', + 'subtype' => 'album', + 'container_guid' => elgg_get_page_owner_guid(), + 'limit' => 6, + 'full_view' => false, + 'pagination' => false, +); +$content = elgg_list_entities($options); +elgg_pop_context(); + +if (!$content) { + $content = '<p>' . elgg_echo('tidypics:none') . '</p>'; +} + +$new_link = elgg_view('output/url', array( + 'href' => "photos/add/$group->guid", + 'text' => elgg_echo('photos:add'), + 'is_trusted' => true, +)); + +echo elgg_view('groups/profile/module', array( + 'title' => elgg_echo('photos:group'), + 'content' => $content, + 'all_link' => $all_link, + 'add_link' => $new_link, +)); |