diff options
author | cash <cash.costello@gmail.com> | 2011-12-03 16:46:50 -0500 |
---|---|---|
committer | cash <cash.costello@gmail.com> | 2011-12-03 16:46:50 -0500 |
commit | 5d26276359a4448f0aebc66c3a87b332338e7027 (patch) | |
tree | cd269deb21c9ee0211e6b7d080f9566fd2d5ecb4 /views/default/icon/object/album.php | |
parent | 092197523f135b1aec3de8ff50df0dcf724c8094 (diff) | |
download | elgg-5d26276359a4448f0aebc66c3a87b332338e7027.tar.gz elgg-5d26276359a4448f0aebc66c3a87b332338e7027.tar.bz2 |
better image display code - using elgg_view_entity_icon() now
Diffstat (limited to 'views/default/icon/object/album.php')
-rw-r--r-- | views/default/icon/object/album.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/views/default/icon/object/album.php b/views/default/icon/object/album.php new file mode 100644 index 000000000..656b2e0df --- /dev/null +++ b/views/default/icon/object/album.php @@ -0,0 +1,40 @@ +<?php +/** + * Image icon view + * + * @uses $vars['entity'] The entity the icon represents - uses getIconURL() method + * @uses $vars['size'] tiny, small (default), large, master + * @uses $vars['href'] Optional override for link + * @uses $vars['img_class'] Optional CSS class added to img + * @uses $vars['link_class'] Optional CSS class added to link + * + * @author Cash Costello + * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 + */ + +$album = $vars['entity']; + +$cover_guid = $album->getCoverImageGuid(); +if ($cover_guid) { + $vars['title'] = $album->getTitle(); + echo elgg_view_entity_icon(get_entity($cover_guid), $vars['size'], $vars); +} else { + $url = "mod/tidypics/graphics/empty_album.png"; + $url = elgg_normalize_url($url); + $img = elgg_view('output/img', array( + 'src' => $url, + 'class' => 'elgg-photo', + 'title' => $album->getTitle(), + 'alt' => $album->getTitle(), + )); + + $params = array( + 'href' => $url, + 'text' => $img, + 'is_trusted' => true, + ); + if (isset($vars['link_class'])) { + $params['class'] = $vars['link_class']; + } + echo elgg_view('output/url', $params); +} |