diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2011-08-30 20:05:00 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2011-08-30 20:05:00 -0700 |
commit | 044309cb50c0301c19c89f15bb280307b338c16c (patch) | |
tree | 0df7cc519c86b33b19158504ac73a02830da3569 | |
parent | 96a4a261a450c8b7117f98cb5f670eb4ebd4b482 (diff) | |
parent | 8970e50c6a2ec709e32210158aa863e8bb1690f3 (diff) |
Merge branch 'master' of git@github.com:gallery/gallery3
-rw-r--r-- | .build_number | 2 | ||||
-rw-r--r-- | modules/gallery/libraries/Theme_View.php | 18 | ||||
-rw-r--r-- | themes/wind/views/page.html.php | 2 |
3 files changed, 13 insertions, 9 deletions
diff --git a/.build_number b/.build_number index 14584f9b..68925020 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=171 +build_number=172 diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index d6834464..13e58004 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -43,9 +43,6 @@ class Theme_View_Core extends Gallery_View { "page_type" => $page_type, "page_subtype" => $page_subtype, "page_title" => null)); - if ($page_type == "collection") { - $this->set_global("thumb_proportion", $this->thumb_proportion()); - } if (module::get_var("gallery", "maintenance_mode", 0)) { if (identity::active_user()->admin) { @@ -59,10 +56,17 @@ class Theme_View_Core extends Gallery_View { * Proportion of the current thumb_size's to default * @return int */ - public function thumb_proportion() { - // @TODO change the 200 to a theme supplied value when and if we come up with an - // API to allow the theme to set defaults. - return module::get_var("gallery", "thumb_size", 200) / 200; + public function thumb_proportion($item) { + // 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()) { + 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 + // API to allow the theme to set defaults. + return module::get_var("gallery", "thumb_size", 200) / 200; + } } public function item() { diff --git a/themes/wind/views/page.html.php b/themes/wind/views/page.html.php index 534b7de4..ca6d2bb1 100644 --- a/themes/wind/views/page.html.php +++ b/themes/wind/views/page.html.php @@ -24,7 +24,7 @@ <link rel="apple-touch-icon-precomposed" href="<?= url::file(module::get_var("gallery", "apple_touch_icon_url")) ?>" /> <? if ($theme->page_type == "collection"): ?> - <? if ($thumb_proportion != 1): ?> + <? if (($thumb_proportion = $theme->thumb_proportion($theme->item())) != 1): ?> <? $new_width = round($thumb_proportion * 213) ?> <? $new_height = round($thumb_proportion * 240) ?> <style type="text/css"> |