aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2010-10-23 15:01:00 +0000
committerCash Costello <cash.costello@gmail.com>2010-10-23 15:01:00 +0000
commitf1f08168b325605a489b5f21cfdfff96312d55f8 (patch)
tree15d8e30d9b645c3fe229cb9a336e7a7708e46070 /views
parentbff17c5857d0365038e6783c3c00b53204f4a10e (diff)
downloadelgg-f1f08168b325605a489b5f21cfdfff96312d55f8.tar.gz
elgg-f1f08168b325605a489b5f21cfdfff96312d55f8.tar.bz2
moved cover code into album class
Diffstat (limited to 'views')
-rw-r--r--views/default/object/album.php12
-rw-r--r--views/default/river/object/album/create.php5
-rw-r--r--views/default/river/object/image/create.php3
-rw-r--r--views/default/tidypics/albums.php5
-rw-r--r--views/default/tidypics/forms/edit.php2
-rw-r--r--views/default/tidypics/forms/edit_multi.php2
-rw-r--r--views/rss/object/album.php6
7 files changed, 17 insertions, 18 deletions
diff --git a/views/default/object/album.php b/views/default/object/album.php
index b87bef444..7c43c4e96 100644
--- a/views/default/object/album.php
+++ b/views/default/object/album.php
@@ -27,9 +27,9 @@ if (get_context() == "search") {
*
*****************************************************************************/
- //get album cover if one was set
- if ($album->cover) {
- $album_cover = '<img src="' . $vars['url'] . 'pg/photos/thumbnail/' . $album->cover . '/small/" class="tidypics_album_cover" alt="' . $title . '"/>';
+ $album_cover_guid = $album->getCoverImageGuid();
+ if ($album_cover_guid) {
+ $album_cover = '<img src="' . $vars['url'] . 'pg/photos/thumbnail/' . $album_cover_guid . '/small/" class="tidypics_album_cover" alt="' . $title . '"/>';
} else {
$album_cover = '<img src="' . $vars['url'] . 'mod/tidypics/graphics/empty_album.png" class="tidypics_album_cover" alt="new album">';
}
@@ -69,9 +69,9 @@ if (get_context() == "search") {
}
$info .= "</p>";
- //get album cover if one was set
- if ($album->cover) {
- $icon = "<a href=\"{$album->getURL()}\">" . '<img src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb" alt="thumbnail" /></a>';
+ $album_cover_guid = $album->getCoverImageGuid();
+ if ($album_cover_guid) {
+ $icon = "<a href=\"{$album->getURL()}\">" . '<img src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $album_cover_guid . '&size=thumb" alt="thumbnail" /></a>';
} else {
$icon = "<a href=\"{$album->getURL()}\">" . '<img src="' . $vars['url'] . 'mod/tidypics/graphics/image_error_thumb.png" alt="new album"></a>';
}
diff --git a/views/default/river/object/album/create.php b/views/default/river/object/album/create.php
index ef50f9988..47d20f3ae 100644
--- a/views/default/river/object/album/create.php
+++ b/views/default/river/object/album/create.php
@@ -20,8 +20,9 @@ if ($group_album) {
$album_river_view = get_plugin_setting('album_river_view', 'tidypics');
if ($album_river_view == "cover") {
- if ($album->cover) {
- $string .= "<div class=\"river_content\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/>' . "</div>";
+ $album_cover_guid = $album->getCoverImageGuid();
+ if ($album_cover_guid) {
+ $string .= "<div class=\"river_content\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $album_cover_guid . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/>' . "</div>";
}
} else {
diff --git a/views/default/river/object/image/create.php b/views/default/river/object/image/create.php
index 188fc6ff1..8a0a8deff 100644
--- a/views/default/river/object/image/create.php
+++ b/views/default/river/object/image/create.php
@@ -18,9 +18,6 @@ $string = sprintf(elgg_echo("image:river:created"), $url, $image_link, $album_li
$string .= "<div class=\"river_content\">";
-/* // this adds the album cover to the river display
- $string .= "<a href=\"" . $album->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> </a>';
-*/
$string .= "<a href=\"" . $image->getURL() . "\"> <img src=\"" . $CONFIG->wwwroot . 'mod/tidypics/thumbnail.php?file_guid=' . $image->guid . '&size=thumb" class="tidypics_album_cover" alt="thumbnail"/> </a>';
$string .= "</div>";
diff --git a/views/default/tidypics/albums.php b/views/default/tidypics/albums.php
index a4b2ee906..7e0cd2d6c 100644
--- a/views/default/tidypics/albums.php
+++ b/views/default/tidypics/albums.php
@@ -14,8 +14,9 @@ echo '<div id="tidypics_album_widget_container">';
if ($owner_albums) {
foreach ($owner_albums as $album) {
- if ($album->cover) {
- $album_cover = '<img src="'.$vars['url'].'mod/tidypics/thumbnail.php?file_guid='.$album->cover.'&size=small" class="tidypics_album_cover" alt="' . $album->title . '"/>';
+ $album_cover_guid = $album->getCoverImageGuid();
+ if ($album_cover_guid) {
+ $album_cover = '<img src="'.$vars['url'].'mod/tidypics/thumbnail.php?file_guid='.$album_cover_guid.'&size=small" class="tidypics_album_cover" alt="' . $album->title . '"/>';
} else {
$album_cover = '<img src="'.$vars['url'].'mod/tidypics/graphics/empty_album.png" class="tidypics_album_cover" alt="' . $album->title . '">';
}
diff --git a/views/default/tidypics/forms/edit.php b/views/default/tidypics/forms/edit.php
index 74d8e85ec..8e2bd9bcc 100644
--- a/views/default/tidypics/forms/edit.php
+++ b/views/default/tidypics/forms/edit.php
@@ -75,7 +75,7 @@ $container_guid = page_owner();
// determine if it is already the cover
$img_guid = $vars['entity']->guid;
$album = get_entity($container_guid);
- $cover_guid = $album->cover;
+ $cover_guid = $album->getCoverImageGuid();
if ($cover_guid != $img_guid) {
diff --git a/views/default/tidypics/forms/edit_multi.php b/views/default/tidypics/forms/edit_multi.php
index c16c8eea9..8c3e40242 100644
--- a/views/default/tidypics/forms/edit_multi.php
+++ b/views/default/tidypics/forms/edit_multi.php
@@ -11,7 +11,7 @@
// make sure one of the images becomes the cover if there isn't one already
$album_entity = get_entity($vars['album_guid']);
- if (!$album_entity->cover) {
+ if (!$album_entity->getCoverImageGuid()) {
$no_cover = true;
}
diff --git a/views/rss/object/album.php b/views/rss/object/album.php
index 34cf58395..8a8f97cc2 100644
--- a/views/rss/object/album.php
+++ b/views/rss/object/album.php
@@ -22,8 +22,8 @@ if (get_context() == "search" && get_input('search_viewtype') == "gallery") {
// use fullsize image
$base_url_fullsize = $vars['url'] . 'pg/photos/download/';
- // insert cover image if it exists image
- if ($album->cover) {
+ $album_cover_guid = $album->getCoverImageGuid();
+ if ($album_cover_guid) {
// Set title
$vars['title'] = $album->title;
if (empty($vars['title'])) {
@@ -33,7 +33,7 @@ if (get_context() == "search" && get_input('search_viewtype') == "gallery") {
} else {
$title = $vars['config']->sitename . ": " . $vars['title'];
}
- $album_cover_url = $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $album->cover . '&amp;size=thumb';
+ $album_cover_url = $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $album_cover_guid . '&amp;size=thumb';
?> <image>
<url><?php echo $album_cover_url; ?></url>
<title><![CDATA[<?php echo $title; ?>]]></title>