From 560f2ecf5f632228a3aeba0338f327ffd4dfe8fe Mon Sep 17 00:00:00 2001 From: rWatcher Date: Wed, 14 Oct 2009 16:43:19 -0400 Subject: [PATCH] Merged in some code from the 3nids version of TagsMap and the bugfix from glip. --- modules/tagsmap/controllers/admin_tagsmap.php | 4 +- modules/tagsmap/controllers/tagsmap.php | 3 +- modules/tagsmap/helpers/tagsmap_event.php | 24 +++++++++ modules/tagsmap/helpers/tagsmap_installer.php | 1 + modules/tagsmap/helpers/tagsmap_theme.php | 17 +----- modules/tagsmap/module.info | 4 +- .../views/admin_tagsmap_delete.html.php | 2 +- .../tagsmap/views/admin_tagsmap_edit.html.php | 54 ++++++++++++++++++- modules/tagsmap/views/tagsmap_block.html.php | 7 --- .../tagsmap/views/tagsmap_googlemap.html.php | 3 +- 10 files changed, 89 insertions(+), 30 deletions(-) delete mode 100644 modules/tagsmap/views/tagsmap_block.html.php diff --git a/modules/tagsmap/controllers/admin_tagsmap.php b/modules/tagsmap/controllers/admin_tagsmap.php index a2316615..5e07c68c 100644 --- a/modules/tagsmap/controllers/admin_tagsmap.php +++ b/modules/tagsmap/controllers/admin_tagsmap.php @@ -111,7 +111,7 @@ class Admin_TagsMap_Controller extends Admin_Controller { private function _get_tagsgpsedit_form($tag_id) { // Make a new form for editing GPS data associated with a tag ($tag_id). $form = new Forge("admin/tagsmap/savegps", "", "post", - array("id" => "g-tags-mapAdminForm")); + array("id" => "g-tags-map-admin-form")); // Add a few input boxes for GPS and Description $tagsgps_group = $form->group("TagsMapGPS"); @@ -181,7 +181,7 @@ class Admin_TagsMap_Controller extends Admin_Controller { private function _get_googlemaps_form() { // Make a new form for inputing information associated with google maps. $form = new Forge("admin/tagsmap/savemapprefs", "", "post", - array("id" => "g-tags-mapAdminForm")); + array("id" => "g-tags-map-admin-form")); // Input box for the Maps API Key $googlemap_group = $form->group("GoogleMapsKey"); diff --git a/modules/tagsmap/controllers/tagsmap.php b/modules/tagsmap/controllers/tagsmap.php index 9e95a872..6150f62b 100644 --- a/modules/tagsmap/controllers/tagsmap.php +++ b/modules/tagsmap/controllers/tagsmap.php @@ -41,7 +41,8 @@ class TagsMap_Controller extends Controller { print $view; } else { - $template = new Theme_View("page.html", "Contact"); + $template = new Theme_View("page.html", "TagsMap"); + $template->page_title = t("Gallery :: Map"); $template->content = new View("tagsmap_googlemap.html"); // Load in module preferences. diff --git a/modules/tagsmap/helpers/tagsmap_event.php b/modules/tagsmap/helpers/tagsmap_event.php index 27b47ca6..c76e0dd0 100644 --- a/modules/tagsmap/helpers/tagsmap_event.php +++ b/modules/tagsmap/helpers/tagsmap_event.php @@ -40,4 +40,28 @@ class tagsmap_event_Core { ->label(t("TagsMap Settings")) ->url(url::site("admin/tagsmap"))); } + + static function photo_menu($menu, $theme) { + $menu->append(Menu::factory("link") + ->id("tagsmap") + ->label(t("View Map")) + ->url(url::site("tagsmap/googlemap/")) + ->css_id("g-tagsmap-link")); + } + + static function movie_menu($menu, $theme) { + $menu->append(Menu::factory("link") + ->id("tagsmap") + ->label(t("View Map")) + ->url(url::site("tagsmap/googlemap/")) + ->css_id("g-tagsmap-link")); + } + + static function album_menu($menu, $theme) { + $menu->append(Menu::factory("link") + ->id("tagsmap") + ->label(t("View Map")) + ->url(url::site("tagsmap/googlemap/")) + ->css_id("g-tagsmap-link")); + } } \ No newline at end of file diff --git a/modules/tagsmap/helpers/tagsmap_installer.php b/modules/tagsmap/helpers/tagsmap_installer.php index 3a4598ae..a956ef24 100644 --- a/modules/tagsmap/helpers/tagsmap_installer.php +++ b/modules/tagsmap/helpers/tagsmap_installer.php @@ -43,5 +43,6 @@ class tagsmap_installer { // Delete the GPS table before uninstalling. $db = Database::instance(); $db->query("DROP TABLE IF EXISTS {tags_gpses};"); + module::delete("tagsmap"); } } diff --git a/modules/tagsmap/helpers/tagsmap_theme.php b/modules/tagsmap/helpers/tagsmap_theme.php index 7c2515ed..8401fd4d 100644 --- a/modules/tagsmap/helpers/tagsmap_theme.php +++ b/modules/tagsmap/helpers/tagsmap_theme.php @@ -19,20 +19,7 @@ */ class tagsmap_theme_Core { - static function sidebar_blocks($theme) { - // Display a link to the map in the Gallery sidebar - - // Make sure the current page belongs to an item. - if (!$theme->item()) { - return; - } - - // Create a new block to display the link in. - $block = new Block(); - $block->css_id = "g-tags-map"; - $block->title = t("Map:"); - $block->content = new View("tagsmap_block.html"); - - return $block; + static function head($theme) { + $theme->css("tagsmap_menu.css"); } } diff --git a/modules/tagsmap/module.info b/modules/tagsmap/module.info index 488dd0db..973175d0 100644 --- a/modules/tagsmap/module.info +++ b/modules/tagsmap/module.info @@ -1,3 +1,3 @@ -name = TagsMap -description = Assign GPS coordinates to existing tags and display them on a map. +name = "TagsMap" +description = "Assign GPS coordinates to existing tags and display them on a map." version = 1 \ No newline at end of file diff --git a/modules/tagsmap/views/admin_tagsmap_delete.html.php b/modules/tagsmap/views/admin_tagsmap_delete.html.php index b64b5deb..8b6c0e95 100644 --- a/modules/tagsmap/views/admin_tagsmap_delete.html.php +++ b/modules/tagsmap/views/admin_tagsmap_delete.html.php @@ -1,5 +1,5 @@ -
+



">Delete diff --git a/modules/tagsmap/views/admin_tagsmap_edit.html.php b/modules/tagsmap/views/admin_tagsmap_edit.html.php index 440482b4..b9466a62 100644 --- a/modules/tagsmap/views/admin_tagsmap_edit.html.php +++ b/modules/tagsmap/views/admin_tagsmap_edit.html.php @@ -1,6 +1,58 @@ -
+

+
+

+
+
+ + + + diff --git a/modules/tagsmap/views/tagsmap_block.html.php b/modules/tagsmap/views/tagsmap_block.html.php deleted file mode 100644 index d4adc6d4..00000000 --- a/modules/tagsmap/views/tagsmap_block.html.php +++ /dev/null @@ -1,7 +0,0 @@ - - diff --git a/modules/tagsmap/views/tagsmap_googlemap.html.php b/modules/tagsmap/views/tagsmap_googlemap.html.php index 4fc99fd8..fdc7a1aa 100644 --- a/modules/tagsmap/views/tagsmap_googlemap.html.php +++ b/modules/tagsmap/views/tagsmap_googlemap.html.php @@ -3,7 +3,7 @@ - Gallery: Map + <?= t("Gallery :: Map") ?> @@ -20,6 +20,7 @@ map.addMapType(G_SATELLITE_3D_MAP); var mapControl = new GMapTypeControl(); map.addControl(mapControl); + map.enableScrollWheelZoom(); // Set map defaults. map.setCenter(new GLatLng(,