diff --git a/phpBB/includes/notification/type/post_in_queue.php b/phpBB/includes/notification/type/post_in_queue.php index 9c4f0ab8d3..60b4bb4937 100644 --- a/phpBB/includes/notification/type/post_in_queue.php +++ b/phpBB/includes/notification/type/post_in_queue.php @@ -48,6 +48,13 @@ class phpbb_notification_type_post_in_queue extends phpbb_notification_type_post 'lang' => 'NOTIFICATION_TYPE_IN_MODERATION_QUEUE', ); + /** + * Permission to check for (in find_users_for_notification) + * + * @var string Permission name + */ + protected $permission = 'm_approve'; + /** * Get the type of notification this is * phpbb_notification_type_ @@ -62,7 +69,7 @@ class phpbb_notification_type_post_in_queue extends phpbb_notification_type_post */ public function is_available() { - $m_approve = $this->auth->acl_getf('m_approve', true); + $m_approve = $this->auth->acl_getf($this->permission, true); return (!empty($m_approve)); } @@ -80,7 +87,7 @@ class phpbb_notification_type_post_in_queue extends phpbb_notification_type_post 'ignore_users' => array(), ), $options); - $auth_approve = $this->auth->acl_get_list(false, 'm_approve', $post['forum_id']); + $auth_approve = $this->auth->acl_get_list(false, $this->permission, $post['forum_id']); if (empty($auth_approve)) { diff --git a/phpBB/includes/notification/type/report.php b/phpBB/includes/notification/type/report.php new file mode 100644 index 0000000000..76c37c99f0 --- /dev/null +++ b/phpBB/includes/notification/type/report.php @@ -0,0 +1,85 @@ + htmlspecialchars_decode(censor_text($this->get_data('post_subject'))), + 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))), + + 'U_VIEW_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?p={$this->item_id}#p{$this->item_id}", + 'U_NEWEST_POST' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}&view=unread#unread", + 'U_TOPIC' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}", + 'U_VIEW_TOPIC' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}", + 'U_FORUM' => generate_board_url() . "/viewforum.{$this->php_ext}?f={$this->get_data('forum_id')}", + 'U_STOP_WATCHING_TOPIC' => generate_board_url() . "/viewtopic.{$this->php_ext}?uid={$this->user_id}&f={$this->get_data('forum_id')}&t={$this->item_parent_id}&unwatch=topic", + ); + } + + /** + * Get the url to this item + * + * @return string URL + */ + public function get_url() + { + return append_sid($this->phpbb_root_path . 'mcp.' . $this->php_ext, "f={$this->get_data('forum_id')}&p={$this->item_id}&i=reports&mode=report_details#reports"); + } +}