diff options
author | Chad Kieffer <ckieffer@gmail.com> | 2009-06-02 22:55:23 -0600 |
---|---|---|
committer | Chad Kieffer <ckieffer@gmail.com> | 2009-06-02 22:55:23 -0600 |
commit | 1df6db45dc569cc6f18a9d1622fce5ebe62f8d30 (patch) | |
tree | e4e8cac619bc2443c3e26d0f87a25c51f8a3b273 /modules/gallery/models | |
parent | 2bd8051c28621f6c25a3f85b73da2f94d62440f2 (diff) | |
parent | dde5fb96ee9db5a67b286ea4ac4f35190453a6ef (diff) |
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/models')
-rw-r--r-- | modules/gallery/models/item.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 4b8cac8e..10bad0b2 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -287,6 +287,10 @@ class Item_Model extends ORM_MPTT { * @return string */ public function relative_path() { + if (!$this->loaded) { + return; + } + if (!isset($this->relative_path_cache)) { $paths = array(); foreach (Database::instance() @@ -391,7 +395,7 @@ class Item_Model extends ORM_MPTT { * @param boolean (optional) $center_vertically Center vertically (default: false) * @return string */ - public function thumb_tag($extra_attrs=array(), $max=null, $center_vertically=false) { + public function thumb_img($extra_attrs=array(), $max=null, $center_vertically=false) { list ($height, $width) = $this->scale_dimensions($max); if ($center_vertically && $max) { // The constant is divide by 2 to calculate the file and 10 to convert to em @@ -444,7 +448,7 @@ class Item_Model extends ORM_MPTT { * @param array $extra_attrs Extra attributes to add to the img tag * @return string */ - public function resize_tag($extra_attrs) { + public function resize_img($extra_attrs) { $attrs = array_merge($extra_attrs, array("src" => $this->resize_url(), "alt" => $this->title, @@ -460,7 +464,7 @@ class Item_Model extends ORM_MPTT { * @param array $extra_attrs * @return string */ - public function movie_tag($extra_attrs) { + public function movie_img($extra_attrs) { $attrs = array_merge($extra_attrs, array("id" => "player", "style" => "display:block;width:400px;height:300px") |