From 976e8d2b55e3d9f0ace2ef776be7939bfbf61bc9 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Wed, 26 Jan 2011 14:25:11 -0500 Subject: [PATCH] Added warning messages to alert admins if Tags isn't active. --- .../displaytags/helpers/displaytags_event.php | 37 +++++++++++++++++++ .../helpers/displaytags_installer.php | 36 ++++++++++++++++++ .../displaytags/helpers/displaytags_event.php | 37 +++++++++++++++++++ .../helpers/displaytags_installer.php | 36 ++++++++++++++++++ 4 files changed, 146 insertions(+) create mode 100644 3.0/modules/displaytags/helpers/displaytags_event.php create mode 100644 3.0/modules/displaytags/helpers/displaytags_installer.php create mode 100644 3.1/modules/displaytags/helpers/displaytags_event.php create mode 100644 3.1/modules/displaytags/helpers/displaytags_installer.php diff --git a/3.0/modules/displaytags/helpers/displaytags_event.php b/3.0/modules/displaytags/helpers/displaytags_event.php new file mode 100644 index 00000000..7b92685e --- /dev/null +++ b/3.0/modules/displaytags/helpers/displaytags_event.php @@ -0,0 +1,37 @@ +module == "tag") { + $data->messages["warn"][] = t("The DisplayTags module requires the Tags module."); + } + } + + static function module_change($changes) { + if (!module::is_active("tag") || in_array("tag", $changes->deactivate)) { + site_status::warning( + t("The DisplayTags module requires the Tags module. Activate the Tags module now", + array("url" => html::mark_clean(url::site("admin/modules")))), + "displaytags_needs_tag"); + } else { + site_status::clear("displaytags_needs_tag"); + } + } +} diff --git a/3.0/modules/displaytags/helpers/displaytags_installer.php b/3.0/modules/displaytags/helpers/displaytags_installer.php new file mode 100644 index 00000000..808def8a --- /dev/null +++ b/3.0/modules/displaytags/helpers/displaytags_installer.php @@ -0,0 +1,36 @@ +module == "tag") { + $data->messages["warn"][] = t("The DisplayTags module requires the Tags module."); + } + } + + static function module_change($changes) { + if (!module::is_active("tag") || in_array("tag", $changes->deactivate)) { + site_status::warning( + t("The DisplayTags module requires the Tags module. Activate the Tags module now", + array("url" => html::mark_clean(url::site("admin/modules")))), + "displaytags_needs_tag"); + } else { + site_status::clear("displaytags_needs_tag"); + } + } +} diff --git a/3.1/modules/displaytags/helpers/displaytags_installer.php b/3.1/modules/displaytags/helpers/displaytags_installer.php new file mode 100644 index 00000000..808def8a --- /dev/null +++ b/3.1/modules/displaytags/helpers/displaytags_installer.php @@ -0,0 +1,36 @@ +