From 47bd8586910b1df3f29e2425572372e382b26f6a Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Wed, 23 Nov 2011 18:46:41 -0500 Subject: added support for group albums --- views/default/object/album.php | 6 +++- views/default/object/album/gallery.php | 41 +++++++++++++++++++++++++++ views/default/object/album/list.php | 52 ++++++++++++++++++++++++++++++++++ views/default/object/album/summary.php | 41 --------------------------- 4 files changed, 98 insertions(+), 42 deletions(-) create mode 100644 views/default/object/album/gallery.php create mode 100644 views/default/object/album/list.php delete mode 100644 views/default/object/album/summary.php (limited to 'views/default/object') 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/gallery.php b/views/default/object/album/gallery.php new file mode 100644 index 000000000..78eec3517 --- /dev/null +++ b/views/default/object/album/gallery.php @@ -0,0 +1,41 @@ + $album->getCoverImageURL(), + 'alt' => $album->getTitle(), + 'class' => 'elgg-photo', +)); + +$header = elgg_view('output/url', array( + 'text' => $album->getTitle(), + 'href' => $album->getURL(), +)); + +$body = elgg_view('output/url', array( + 'text' => $album_cover, + 'href' => $album->getURL(), + 'encode_text' => false, + 'is_trusted' => true, +)); + +$footer = elgg_view('output/url', array( + 'text' => $album->getContainerEntity()->name, + 'href' => $album->getContainerEntity()->getURL(), + 'is_trusted' => true, +)); +$footer .= '
' . elgg_echo('album:num', array($album->getSize())) . '
'; + +$params = array( + 'footer' => $footer, +); +echo elgg_view_module('tidypics-album', $header, $body, $params); 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 @@ +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/object/album/summary.php b/views/default/object/album/summary.php deleted file mode 100644 index 78eec3517..000000000 --- a/views/default/object/album/summary.php +++ /dev/null @@ -1,41 +0,0 @@ - $album->getCoverImageURL(), - 'alt' => $album->getTitle(), - 'class' => 'elgg-photo', -)); - -$header = elgg_view('output/url', array( - 'text' => $album->getTitle(), - 'href' => $album->getURL(), -)); - -$body = elgg_view('output/url', array( - 'text' => $album_cover, - 'href' => $album->getURL(), - 'encode_text' => false, - 'is_trusted' => true, -)); - -$footer = elgg_view('output/url', array( - 'text' => $album->getContainerEntity()->name, - 'href' => $album->getContainerEntity()->getURL(), - 'is_trusted' => true, -)); -$footer .= '
' . elgg_echo('album:num', array($album->getSize())) . '
'; - -$params = array( - 'footer' => $footer, -); -echo elgg_view_module('tidypics-album', $header, $body, $params); -- cgit v1.2.3