From 64193b1a3f8c3e816e69d1a37d697661eb6b1d24 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Wed, 24 Mar 2010 21:05:19 -0400 Subject: [PATCH] Added option to map the entire contents of an album on the sidebar. --- modules/exif_gps/helpers/exif_gps_block.php | 19 ++++++++ .../views/exif_gps_dynamic2_sidebar.html.php | 43 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 modules/exif_gps/views/exif_gps_dynamic2_sidebar.html.php diff --git a/modules/exif_gps/helpers/exif_gps_block.php b/modules/exif_gps/helpers/exif_gps_block.php index ff332323..9498adcb 100644 --- a/modules/exif_gps/helpers/exif_gps_block.php +++ b/modules/exif_gps/helpers/exif_gps_block.php @@ -124,6 +124,25 @@ class exif_gps_block_Core { } $block->content->latitude = $latitude; $block->content->longitude = $longitude; + } elseif ($theme->item->is_album() && (module::get_var("exif_gps", "sidebar_mapformat") == 1)) { + // If coordinates were NOT found, and this is an album with a dynamic map, then map the contents of the album. + $items = ORM::factory("item", $theme->item->id) + ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") + ->viewable() + ->order_by("exif_coordinates.latitude", "ASC") + ->descendants(); + if (count($items) > 0) { + $block = new Block(); + $block->css_id = "g-exif-gps-location"; + $block->title = t("Location"); + $block->content = new View("exif_gps_dynamic2_sidebar.html"); + if (module::get_var("exif_gps", "sidebar_maptype") == 0) $block->content->sidebar_map_type = "ROADMAP"; + if (module::get_var("exif_gps", "sidebar_maptype") == 1) $block->content->sidebar_map_type = "SATELLITE"; + if (module::get_var("exif_gps", "sidebar_maptype") == 2) $block->content->sidebar_map_type = "HYBRID"; + if (module::get_var("exif_gps", "sidebar_maptype") == 3) $block->content->sidebar_map_type = "TERRAIN"; + $block->content->items = $items; + $block->content->google_map_key = module::get_var("exif_gps", "googlemap_api_key"); + } } break; } diff --git a/modules/exif_gps/views/exif_gps_dynamic2_sidebar.html.php b/modules/exif_gps/views/exif_gps_dynamic2_sidebar.html.php new file mode 100644 index 00000000..16758827 --- /dev/null +++ b/modules/exif_gps/views/exif_gps_dynamic2_sidebar.html.php @@ -0,0 +1,43 @@ + + + + +