From 632285ee0c7d9b8aa89c1197739b5a521f9c5e9c Mon Sep 17 00:00:00 2001 From: jamaa Date: Mon, 20 May 2013 22:19:34 +0200 Subject: 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 --- modules/info/helpers/info_block.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'modules/info/helpers/info_block.php') 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); -- cgit v1.2.3 From 8b14cc5a78ca7cd86ead250916f3437af7bf77af Mon Sep 17 00:00:00 2001 From: jamaa Date: Tue, 11 Jun 2013 23:10:47 +0200 Subject: internationalize image size display as per comment https://github.com/gallery/gallery3/pull/394/files#r4643737 --- modules/info/helpers/info_block.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/info/helpers/info_block.php') diff --git a/modules/info/helpers/info_block.php b/modules/info/helpers/info_block.php index f4fe5a6e..f3c8cf65 100644 --- a/modules/info/helpers/info_block.php +++ b/modules/info/helpers/info_block.php @@ -75,7 +75,7 @@ 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 + "value" => t("%width x %height", array("width" => $theme->item->width, "height" => $theme->item->height)) ); } -- cgit v1.2.3 From 2d2503680ec3cd90d07a871a71a8e6d2f21c6c3d Mon Sep 17 00:00:00 2001 From: jamaa Date: Thu, 13 Jun 2013 00:00:13 +0200 Subject: change "size" to "dimensions" and display unit "px" --- modules/info/helpers/info_block.php | 6 +++--- modules/info/helpers/info_installer.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'modules/info/helpers/info_block.php') diff --git a/modules/info/helpers/info_block.php b/modules/info/helpers/info_block.php index f3c8cf65..238b18b5 100644 --- a/modules/info/helpers/info_block.php +++ b/modules/info/helpers/info_block.php @@ -72,10 +72,10 @@ class info_block_Core { ); } } - if (($theme->item->width && $theme->item->height) && module::get_var("info", "show_size")) { + if (($theme->item->width && $theme->item->height) && module::get_var("info", "show_dimensions")) { $info["size"] = array( - "label" => t("Size:"), - "value" => t("%width x %height", array("width" => $theme->item->width, "height" => $theme->item->height)) + "label" => t("Dimensions:"), + "value" => t("%width x %height px", array("width" => $theme->item->width, "height" => $theme->item->height)) ); } diff --git a/modules/info/helpers/info_installer.php b/modules/info/helpers/info_installer.php index 2d13eec5..2d06a0ef 100644 --- a/modules/info/helpers/info_installer.php +++ b/modules/info/helpers/info_installer.php @@ -25,7 +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); + module::set_var("info", "show_dimensions", 1); } static function upgrade($version) { @@ -38,7 +38,7 @@ class info_installer { module::set_version("info", $version = 2); } if ($version == 2) { - module::set_var("info", "show_size", 1); + module::set_var("info", "show_dimensions", 1); module::set_version("info", $version = 3); } } -- cgit v1.2.3