From 2c01cd2fdd275730576beb2c8e20c2dd98996176 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Thu, 15 Oct 2009 04:43:19 +0800 Subject: [PATCH 1/5] 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(, From c92fd668ba3ca05c52ee8687a746d5bdd2f1511b Mon Sep 17 00:00:00 2001 From: rWatcher Date: Thu, 15 Oct 2009 07:03:22 +0800 Subject: [PATCH 2/5] TagFaces bugfix. --- modules/tagfaces/module.info | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/tagfaces/module.info b/modules/tagfaces/module.info index df060cc1..6c9766be 100644 --- a/modules/tagfaces/module.info +++ b/modules/tagfaces/module.info @@ -1,3 +1,3 @@ -name = TagFaces -description = Assign tags and notes to a region of a photo. +name = "TagFaces" +description = "Assign tags and notes to a region of a photo." version = 2 From edf931ae767155c3730fb460d28c0abc8c9ce4ac Mon Sep 17 00:00:00 2001 From: rWatcher Date: Thu, 15 Oct 2009 07:28:38 +0800 Subject: [PATCH 3/5] Updated for current Git. --- modules/rwinfo/helpers/rwinfo_block.php | 59 +++++++++++++++++++++ modules/rwinfo/helpers/rwinfo_installer.php | 24 --------- modules/rwinfo/helpers/rwinfo_theme.php | 30 +++-------- modules/rwinfo/views/rwinfo_block.html.php | 14 ++--- 4 files changed, 72 insertions(+), 55 deletions(-) create mode 100644 modules/rwinfo/helpers/rwinfo_block.php delete mode 100644 modules/rwinfo/helpers/rwinfo_installer.php diff --git a/modules/rwinfo/helpers/rwinfo_block.php b/modules/rwinfo/helpers/rwinfo_block.php new file mode 100644 index 00000000..2d129b1e --- /dev/null +++ b/modules/rwinfo/helpers/rwinfo_block.php @@ -0,0 +1,59 @@ + t("Metadata")); + } + + static function get($block_id, $theme) { + $block = ""; + switch ($block_id) { + case "metadata": + if ($theme->item()) { + // rWatcher Edit: Don't display on root album. + if ($theme->item->id == 1) { + return ""; + } + // End rWatcher Edit + + $block = new Block(); + $block->css_id = "g-metadata"; + + // rWatcher Edit: Add Movie Info Option + //$block->title = $theme->item()->is_album() ? t("Album Info") : t("Photo Info"); + $block_title = ""; + if ($theme->item->is_album()) { + $block_title = t("Album Info"); + } else if ($theme->item->is_movie()) { + $block_title = t("Movie Info"); + } else { + $block_title = t("Photo Info"); + } + $block->title = $block_title; + // End rWatcher Edit + + // rWatcher Edit: File Name change. + $block->content = new View("rwinfo_block.html"); + } + break; + } + return $block; + } +} \ No newline at end of file diff --git a/modules/rwinfo/helpers/rwinfo_installer.php b/modules/rwinfo/helpers/rwinfo_installer.php deleted file mode 100644 index fd0359ae..00000000 --- a/modules/rwinfo/helpers/rwinfo_installer.php +++ /dev/null @@ -1,24 +0,0 @@ -item()) { - if ($theme->item->id == 1) { - return ; - } - - $block = new Block(); - $block->css_id = "g-metadata"; - $block_title = ""; - if ($theme->item->is_album()) { - $block_title = t("Album Info"); - } else if ($theme->item->is_movie()) { - $block_title = t("Movie Info"); - } else { - $block_title = t("Photo Info"); - } - $block->title = $block_title; - $block->content = new View("rwinfo_block.html"); - return $block; - } - } - static function thumb_info($theme, $item) { $results = ""; if ($item->view_count) { @@ -48,6 +26,7 @@ class rwinfo_theme_Core { $results .= ""; } + // rWatcher Edit: Display Tags if (module::is_active("tag")) { $tagsItem = ORM::factory("tag") ->join("items_tags", "tags.id", "items_tags.tag_id") @@ -66,13 +45,16 @@ class rwinfo_theme_Core { $results .= ""; } } + // rWatcher End Edit if ($item->owner) { $results .= "
  • "; if ($item->owner->url) { - $results .= t("By: %owner_name", array("owner_name" => "owner->url}\">{$item->owner->full_name}")); + $results .= t("By: %owner_name", + array("owner_name" => $item->owner->display_name(), + "owner_url" => $item->owner->url)); } else { - $results .= t("By: %owner_name", array("owner_name" => "{$item->owner->full_name}")); + $results .= t("By: %owner_name", array("owner_name" => $item->owner->display_name())); } $results .= "
  • "; } diff --git a/modules/rwinfo/views/rwinfo_block.html.php b/modules/rwinfo/views/rwinfo_block.html.php index c23aa3e6..8e3b36f6 100644 --- a/modules/rwinfo/views/rwinfo_block.html.php +++ b/modules/rwinfo/views/rwinfo_block.html.php @@ -9,27 +9,27 @@ owner->display_name()) ?> + + is_album()): ?>
  • created)?>
  • + captured): ?> +
  • + + captured)?> +
  • - is_album()): ?>
  • name) ?>
  • - captured): ?> -
  • - - captured)?> -
  • - Date: Thu, 15 Oct 2009 07:36:12 +0800 Subject: [PATCH 4/5] Minor formatting change. --- modules/nobots/module.info | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nobots/module.info b/modules/nobots/module.info index 8948cdcc..0f706f43 100644 --- a/modules/nobots/module.info +++ b/modules/nobots/module.info @@ -1,3 +1,3 @@ -name = NoBots -description = Block web crawlers from indexing your Gallery. +name = "NoBots" +description = "Block web crawlers from indexing your Gallery." version = 1 From 4b0d2d679af00029352aef929fa90701e8664862 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Thu, 15 Oct 2009 07:39:15 +0800 Subject: [PATCH 5/5] Minor format change. --- modules/metadescription/module.info | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/metadescription/module.info b/modules/metadescription/module.info index 3935288f..19c2cd48 100644 --- a/modules/metadescription/module.info +++ b/modules/metadescription/module.info @@ -1,3 +1,3 @@ -name = MetaDescription -description = Automatically generates and inserts KEYWORD and DESCRIPTION meta tags into any theme. +name = "MetaDescription" +description = "Automatically generates and inserts KEYWORD and DESCRIPTION meta tags into any theme." version = 1