From 8178e7abaf454ed5460a7d6835262d178f5c7903 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Tue, 7 Jun 2011 11:53:49 -0400 Subject: [PATCH] Warn admin's that the TagsMap module requires the tags module. --- 3.0/modules/tagsmap/helpers/tagsmap_event.php | 6 ++++++ 3.0/modules/tagsmap/helpers/tagsmap_installer.php | 8 ++++++++ 3.1/modules/tagsmap/helpers/tagsmap_event.php | 6 ++++++ 3.1/modules/tagsmap/helpers/tagsmap_installer.php | 8 ++++++++ 4 files changed, 28 insertions(+) diff --git a/3.0/modules/tagsmap/helpers/tagsmap_event.php b/3.0/modules/tagsmap/helpers/tagsmap_event.php index 66ed8fd2..b38d9f50 100644 --- a/3.0/modules/tagsmap/helpers/tagsmap_event.php +++ b/3.0/modules/tagsmap/helpers/tagsmap_event.php @@ -32,6 +32,12 @@ class tagsmap_event_Core { } } + static function pre_deactivate($data) { + if ($data->module == "tag") { + $data->messages["warn"][] = t("The TagsMap module requires the Tags module."); + } + } + static function admin_menu($menu, $theme) { // Add a link to the TagsMap admin page to the Content menu. $menu->get("content_menu") diff --git a/3.0/modules/tagsmap/helpers/tagsmap_installer.php b/3.0/modules/tagsmap/helpers/tagsmap_installer.php index 48ad5461..4567d4df 100644 --- a/3.0/modules/tagsmap/helpers/tagsmap_installer.php +++ b/3.0/modules/tagsmap/helpers/tagsmap_installer.php @@ -43,6 +43,14 @@ class tagsmap_installer { site_status::clear("tagsmap_needs_tag"); } + static function can_activate() { + $messages = array(); + if (!module::is_active("tag")) { + $messages["warn"][] = t("The TagsMap module requires the Tags module."); + } + return $messages; + } + static function uninstall() { // Delete the GPS table before uninstalling. $db = Database::instance(); diff --git a/3.1/modules/tagsmap/helpers/tagsmap_event.php b/3.1/modules/tagsmap/helpers/tagsmap_event.php index 66ed8fd2..b38d9f50 100644 --- a/3.1/modules/tagsmap/helpers/tagsmap_event.php +++ b/3.1/modules/tagsmap/helpers/tagsmap_event.php @@ -32,6 +32,12 @@ class tagsmap_event_Core { } } + static function pre_deactivate($data) { + if ($data->module == "tag") { + $data->messages["warn"][] = t("The TagsMap module requires the Tags module."); + } + } + static function admin_menu($menu, $theme) { // Add a link to the TagsMap admin page to the Content menu. $menu->get("content_menu") diff --git a/3.1/modules/tagsmap/helpers/tagsmap_installer.php b/3.1/modules/tagsmap/helpers/tagsmap_installer.php index 48ad5461..4567d4df 100644 --- a/3.1/modules/tagsmap/helpers/tagsmap_installer.php +++ b/3.1/modules/tagsmap/helpers/tagsmap_installer.php @@ -43,6 +43,14 @@ class tagsmap_installer { site_status::clear("tagsmap_needs_tag"); } + static function can_activate() { + $messages = array(); + if (!module::is_active("tag")) { + $messages["warn"][] = t("The TagsMap module requires the Tags module."); + } + return $messages; + } + static function uninstall() { // Delete the GPS table before uninstalling. $db = Database::instance();