diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-26 16:57:00 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-02-26 16:57:00 +0000 |
commit | 2042a4914be4c7af387808efdcabaa3a7594963d (patch) | |
tree | 5b6424298f02d1dd3e072d9d419acda95d0c027a /modules/exif/helpers | |
parent | f6169047b12346f82aa3214337256b41c595cb8a (diff) |
Implement fix for ticket #103. If there is no exif data, don't
display the "Show more Information Button".
Diffstat (limited to 'modules/exif/helpers')
-rw-r--r-- | modules/exif/helpers/exif_theme.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/modules/exif/helpers/exif_theme.php b/modules/exif/helpers/exif_theme.php index 73ec0200..a99a6319 100644 --- a/modules/exif/helpers/exif_theme.php +++ b/modules/exif/helpers/exif_theme.php @@ -21,11 +21,18 @@ class exif_theme_Core { static function sidebar_bottom($theme) { $item = $theme->item(); if ($item && $item->is_photo()) { - $view = new View("exif_sidebar.html"); + $exif_key = ORM::factory("exif_key") + ->select("COUNT(*) AS C") + ->where("item_id", $item->id) + ->find(); + + if (!empty($exif_key->C)) { + $view = new View("exif_sidebar.html"); - $csrf = access::csrf_token(); - $view->url = url::site("exif/show/{$item->id}?csrf=$csrf"); - return $view; + $csrf = access::csrf_token(); + $view->url = url::site("exif/show/{$item->id}?csrf=$csrf"); + return $view; + } } return null; } |