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();