diff --git a/core/models/item.php b/core/models/item.php index a684b713..9444f7ac 100644 --- a/core/models/item.php +++ b/core/models/item.php @@ -253,4 +253,30 @@ class Item_Model extends ORM_MPTT { ->where("id <=", $child_id) ->count_all(); } + + /** + * Return an tag for the thumbnail. + * @param array $extra_attrs Extra attributes to add to the img tag + * @return string + */ + public function thumb_tag($extra_attrs) { + return html::image(array("src" => $this->thumb_url(), + "alt" => $this->title, + "width" => $this->thumb_width, + "height" => $this->thumb_height), + $extra_attrs); + } + + /** + * Return an tag for the thumbnail. + * @param array $extra_attrs Extra attributes to add to the img tag + * @return string + */ + public function resize_tag($extra_attrs) { + return html::image(array("src" => $this->resize_url(), + "alt" => $this->title, + "width" => $this->resize_width, + "height" => $this->resize_height), + $extra_attrs); + } } diff --git a/themes/default/views/album.html.php b/themes/default/views/album.html.php index c5415a39..cb3bd430 100644 --- a/themes/default/views/album.html.php +++ b/themes/default/views/album.html.php @@ -14,11 +14,7 @@
  • thumb_top($child) ?> - <?= $child->title ?> + thumb_tag(array("class" => "gThumbnail")) ?> thumb_bottom($child) ?>

    title ?>

    diff --git a/themes/default/views/photo.html.php b/themes/default/views/photo.html.php index a2ae5a8b..aa7053dc 100644 --- a/themes/default/views/photo.html.php +++ b/themes/default/views/photo.html.php @@ -12,11 +12,7 @@ - <?= $item->title ?> + resize_tag(array("id" => "gPhotoId-{$item->id}")) ?>

    title ?>