1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/11103] The start of an all-encompassing notifications system

This system will take input from various systems to store notifications
and send notifications to users all in one nice extendable system.

This system should act something like the notifications system on
other social networking sites (in that, there is a single location where
a user can see all of their notifications for various events).

PHPBB3-11103
This commit is contained in:
Nathan Guse
2012-09-08 10:49:58 -05:00
parent 7bf598954c
commit b887fcc3d1
9 changed files with 530 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
<?php
/**
*
* @package notifications
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Base notifications method class
* @package notifications
*/
abstract class phpbb_notifications_method_base implements phpbb_notifications_method_interface
{
protected $phpbb_container;
protected $db;
protected $user;
/**
* notification_id
* item_type
* item_id
*
* by_user_id (one who caused the notification)
* user_id
* time
* unread
*
* data (special serialized field that each notification type can use to store stuff)
*/
protected $data = array();
public function __construct(Symfony\Component\DependencyInjection\ContainerBuilder $phpbb_container, $data = array())
{
// phpBB Container
$this->phpbb_container = $phpbb_container;
// Some common things we're going to use
$this->db = $phpbb_container->get('dbal.conn');
$this->user = $phpbb_container->get('user');
}
}

View File

@@ -0,0 +1,28 @@
<?php
/**
*
* @package notifications
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Email notification method class
* @package notifications
*/
class phpbb_notifications_method_email extends phpbb_notifications_method_base
{
function notify()
{
// email the user
}
}

View File

@@ -0,0 +1,24 @@
<?php
/**
*
* @package notifications
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Base notifications method interface
* @package notifications
*/
interface phpbb_notifications_method_interface
{
}