diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2013-07-27 17:02:45 -0500 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2013-07-27 17:02:45 -0500 |
commit | 46b4a405b1563c2fe15dad34c9ff2843271cd8f8 (patch) | |
tree | cbf56e8aa6ff234bf8b21d94d6cb7ce1b99738e7 /phpBB/phpbb | |
parent | b213be84a7ff0f947de0025dcc4620142edf226b (diff) | |
download | forums-46b4a405b1563c2fe15dad34c9ff2843271cd8f8.tar forums-46b4a405b1563c2fe15dad34c9ff2843271cd8f8.tar.gz forums-46b4a405b1563c2fe15dad34c9ff2843271cd8f8.tar.bz2 forums-46b4a405b1563c2fe15dad34c9ff2843271cd8f8.tar.xz forums-46b4a405b1563c2fe15dad34c9ff2843271cd8f8.zip |
[ticket/11745] Group request approved notification
PHPBB3-11745
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r-- | phpBB/phpbb/notification/type/group_request_approved.php | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/phpBB/phpbb/notification/type/group_request_approved.php b/phpBB/phpbb/notification/type/group_request_approved.php new file mode 100644 index 0000000000..ce83329ff3 --- /dev/null +++ b/phpBB/phpbb/notification/type/group_request_approved.php @@ -0,0 +1,118 @@ +<?php +/** +* +* @package notifications +* @copyright (c) 2013 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +class phpbb_notification_type_group_request_approved extends phpbb_notification_type_base +{ + /** + * {@inheritdoc} + */ + public function get_type() + { + return 'group_request_approved'; + } + + /** + * {@inheritdoc} + */ + public function is_available() + { + return false; + } + + /** + * {@inheritdoc} + */ + public static function get_item_id($group) + { + return (int) $group['group_id']; + } + + /** + * {@inheritdoc} + */ + public static function get_item_parent_id($group) + { + return 0; + } + + /** + * {@inheritdoc} + */ + public function find_users_for_notification($group, $options = array()) + { + $users = array(); + + $group['user_ids'] = (!is_array($group['user_ids'])) ? array($group['user_ids']) : $group['user_ids']; + + foreach ($group['user_ids'] as $user_id) + { + $users[$user_id] = array(''); + } + + return $users; + } + + /** + * {@inheritdoc} + */ + public function get_title() + { + return $this->user->lang('NOTIFICATION_GROUP_REQUEST_APPROVED', $this->get_data('group_name')); + } + + /** + * {@inheritdoc} + */ + public function get_url() + { + return append_sid($this->phpbb_root_path . 'memberlist.' . $this->php_ext, "mode=group&g={$this->item_id}"); + } + + /** + * {@inheritdoc} + */ + public function create_insert_array($group, $pre_create_data = array()) + { + $this->set_data('group_name', $group['group_name']); + + return parent::create_insert_array($group, $pre_create_data); + } + + /** + * {@inheritdoc} + */ + public function users_to_query() + { + return array(); + } + + /** + * {@inheritdoc} + */ + public function get_email_template() + { + return false; + } + + /** + * {@inheritdoc} + */ + public function get_email_template_variables() + { + return array(); + } +} |