From 5d26276359a4448f0aebc66c3a87b332338e7027 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 3 Dec 2011 16:46:50 -0500 Subject: better image display code - using elgg_view_entity_icon() now --- views/default/object/album/gallery.php | 15 +++------------ views/default/object/album/list.php | 12 +----------- views/default/object/image/full.php | 16 +++++----------- views/default/object/image/summary.php | 6 +----- 4 files changed, 10 insertions(+), 39 deletions(-) (limited to 'views/default/object') diff --git a/views/default/object/album/gallery.php b/views/default/object/album/gallery.php index ee22f0436..53194b53c 100644 --- a/views/default/object/album/gallery.php +++ b/views/default/object/album/gallery.php @@ -10,22 +10,13 @@ $album = elgg_extract('entity', $vars); -$album_cover = elgg_view('output/img', array( - 'src' => $album->getCoverImageURL(), - 'alt' => $album->getTitle(), - 'class' => 'elgg-photo', -)); +$album_cover = elgg_view_entity_icon($album, 'small'); $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, + 'class' => 'tidypics-heading', )); $footer = elgg_view('output/url', array( @@ -38,4 +29,4 @@ $footer .= '
' . elgg_echo('album:num', array($album->g $params = array( 'footer' => $footer, ); -echo elgg_view_module('tidypics-album', $header, $body, $params); +echo elgg_view_module('tidypics-album', $header, $album_cover, $params); diff --git a/views/default/object/album/list.php b/views/default/object/album/list.php index ccbd01cd1..e576c92f1 100644 --- a/views/default/object/album/list.php +++ b/views/default/object/album/list.php @@ -37,16 +37,6 @@ $params = array( $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, -)); +$icon = elgg_view_entity_icon($album, 'tiny'); echo $header = elgg_view_image_block($icon, $summary); diff --git a/views/default/object/image/full.php b/views/default/object/image/full.php index d08c03f9c..f866e432d 100644 --- a/views/default/object/image/full.php +++ b/views/default/object/image/full.php @@ -10,15 +10,9 @@ $image = $photo = $vars['entity']; -$img = elgg_view('output/img', array( - 'src' => $image->getSrcURL('large'), - 'alt' => $image->getTitle(), - 'class' => 'elgg-photo', -)); - -$content = elgg_view('output/url', array( - 'text' => $img, - 'href' => $image->getURL(), +$img = elgg_view_entity_icon($image, 'large', array( + 'href' => false, + 'img_class' => 'tidypics-photo', )); $owner_link = elgg_view('output/url', array( @@ -62,7 +56,7 @@ if ($photo->description) { echo '
'; echo elgg_view('tidypics/tagging/help'); echo elgg_view('tidypics/tagging/select', array('photo' => $photo)); -echo $content; +echo $img; echo '
'; - echo elgg_view_comments($photo); \ No newline at end of file +echo elgg_view_comments($photo); diff --git a/views/default/object/image/summary.php b/views/default/object/image/summary.php index 71c1be6b9..16c197098 100644 --- a/views/default/object/image/summary.php +++ b/views/default/object/image/summary.php @@ -10,11 +10,7 @@ $image = elgg_extract('entity', $vars); -$img = elgg_view('output/img', array( - 'src' => $image->getSrcURL(), - 'alt' => $image->getTitle(), - 'class' => 'elgg-photo', -)); +$img = elgg_view_entity_icon($image, 'small'); $header = elgg_view('output/url', array( 'text' => $image->getTitle(), -- cgit v1.2.3