diff options
author | jamaa <jamaa@mzibo.net> | 2013-05-20 22:19:34 +0200 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2013-06-12 19:10:01 -0400 |
commit | 632285ee0c7d9b8aa89c1197739b5a521f9c5e9c (patch) | |
tree | 9d7c3766eb98b1d8f84c080850e88c4cca4affa9 /modules/info/helpers | |
parent | 47803a2d46df8f567639ba7f6d2afb63655afc19 (diff) |
add the image size (in pixels) to the info module
adds a new variable "show_size", so had to increment the version number
to 3
Diffstat (limited to 'modules/info/helpers')
-rw-r--r-- | modules/info/helpers/info_block.php | 7 | ||||
-rw-r--r-- | modules/info/helpers/info_installer.php | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/modules/info/helpers/info_block.php b/modules/info/helpers/info_block.php index 62aa0746..f4fe5a6e 100644 --- a/modules/info/helpers/info_block.php +++ b/modules/info/helpers/info_block.php @@ -72,6 +72,13 @@ class info_block_Core { ); } } + if (($theme->item->width && $theme->item->height) && module::get_var("info", "show_size")) { + $info["size"] = array( + "label" => t("Size:"), + "value" => $theme->item->width . " x " . $theme->item->height + ); + } + $block->content->metadata = $info; module::event("info_block_get_metadata", $block, $theme->item); diff --git a/modules/info/helpers/info_installer.php b/modules/info/helpers/info_installer.php index 43c216dc..5a79c1cc 100644 --- a/modules/info/helpers/info_installer.php +++ b/modules/info/helpers/info_installer.php @@ -25,6 +25,7 @@ class info_installer { module::set_var("info", "show_owner", 1); module::set_var("info", "show_name", 1); module::set_var("info", "show_captured", 1); + module::set_var("info", "show_size", 1); } static function upgrade($version) { @@ -36,5 +37,9 @@ class info_installer { module::set_var("info", "show_captured", 1); module::set_version("info", $version = 2); } + else if ($version == 2) { + module::set_var("info", "show_size", 1); + module::set_version("info", $version = 3); + } } } |