From 2d7ab6f4dac14a3bbf6718edfaf999e6ad58cf98 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 14 Jan 2009 07:21:35 +0000 Subject: Create Item_Model::thumb_tag() and Item_Model::resize_tag() to provide an abstraction for when we add movie support. --- core/models/item.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'core') 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); + } } -- cgit v1.2.3