summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2011-08-30 20:49:23 -0700
committerBharat Mediratta <bharat@menalto.com>2011-08-30 20:49:23 -0700
commit1ed54ab5dc6e09044d9757eb31f1e0d58e3d9fb1 (patch)
treea15aa939fd8635f5ccc16ea85f7a5929b3da09cf /modules
parent5639ff342195ec80f125f4b09ccc5ae5932c2197 (diff)
Make the Theme_View::thumb_proportion() API call backwards compatible to
the API before dc21cf36b606048dc24532407d39bc8f5b4211fa. Fixes #1775
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/libraries/Theme_View.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php
index 13e58004..389eace6 100644
--- a/modules/gallery/libraries/Theme_View.php
+++ b/modules/gallery/libraries/Theme_View.php
@@ -54,13 +54,14 @@ class Theme_View_Core extends Gallery_View {
/**
* Proportion of the current thumb_size's to default
+ * @param object Item_Model (optional) check the proportions for this item
* @return int
*/
- public function thumb_proportion($item) {
+ public function thumb_proportion($item=null) {
// By default we have a globally fixed thumbnail size In core code, we just return a fixed
// proportion based on the global thumbnail size, but since modules can override that, we
// return the actual proportions when we have them.
- if ($item->has_thumb()) {
+ if ($item && $item->has_thumb()) {
return max($item->thumb_width, $item->thumb_height) / 200;
} else {
// @TODO change the 200 to a theme supplied value when and if we come up with an