mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[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
This commit is contained in:
parent
6c213bd5fa
commit
05e74b82ac
1 changed files with 32 additions and 0 deletions
|
@ -705,6 +705,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
|
* Load user helper
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue