diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2012-10-29 23:34:51 -0500 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2012-10-29 23:34:51 -0500 |
commit | 05e74b82ac5b65896b1a6aa5b7bca7aa1acd3ada (patch) | |
tree | d398f7d08accc7c1fdb88925d4a7ead4fa8dcb38 | |
parent | 6c213bd5fa4f93875e7771edbf519990580286c4 (diff) | |
download | forums-05e74b82ac5b65896b1a6aa5b7bca7aa1acd3ada.tar forums-05e74b82ac5b65896b1a6aa5b7bca7aa1acd3ada.tar.gz forums-05e74b82ac5b65896b1a6aa5b7bca7aa1acd3ada.tar.bz2 forums-05e74b82ac5b65896b1a6aa5b7bca7aa1acd3ada.tar.xz forums-05e74b82ac5b65896b1a6aa5b7bca7aa1acd3ada.zip |
[ticket/11103] enable/disable notifications functions
disable_notifications
This should be called when an extension which has notification types
is disabled so that all those notifications are hidden and do not
cause errors
enable_notifications
This should be called when an extension which has notification types
that was disabled is re-enabled so that all those notifications that
were hidden are shown again
PHPBB3-11103
-rw-r--r-- | phpBB/includes/notification/manager.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/phpBB/includes/notification/manager.php b/phpBB/includes/notification/manager.php index b8c9c9742e..fef93a30c2 100644 --- a/phpBB/includes/notification/manager.php +++ b/phpBB/includes/notification/manager.php @@ -706,6 +706,38 @@ class phpbb_notification_manager } /** + * Disable all notifications of a certain type + * This should be called when an extension which has notification types + * is disabled so that all those notifications are hidden and do not + * cause errors + * + * @param string $item_type + */ + public function disable_notifications($item_type) + { + $sql = 'UPDATE ' . NOTIFICATIONS_TABLE . " + SET is_enabled = 0 + WHERE item_type = '" . $this->db->sql_escape($item_type) . "'"; + $this->db->sql_query($sql); + } + + /** + * Enable all notifications of a certain type + * This should be called when an extension which has notification types + * that was disabled is re-enabled so that all those notifications that + * were hidden are shown again + * + * @param string $item_type + */ + public function enable_notifications($item_type) + { + $sql = 'UPDATE ' . NOTIFICATIONS_TABLE . " + SET is_enabled = 1 + WHERE item_type = '" . $this->db->sql_escape($item_type) . "'"; + $this->db->sql_query($sql); + } + + /** * Load user helper * * @param array $user_ids |