diff --git a/3.0/modules/about_this_photo/helpers/about_this_photo_block.php b/3.0/modules/about_this_photo/helpers/about_this_photo_block.php new file mode 100644 index 00000000..c1adb174 --- /dev/null +++ b/3.0/modules/about_this_photo/helpers/about_this_photo_block.php @@ -0,0 +1,52 @@ + t("About This Photo")); + } + + static function get($block_id, $theme) { + $block = new Block(); + switch ($block_id) { + case "simple": + $block->css_id = "g-about-this-photo"; + $block->title = t("About this photo"); + $block->content = new View("about_this_photo.html"); + + // exif API doesn't give easy access to individual keys, so do this the hard way + if (module::is_active("exif")) { + $exif = ORM::factory("exif_record")->where("item_id", "=", $theme->item()->id)->find(); + if ($exif->loaded()) { + $exif = unserialize($exif->data); + $timestamp = strtotime($exif["DateTime"]); + $block->content->date = gallery::date($timestamp); + $block->content->time = gallery::time($timestamp); + } + } + + if (module::is_active("tag")) { + $block->content->tags = tag::item_tags($theme->item()); + } + break; + } + return $block; + } +} \ No newline at end of file diff --git a/3.0/modules/about_this_photo/module.info b/3.0/modules/about_this_photo/module.info new file mode 100644 index 00000000..6943685e --- /dev/null +++ b/3.0/modules/about_this_photo/module.info @@ -0,0 +1,3 @@ +name = "About this Photo" +description = "Show some simple, specific and useful info about a given photo" +version = 1 diff --git a/3.0/modules/about_this_photo/views/about_this_photo.html.php b/3.0/modules/about_this_photo/views/about_this_photo.html.php new file mode 100644 index 00000000..aa91c578 --- /dev/null +++ b/3.0/modules/about_this_photo/views/about_this_photo.html.php @@ -0,0 +1,17 @@ + + diff --git a/3.1/modules/about_this_photo/helpers/about_this_photo_block.php b/3.1/modules/about_this_photo/helpers/about_this_photo_block.php new file mode 100644 index 00000000..c1adb174 --- /dev/null +++ b/3.1/modules/about_this_photo/helpers/about_this_photo_block.php @@ -0,0 +1,52 @@ + t("About This Photo")); + } + + static function get($block_id, $theme) { + $block = new Block(); + switch ($block_id) { + case "simple": + $block->css_id = "g-about-this-photo"; + $block->title = t("About this photo"); + $block->content = new View("about_this_photo.html"); + + // exif API doesn't give easy access to individual keys, so do this the hard way + if (module::is_active("exif")) { + $exif = ORM::factory("exif_record")->where("item_id", "=", $theme->item()->id)->find(); + if ($exif->loaded()) { + $exif = unserialize($exif->data); + $timestamp = strtotime($exif["DateTime"]); + $block->content->date = gallery::date($timestamp); + $block->content->time = gallery::time($timestamp); + } + } + + if (module::is_active("tag")) { + $block->content->tags = tag::item_tags($theme->item()); + } + break; + } + return $block; + } +} \ No newline at end of file diff --git a/3.1/modules/about_this_photo/module.info b/3.1/modules/about_this_photo/module.info new file mode 100644 index 00000000..6943685e --- /dev/null +++ b/3.1/modules/about_this_photo/module.info @@ -0,0 +1,3 @@ +name = "About this Photo" +description = "Show some simple, specific and useful info about a given photo" +version = 1 diff --git a/3.1/modules/about_this_photo/views/about_this_photo.html.php b/3.1/modules/about_this_photo/views/about_this_photo.html.php new file mode 100644 index 00000000..aa91c578 --- /dev/null +++ b/3.1/modules/about_this_photo/views/about_this_photo.html.php @@ -0,0 +1,17 @@ + +