From 8baa233489770450d5aaa0cf350fe8063a270423 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 27 Jul 2011 18:22:58 +0200 Subject: [PATCH] Moved into own repository WoltLab/com.woltlab.wcf.notification --- com.woltlab.wcf.notification/coreobject.xml | 8 -- .../notification/UserNotification.class.php | 25 ---- .../UserNotificationAction.class.php | 20 --- .../UserNotificationEditor.class.php | 47 ------- .../UserNotificationList.class.php | 20 --- .../event/UserNotificationEvent.class.php | 30 ----- .../UserNotificationEventAction.class.php | 20 --- .../UserNotificationEventEditor.class.php | 20 --- .../event/UserNotificationEventList.class.php | 20 --- .../type/UserNotificationObjectType.class.php | 30 ----- ...UserNotificationObjectTypeAction.class.php | 20 --- ...UserNotificationObjectTypeEditor.class.php | 20 --- .../UserNotificationObjectTypeList.class.php | 20 --- .../UserNotificationRecipient.class.php | 63 ---------- .../UserNotificationRecipientList.class.php | 64 ---------- .../type/UserNotificationType.class.php | 30 ----- .../type/UserNotificationTypeAction.class.php | 20 --- .../type/UserNotificationTypeEditor.class.php | 20 --- .../type/UserNotificationTypeList.class.php | 20 --- ...uilderUserNotificationObjectType.class.php | 69 ----------- ...onEventPackageInstallationPlugin.class.php | 115 ------------------ ...ectTypePackageInstallationPlugin.class.php | 77 ------------ ...ionTypePackageInstallationPlugin.class.php | 77 ------------ .../UserNotificationHandler.class.php | 85 ------------- .../AbstractUserNotificationEvent.class.php | 20 --- .../event/IUserNotificationEvent.class.php | 67 ---------- .../object/IUserNotificationObject.class.php | 36 ------ ...stractUserNotificationObjectType.class.php | 20 --- .../IUserNotificationObjectType.class.php | 32 ----- .../AbstractUserNotificationType.class.php | 20 --- .../type/IUserNotificationType.class.php | 36 ------ .../type/MailUserNotificationType.class.php | 62 ---------- com.woltlab.wcf.notification/install.sql | 92 -------------- com.woltlab.wcf.notification/package.xml | 27 ---- com.woltlab.wcf.notification/pip.xml | 8 -- .../userNotificationType.xml | 9 -- 36 files changed, 1369 deletions(-) delete mode 100644 com.woltlab.wcf.notification/coreobject.xml delete mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotification.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationAction.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationEditor.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationList.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEvent.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEventAction.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEventEditor.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEventList.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectType.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectTypeAction.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectTypeEditor.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectTypeList.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/recipient/UserNotificationRecipient.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/recipient/UserNotificationRecipientList.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationType.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationTypeAction.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationTypeEditor.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationTypeList.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/system/cache/builder/CacheBuilderUserNotificationObjectType.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/system/package/plugin/UserNotificationEventPackageInstallationPlugin.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/system/package/plugin/UserNotificationObjectTypePackageInstallationPlugin.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/system/package/plugin/UserNotificationTypePackageInstallationPlugin.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/system/user/notification/UserNotificationHandler.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/system/user/notification/event/AbstractUserNotificationEvent.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/system/user/notification/event/IUserNotificationEvent.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/system/user/notification/object/IUserNotificationObject.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/system/user/notification/object/type/AbstractUserNotificationObjectType.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/system/user/notification/object/type/IUserNotificationObjectType.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/system/user/notification/type/AbstractUserNotificationType.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/system/user/notification/type/IUserNotificationType.class.php delete mode 100644 com.woltlab.wcf.notification/files/lib/system/user/notification/type/MailUserNotificationType.class.php delete mode 100644 com.woltlab.wcf.notification/install.sql delete mode 100644 com.woltlab.wcf.notification/package.xml delete mode 100644 com.woltlab.wcf.notification/pip.xml delete mode 100644 com.woltlab.wcf.notification/userNotificationType.xml diff --git a/com.woltlab.wcf.notification/coreobject.xml b/com.woltlab.wcf.notification/coreobject.xml deleted file mode 100644 index 48890e4427..0000000000 --- a/com.woltlab.wcf.notification/coreobject.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotification.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotification.class.php deleted file mode 100644 index 0b4fcc0488..0000000000 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotification.class.php +++ /dev/null @@ -1,25 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage data.user.notification - * @category Community Framework - */ -class UserNotification extends DatabaseObject { - /** - * @see wcf\data\DatabaseObject::$databaseTableName - */ - protected static $databaseTableName = 'user_notification'; - - /** - * @see wcf\data\DatabaseObject::$databaseTableIndexName - */ - protected static $databaseTableIndexName = 'notificationID'; -} diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationAction.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationAction.class.php deleted file mode 100644 index e335d70212..0000000000 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationAction.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage data.user.notification - * @category Community Framework - */ -class UserNotificationAction extends AbstractDatabaseObjectAction { - /** - * @see wcf\data\AbstractDatabaseObjectAction::$className - */ - protected $className = 'wcf\data\user\notification\UserNotificationEditor'; -} diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationEditor.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationEditor.class.php deleted file mode 100644 index 36004ef7c5..0000000000 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationEditor.class.php +++ /dev/null @@ -1,47 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage data.user.notification - * @category Community Framework - */ -class UserNotificationEditor extends DatabaseObjectEditor { - /** - * @see wcf\data\DatabaseObjectDecorator::$baseClass - */ - protected static $baseClass = 'wcf\data\user\notification\UserNotification'; - - /** - * @see EditableObject::create() - */ - public static function create(array $parameters = array()) { - $recipientIDs = array(); - if (isset($parameters['recipientIDs']) && is_array($parameters['recipientIDs'])) { - $recipientIDs = $parameters['recipientIDs']; - unset($parameters['recipientIDs']); - } - - $notification = parent::create($parameters); - - // save recpients - if (count($recipientIDs)) { - $sql = "INSERT INTO wcf".WCF_N."_user_notification_to_user - (notificationID, userID) - VALUES (?, ?)"; - $statement = WCF::getDB()->prepareStatement($sql); - foreach ($recipientIDs as $recipientID) { - $statement->execute(array($notification->notificationID, $recipientID)); - } - } - - return $notification; - } -} diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationList.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationList.class.php deleted file mode 100644 index 8a60cf1458..0000000000 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/UserNotificationList.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage data.user.notification - * @category Community Framework - */ -class UserNotificationList extends DatabaseObjectList { - /** - * @see wcf\data\DatabaseObjectList::$className - */ - public $className = 'wcf\data\user\notification\UserNotification'; -} diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEvent.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEvent.class.php deleted file mode 100644 index f44ade6e7f..0000000000 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEvent.class.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage data.user.notification.event - * @category Community Framework - */ -class UserNotificationEvent extends ProcessibleDatabaseObject { - /** - * @see wcf\data\DatabaseObject::$databaseTableName - */ - protected static $databaseTableName = 'user_notification_event'; - - /** - * @see wcf\data\DatabaseObject::$databaseTableIndexName - */ - protected static $databaseTableIndexName = 'eventID'; - - /** - * @see wcf\data\ProcessibleDatabaseObject::$processorInterface - */ - protected static $processorInterface = 'wcf\system\user\notification\event\IUserNotificationEvent'; -} diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEventAction.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEventAction.class.php deleted file mode 100644 index 9321c2c3dd..0000000000 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEventAction.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage data.user.notification.event - * @category Community Framework - */ -class UserNotificationEventAction extends AbstractDatabaseObjectAction { - /** - * @see wcf\data\AbstractDatabaseObjectAction::$className - */ - protected $className = 'wcf\data\user\notification\event\UserNotificationEventEditor'; -} diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEventEditor.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEventEditor.class.php deleted file mode 100644 index 8f51549a34..0000000000 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEventEditor.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage data.user.notification.event - * @category Community Framework - */ -class UserNotificationEventEditor extends DatabaseObjectEditor { - /** - * @see wcf\data\DatabaseObjectDecorator::$baseClass - */ - protected static $baseClass = 'wcf\data\user\notification\event\UserNotificationEvent'; -} diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEventList.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEventList.class.php deleted file mode 100644 index f55a438d9b..0000000000 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/event/UserNotificationEventList.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage data.user.notification.event - * @category Community Framework - */ -class UserNotificationEventList extends DatabaseObjectList { - /** - * @see wcf\data\DatabaseObjectList::$className - */ - public $className = 'wcf\data\user\notification\event\UserNotificationEvent'; -} diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectType.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectType.class.php deleted file mode 100644 index 421530065d..0000000000 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectType.class.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage data.user.notification.object.type - * @category Community Framework - */ -class UserNotificationObjectType extends ProcessibleDatabaseObject { - /** - * @see wcf\data\DatabaseObject::$databaseTableName - */ - protected static $databaseTableName = 'user_notification_object_type'; - - /** - * @see wcf\data\DatabaseObject::$databaseTableIndexName - */ - protected static $databaseTableIndexName = 'objectTypeID'; - - /** - * @see wcf\data\ProcessibleDatabaseObject::$processorInterface - */ - protected static $processorInterface = 'wcf\system\user\notification\object\type\IUserNotificationObjectType'; -} diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectTypeAction.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectTypeAction.class.php deleted file mode 100644 index 0e7eea0282..0000000000 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectTypeAction.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage data.user.notification.object.type - * @category Community Framework - */ -class UserNotificationObjectTypeAction extends AbstractDatabaseObjectAction { - /** - * @see wcf\data\AbstractDatabaseObjectAction::$className - */ - protected $className = 'wcf\data\user\notification\object\type\UserNotificationObjectTypeEditor'; -} diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectTypeEditor.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectTypeEditor.class.php deleted file mode 100644 index 8247834740..0000000000 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectTypeEditor.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage data.user.notification.object.type - * @category Community Framework - */ -class UserNotificationObjectTypeEditor extends DatabaseObjectEditor { - /** - * @see wcf\data\DatabaseObjectDecorator::$baseClass - */ - protected static $baseClass = 'wcf\data\user\notification\object\type\UserNotificationObjectType'; -} diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectTypeList.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectTypeList.class.php deleted file mode 100644 index 0bd0b484e1..0000000000 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/object/type/UserNotificationObjectTypeList.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage data.user.notification - * @category Community Framework - */ -class UserNotificationObjectTypeList extends DatabaseObjectList { - /** - * @see wcf\data\DatabaseObjectList::$className - */ - public $className = 'wcf\data\user\notification\object\type\UserNotificationObjectType'; -} diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/recipient/UserNotificationRecipient.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/recipient/UserNotificationRecipient.class.php deleted file mode 100644 index 7e9dee91fb..0000000000 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/recipient/UserNotificationRecipient.class.php +++ /dev/null @@ -1,63 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage data.user.notification.user - * @category Community Framework - */ -class UserNotificationRecipient extends DatabaseObjectDecorator { - /** - * @see DatabaseObjectDecorator::$baseClass - */ - protected static $baseClass = 'wcf\data\user\User'; - - /** - * Creates a new UserNotificationRecipient object. - * - * @param wcf\data\user\User $object - */ - public function __construct(User $object) { - parent::__construct($object); - - // get notification types - if (!isset($this->object->data['notificationTypes'])) { - $this->object->data['notificationTypes'] = array(); - $sql = "SELECT event_to_user.eventID, notification_type.* - FROM wcf".WCF_N."_user_notification_event_to_user event_to_user - LEFT JOIN wcf".WCF_N."_user_notification_type notification_type - ON (notification_type.notificationTypeID = event_to_user.notificationTypeID) - WHERE event_to_user.userID = ? - AND event_to_user.enabled = ?"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array($this->userID, 1)); - while ($row = $statement->fetchArray()) { - $databaseObject = new UserNotificationType(null, $row); - $this->object->data['notificationTypes'][$row['eventID']][] = $databaseObject->getProcessor(); - } - } - } - - /** - * Returns the enabled notification types for the given event. - * - * @param integer $eventID - * @return array - */ - public function getNotificationTypes($eventID) { - if (isset($this->notificationTypes[$eventID])) { - return $this->notificationTypes[$eventID]; - } - - return array(); - } -} diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/recipient/UserNotificationRecipientList.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/recipient/UserNotificationRecipientList.class.php deleted file mode 100644 index 6253315f98..0000000000 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/recipient/UserNotificationRecipientList.class.php +++ /dev/null @@ -1,64 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage data.user.notification.user - * @category Community Framework - */ -class UserNotificationRecipientList extends UserList { - /** - * @see wcf\data\DatabaseObjectList\DatabaseObjectList::readObjects() - */ - public function readObjects() { - if ($this->objectIDs === null) { - $this->readObjectIDs(); - } - - if (!count($this->objectIDs)) { - return; - } - - // get notification types - $notificationTypes = array(); - $conditionBuilder = new PreparedStatementConditionBuilder(); - $conditionBuilder->add('event_to_user.userID IN (?)', array($this->objectIDs)); - $conditionBuilder->add('event_to_user.enabled = ?', array(1)); - - $sql = "SELECT event_to_user.eventID, event_to_user.userID, notification_type.* - FROM wcf".WCF_N."_user_notification_event_to_user event_to_user - LEFT JOIN wcf".WCF_N."_user_notification_type notification_type - ON (notification_type.notificationTypeID = event_to_user.notificationTypeID) - ".$conditionBuilder->__toString(); - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute($conditionBuilder->getParameters()); - while ($row = $statement->fetchArray()) { - $databaseObject = new UserNotificationType(null, $row); - $notificationTypes[$row['userID']][$row['eventID']][] = $databaseObject->getProcessor(); - } - - // get users - $sql = "SELECT ".(!empty($this->sqlSelects) ? $this->sqlSelects.',' : '')." - ".$this->getDatabaseTableAlias().".* - FROM ".$this->getDatabaseTableName()." ".$this->getDatabaseTableAlias()." - ".$this->sqlJoins." - WHERE ".$this->getDatabaseTableAlias().".".$this->getDatabaseTableIndexName()." IN (?".str_repeat(',?', count($this->objectIDs) - 1).") - ".(!empty($this->sqlOrderBy) ? "ORDER BY ".$this->sqlOrderBy : ''); - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute($this->objectIDs); - while ($row = $statement->fetchArray()) { - $row['notificationTypes'] = (isset($notificationTypes[$row['userID']]) ? $notificationTypes[$row['userID']] : array()); - $this->objects[] = new UserNotificationRecipient(new User(null, $row)); - } - } -} diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationType.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationType.class.php deleted file mode 100644 index b78ceca019..0000000000 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationType.class.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage data.user.notification.type - * @category Community Framework - */ -class UserNotificationType extends ProcessibleDatabaseObject { - /** - * @see wcf\data\DatabaseObject::$databaseTableName - */ - protected static $databaseTableName = 'user_notification_type'; - - /** - * @see wcf\data\DatabaseObject::$databaseTableIndexName - */ - protected static $databaseTableIndexName = 'notificationTypeID'; - - /** - * @see wcf\data\ProcessibleDatabaseObject::$processorInterface - */ - protected static $processorInterface = 'wcf\system\user\notification\type\IUserNotificationType'; -} diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationTypeAction.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationTypeAction.class.php deleted file mode 100644 index 69ef7bae63..0000000000 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationTypeAction.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage data.user.notification.type - * @category Community Framework - */ -class UserNotificationTypeAction extends AbstractDatabaseObjectAction { - /** - * @see wcf\data\AbstractDatabaseObjectAction::$className - */ - protected $className = 'wcf\data\user\notification\type\UserNotificationTypeEditor'; -} diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationTypeEditor.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationTypeEditor.class.php deleted file mode 100644 index 1794dec311..0000000000 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationTypeEditor.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage data.user.notification.type - * @category Community Framework - */ -class UserNotificationTypeEditor extends DatabaseObjectEditor { - /** - * @see wcf\data\DatabaseObjectDecorator::$baseClass - */ - protected static $baseClass = 'wcf\data\user\notification\type\UserNotificationType'; -} diff --git a/com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationTypeList.class.php b/com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationTypeList.class.php deleted file mode 100644 index 8e83df0ef2..0000000000 --- a/com.woltlab.wcf.notification/files/lib/data/user/notification/type/UserNotificationTypeList.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage data.user.notification.type - * @category Community Framework - */ -class UserNotificationTypeList extends DatabaseObjectList { - /** - * @see wcf\data\DatabaseObjectList::$className - */ - public $className = 'wcf\data\user\notification\type\UserNotificationType'; -} diff --git a/com.woltlab.wcf.notification/files/lib/system/cache/builder/CacheBuilderUserNotificationObjectType.class.php b/com.woltlab.wcf.notification/files/lib/system/cache/builder/CacheBuilderUserNotificationObjectType.class.php deleted file mode 100644 index 9d69444713..0000000000 --- a/com.woltlab.wcf.notification/files/lib/system/cache/builder/CacheBuilderUserNotificationObjectType.class.php +++ /dev/null @@ -1,69 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage system.cache.builder - * @category Community Framework - */ -class CacheBuilderUserNotificationObjectType implements ICacheBuilder { - /** - * @see wcf\system\cache\ICacheBuilder::getData() - */ - public function getData($cacheResource) { - $data = array(); - - // get package id - $tmp = explode('-', $cacheResource['cache']); - $packageID = array_pop($tmp); - - // get object types - $typeIDArray = array(); - $sql = "SELECT object_type.* - FROM wcf".WCF_N."_user_notification_object_type object_type, - wcf".WCF_N."_package_dependency package_dependency - WHERE object_type.packageID = package_dependency.dependency - AND package_dependency.packageID = ? - ORDER BY package_dependency.priority DESC"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array($packageID)); - while ($row = $statement->fetchArray()) { - if (!isset($data[$row['objectType']])) { - $databaseObject = new UserNotificationObjectType(null, $row); - $data[$row['objectType']] = array( - 'object' => $databaseObject->getProcessor(), - 'events' => array() - ); - } - } - - // get events - $sql = "SELECT event.*, object_type.objectType - FROM wcf".WCF_N."_package_dependency package_dependency, - wcf".WCF_N."_user_notification_event event - LEFT JOIN wcf".WCF_N."_user_notification_object_type object_type - ON (object_type.objectTypeID = event.objectTypeID) - WHERE event.packageID = package_dependency.dependency - AND package_dependency.packageID = ? - ORDER BY package_dependency.priority DESC"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array($packageID)); - while ($row = $statement->fetchArray()) { - if (isset($data[$row['objectType']]) && !isset($data[$row['objectType']]['events'][$row['eventName']])) { - $databaseObject = new UserNotificationEvent(null, $row); - $data[$row['objectType']]['events'][$row['eventName']] = $databaseObject->getProcessor(); - } - } - - return $data; - } -} diff --git a/com.woltlab.wcf.notification/files/lib/system/package/plugin/UserNotificationEventPackageInstallationPlugin.class.php b/com.woltlab.wcf.notification/files/lib/system/package/plugin/UserNotificationEventPackageInstallationPlugin.class.php deleted file mode 100644 index 5527e759dd..0000000000 --- a/com.woltlab.wcf.notification/files/lib/system/package/plugin/UserNotificationEventPackageInstallationPlugin.class.php +++ /dev/null @@ -1,115 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage system.package.plugin - * @category Community Framework - */ -class UserNotificationEventPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin { - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$className - */ - public $className = 'wcf\data\user\notification\event\UserNotificationEventEditor'; - - /** - * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName - */ - public $tableName = 'user_notification_event'; - - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName - */ - public $tagName = 'event'; - - /** - * @see AbstractXMLPackageInstallationPlugin::handleDelete() - */ - protected function handleDelete(array $items) { - $sql = "DELETE FROM wcf".WCF_N."_".$this->tableName." - WHERE packageID = ? - AND eventName = ?"; - $statement = WCF::getDB()->prepareStatement($sql); - foreach ($items as $item) { - $statement->execute(array( - $this->installation->getPackageID(), - $item['elements']['name'] - )); - } - } - - /** - * @see AbstractXMLPackageInstallationPlugin::prepareImport() - */ - protected function prepareImport(array $data) { - // get object type id - $sql = "SELECT notification_object_type.objectTypeID - FROM wcf".WCF_N."_package_dependency package_dependency, - wcf".WCF_N."_user_notification_object_type notification_object_type - WHERE notification_object_type.packageID = package_dependency.dependency - AND package_dependency.packageID = ? - AND notification_object_type.objectType = ? - ORDER BY package_dependency.priority DESC"; - $statement = WCF::getDB()->prepareStatement($sql, 1); - $statement->execute(array($this->installation->getPackageID(), $data['elements']['objecttype'])); - $row = $statement->fetchArray(); - if (empty($row['objectTypeID'])) throw new SystemException("unknown notification object type '".$data['elements']['objecttype']."' given"); - $objectTypeID = $row['objectTypeID']; - - // get notification type id - $defaultNotificationTypeID = 0; - if (!empty($data['elements']['defaultnotificationtype'])) { - $sql = "SELECT notification_type.notificationTypeID - FROM wcf".WCF_N."_package_dependency package_dependency, - wcf".WCF_N."_user_notification_type notification_type - WHERE notification_type.packageID = package_dependency.dependency - AND package_dependency.packageID = ? - AND notification_type.notificationType = ? - ORDER BY package_dependency.priority DESC"; - $statement = WCF::getDB()->prepareStatement($sql, 1); - $statement->execute(array($this->installation->getPackageID(), $data['elements']['defaultnotificationtype'])); - $row = $statement->fetchArray(); - if (empty($row['notificationTypeID'])) throw new SystemException("unknown notification type '".$data['elements']['defaultnotificationtype']."' given"); - $defaultNotificationTypeID = $row['notificationTypeID']; - } - - return array( - 'eventName' => $data['elements']['name'], - 'className' => $data['elements']['classname'], - 'objectTypeID' => $objectTypeID, - 'defaultNotificationTypeID' => $defaultNotificationTypeID, - 'languageCategory' => (isset($data['elements']['languagecategory']) ? $data['elements']['languagecategory'] : ''), - 'requiresConfirmation' => (isset($data['elements']['requiresconfirmation']) ? intval($data['elements']['requiresconfirmation']) : 0), - 'acceptURL' => (isset($data['elements']['accepturl']) ? $data['elements']['accepturl'] : ''), - 'declineURL' => (isset($data['elements']['declineurl']) ? $data['elements']['declineurl'] : ''), - 'permissions' => (isset($data['elements']['permissions']) ? $data['elements']['permissions'] : ''), - 'options' => (isset($data['elements']['options']) ? $data['elements']['options'] : '') - ); - } - - /** - * @see AbstractXMLPackageInstallationPlugin::findExistingItem() - */ - protected function findExistingItem(array $data) { - $sql = "SELECT * - FROM wcf".WCF_N."_".$this->tableName." - WHERE packageID = ? - AND eventName = ?"; - $parameters = array( - $this->installation->getPackageID(), - $data['eventName'] - ); - - return array( - 'sql' => $sql, - 'parameters' => $parameters - ); - } -} diff --git a/com.woltlab.wcf.notification/files/lib/system/package/plugin/UserNotificationObjectTypePackageInstallationPlugin.class.php b/com.woltlab.wcf.notification/files/lib/system/package/plugin/UserNotificationObjectTypePackageInstallationPlugin.class.php deleted file mode 100644 index b6d1dc6238..0000000000 --- a/com.woltlab.wcf.notification/files/lib/system/package/plugin/UserNotificationObjectTypePackageInstallationPlugin.class.php +++ /dev/null @@ -1,77 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage system.package.plugin - * @category Community Framework - */ -class UserNotificationObjectTypePackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin { - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$className - */ - public $className = 'wcf\data\user\notification\object\type\UserNotificationObjectTypeEditor'; - - /** - * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName - */ - public $tableName = 'user_notification_object_type'; - - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName - */ - public $tagName = 'objecttype'; - - /** - * @see AbstractXMLPackageInstallationPlugin::handleDelete() - */ - protected function handleDelete(array $items) { - $sql = "DELETE FROM wcf".WCF_N."_".$this->tableName." - WHERE packageID = ? - AND objectType = ?"; - $statement = WCF::getDB()->prepareStatement($sql); - foreach ($items as $item) { - $statement->execute(array( - $this->installation->getPackageID(), - $item['elements']['name'] - )); - } - } - - /** - * @see AbstractXMLPackageInstallationPlugin::prepareImport() - */ - protected function prepareImport(array $data) { - return array( - 'objectType' => $data['elements']['name'], - 'className' => $data['elements']['classname'], - 'permissions' => (isset($data['elements']['permissions']) ? $data['elements']['permissions'] : ''), - 'options' => (isset($data['elements']['options']) ? $data['elements']['options'] : '') - ); - } - - /** - * @see AbstractXMLPackageInstallationPlugin::findExistingItem() - */ - protected function findExistingItem(array $data) { - $sql = "SELECT * - FROM wcf".WCF_N."_".$this->tableName." - WHERE packageID = ? - AND objectType = ?"; - $parameters = array( - $this->installation->getPackageID(), - $data['objectType'] - ); - - return array( - 'sql' => $sql, - 'parameters' => $parameters - ); - } -} diff --git a/com.woltlab.wcf.notification/files/lib/system/package/plugin/UserNotificationTypePackageInstallationPlugin.class.php b/com.woltlab.wcf.notification/files/lib/system/package/plugin/UserNotificationTypePackageInstallationPlugin.class.php deleted file mode 100644 index d875f30957..0000000000 --- a/com.woltlab.wcf.notification/files/lib/system/package/plugin/UserNotificationTypePackageInstallationPlugin.class.php +++ /dev/null @@ -1,77 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage system.package.plugin - * @category Community Framework - */ -class UserNotificationTypePackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin { - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$className - */ - public $className = 'wcf\data\user\notification\type\UserNotificationTypeEditor'; - - /** - * @see wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName - */ - public $tableName = 'user_notification_type'; - - /** - * @see wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName - */ - public $tagName = 'notificationtype'; - - /** - * @see AbstractXMLPackageInstallationPlugin::handleDelete() - */ - protected function handleDelete(array $items) { - $sql = "DELETE FROM wcf".WCF_N."_".$this->tableName." - WHERE packageID = ? - AND notificationType = ?"; - $statement = WCF::getDB()->prepareStatement($sql); - foreach ($items as $item) { - $statement->execute(array( - $this->installation->getPackageID(), - $item['elements']['name'] - )); - } - } - - /** - * @see AbstractXMLPackageInstallationPlugin::prepareImport() - */ - protected function prepareImport(array $data) { - return array( - 'notificationType' => $data['elements']['name'], - 'className' => $data['elements']['classname'], - 'permissions' => (isset($data['elements']['permissions']) ? $data['elements']['permissions'] : ''), - 'options' => (isset($data['elements']['options']) ? $data['elements']['options'] : '') - ); - } - - /** - * @see AbstractXMLPackageInstallationPlugin::findExistingItem() - */ - protected function findExistingItem(array $data) { - $sql = "SELECT * - FROM wcf".WCF_N."_".$this->tableName." - WHERE packageID = ? - AND notificationType = ?"; - $parameters = array( - $this->installation->getPackageID(), - $data['notificationType'] - ); - - return array( - 'sql' => $sql, - 'parameters' => $parameters - ); - } -} diff --git a/com.woltlab.wcf.notification/files/lib/system/user/notification/UserNotificationHandler.class.php b/com.woltlab.wcf.notification/files/lib/system/user/notification/UserNotificationHandler.class.php deleted file mode 100644 index 12f990cdf2..0000000000 --- a/com.woltlab.wcf.notification/files/lib/system/user/notification/UserNotificationHandler.class.php +++ /dev/null @@ -1,85 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage system.user.notification - * @category Community Framework - */ -class UserNotificationHandler extends SingletonFactory { - /** - * list of available object types - * @var array - */ - protected $availableObjectTypes = array(); - - /** - * @see wcf\system\SingletonFactory::init() - */ - protected function init() { - // load cache - CacheHandler::getInstance()->addResource('user-notification-object-type-'.PACKAGE_ID, WCF_DIR.'cache/cache.user-notification-object-type-'.PACKAGE_ID.'.php', 'wcf\system\cache\CacheBuilderUserNotificationObjectType'); - $this->availableObjectTypes = CacheHandler::getInstance()->get('user-notification-object-type-'.PACKAGE_ID); - } - - /** - * Triggers a notification event. - * - * @param string $eventName - * @param string $objectType - * @param wcf\system\user\notification\object\IUserNotificationObject $notificationObject - * @param array $recipientIDs - * @param array $additionalData - */ - public function fireEvent($eventName, $objectType, IUserNotificationObject $notificationObject, array $recipientIDs, array $additionalData = array()) { - // check given object type and event name - if (!isset($this->availableObjectTypes[$objectType]['events'][$eventName])) { - throw new SystemException("Unknown event '.$objectType.'-.$eventName.' given"); - } - - // get objects - $objectType = $this->availableObjectTypes[$objectType]['object']; - $event = $this->availableObjectTypes[$objectType]['events'][$eventName]; - - // save notification - $action = new UserNotificationAction(array(), 'create', array('data' => array( - 'packageID' => PACKAGE_ID, - 'eventID' => $event->eventID, - 'objectID' => $notificationObject->getObjectID(), - 'time' => TIME_NOW, - 'shortOutput' => $event->getShortOutput($eventName), - 'mediumOutput' => $event->getMediumOutput($eventName), - 'longOutput' => $event->getOutput($eventName), - 'additionalData' => serialize($additionalData), - 'recipientIDs' => $recipientIDs - ))); - $result = $action->executeAction(); - $notification = $result['returnValues']; - - // get recipients - $recipientList = new UserNotificationRecipientList(); - $recipientList->getConditionBuilder()->add('user.userID = ?', array($recipientIDs)); - $recipientList->readObjects(); - - // sends notifications - foreach ($recipientList->getObjects() as $recipient) { - foreach ($recipient->getNotificationTypes($event->eventID) as $notificationType) { - if ($event->supportsNotificationType($notificationType)) { - $notificationType->send($notification, $recipient, $event); - } - } - } - } -} diff --git a/com.woltlab.wcf.notification/files/lib/system/user/notification/event/AbstractUserNotificationEvent.class.php b/com.woltlab.wcf.notification/files/lib/system/user/notification/event/AbstractUserNotificationEvent.class.php deleted file mode 100644 index e1a9430cd4..0000000000 --- a/com.woltlab.wcf.notification/files/lib/system/user/notification/event/AbstractUserNotificationEvent.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage system.user.notification.event - * @category Community Framework - */ -abstract class AbstractUserNotificationEvent extends DatabaseObjectDecorator implements IUserNotificationEvent { - /** - * @see wcf\data\DatabaseObjectDecorator::$baseClass - */ - protected static $baseClass = 'wcf\data\user\notification\event\UserNotificationEvent'; -} diff --git a/com.woltlab.wcf.notification/files/lib/system/user/notification/event/IUserNotificationEvent.class.php b/com.woltlab.wcf.notification/files/lib/system/user/notification/event/IUserNotificationEvent.class.php deleted file mode 100644 index 1ece06dc29..0000000000 --- a/com.woltlab.wcf.notification/files/lib/system/user/notification/event/IUserNotificationEvent.class.php +++ /dev/null @@ -1,67 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage system.user.notification.event - * @category Community Framework - */ -interface IUserNotificationEvent extends IDatabaseObjectProcessor { - /** - * Returns the message for this notification event. - * - * @param wcf\system\user\notification\type\IUserNotificationType $notificationType - * @return string - */ - public function getMessage(IUserNotificationType $notificationType); - - /** - * Returns the short output for this notification event. - * - * @return string - */ - public function getShortOutput(); - - /** - * Returns the medium output for this notification event. - * - * @return string - */ - public function getMediumOutput(); - - /** - * Returns the full output for this notification event. - * - * @return string - */ - public function getOutput(); - - /** - * Returns the human-readable title of this event. - * - * @return string - */ - public function getTitle(); - - /** - * Returns the human-readable description of this event. - * - * @return string - */ - public function getDescription(); - - /** - * Returns true if this event supports the given notification type. - * - * @param wcf\system\user\notification\type\IUserNotificationType $notificationType - * @return boolean - */ - public function supportsNotificationType(IUserNotificationType $notificationType); -} diff --git a/com.woltlab.wcf.notification/files/lib/system/user/notification/object/IUserNotificationObject.class.php b/com.woltlab.wcf.notification/files/lib/system/user/notification/object/IUserNotificationObject.class.php deleted file mode 100644 index c7be07a88c..0000000000 --- a/com.woltlab.wcf.notification/files/lib/system/user/notification/object/IUserNotificationObject.class.php +++ /dev/null @@ -1,36 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage system.user.notification.object - * @category Community Framework - */ -interface IUserNotificationObject extends IDatabaseObjectProcessor { - /** - * Returns the ID of this object. - * - * @return integer - */ - public function getObjectID(); - - /** - * Returns the title of this object. - * - * @return string - */ - public function getTitle(); - - /** - * Returns the url of this object. - * - * @return string - */ - public function getURL(); -} diff --git a/com.woltlab.wcf.notification/files/lib/system/user/notification/object/type/AbstractUserNotificationObjectType.class.php b/com.woltlab.wcf.notification/files/lib/system/user/notification/object/type/AbstractUserNotificationObjectType.class.php deleted file mode 100644 index ccbc07c07e..0000000000 --- a/com.woltlab.wcf.notification/files/lib/system/user/notification/object/type/AbstractUserNotificationObjectType.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage system.user.notification.event - * @category Community Framework - */ -abstract class AbstractUserNotificationObjectType extends DatabaseObjectDecorator implements IUserNotificationObjectType { - /** - * @see wcf\data\DatabaseObjectDecorator::$baseClass - */ - protected static $baseClass = 'wcf\data\user\notification\object\type\UserNotificationObjectType'; -} diff --git a/com.woltlab.wcf.notification/files/lib/system/user/notification/object/type/IUserNotificationObjectType.class.php b/com.woltlab.wcf.notification/files/lib/system/user/notification/object/type/IUserNotificationObjectType.class.php deleted file mode 100644 index e12a477d57..0000000000 --- a/com.woltlab.wcf.notification/files/lib/system/user/notification/object/type/IUserNotificationObjectType.class.php +++ /dev/null @@ -1,32 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage system.user.notification.object.type - * @category Community Framework - */ -interface IUserNotificationObjectType extends IDatabaseObjectProcessor { - /** - * Gets a notification object by its ID. - * - * @param integer $objectID - * @return wcf\system\user\notification\object\IUserNotificationObject - */ - public function getObjectByID($objectID); - - /** - * Gets notification objects by their IDs. - * - * @param array $objectIDs - * @return array - */ - public function getObjectsByIDs($objectIDs); - -} diff --git a/com.woltlab.wcf.notification/files/lib/system/user/notification/type/AbstractUserNotificationType.class.php b/com.woltlab.wcf.notification/files/lib/system/user/notification/type/AbstractUserNotificationType.class.php deleted file mode 100644 index f07c7d7c5f..0000000000 --- a/com.woltlab.wcf.notification/files/lib/system/user/notification/type/AbstractUserNotificationType.class.php +++ /dev/null @@ -1,20 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage system.user.notification.type - * @category Community Framework - */ -abstract class AbstractUserNotificationType extends DatabaseObjectDecorator implements IUserNotificationType { - /** - * @see wcf\data\DatabaseObjectDecorator::$baseClass - */ - protected static $baseClass = 'wcf\data\user\notification\type\UserNotificationType'; -} diff --git a/com.woltlab.wcf.notification/files/lib/system/user/notification/type/IUserNotificationType.class.php b/com.woltlab.wcf.notification/files/lib/system/user/notification/type/IUserNotificationType.class.php deleted file mode 100644 index d57bb2f793..0000000000 --- a/com.woltlab.wcf.notification/files/lib/system/user/notification/type/IUserNotificationType.class.php +++ /dev/null @@ -1,36 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage system.user.notification.type - * @category Community Framework - */ -interface IUserNotificationType extends IDatabaseObjectProcessor { - /** - * Sends the notification using this notification transport type. - * - * @param wcf\data\user\notification\UserNotification $notification - * @param wcf\data\user\notification\recipient\UserNotificationRecipient $user - * @param wcf\system\user\notification\event\IUserNotificationEvent $event - */ - public function send(UserNotification $notification, UserNotificationRecipient $user, IUserNotificationEvent $event); - - /** - * Tries to revoke the notification. This might not be applicable for all notification types. - * - * @param wcf\data\user\notification\UserNotification $notification - * @param wcf\data\user\notification\recipient\UserNotificationRecipient $user - * @param wcf\system\user\notification\event\IUserNotificationEvent $event - */ - public function revoke(UserNotification $notification, UserNotificationRecipient $user, IUserNotificationEvent $event); -} diff --git a/com.woltlab.wcf.notification/files/lib/system/user/notification/type/MailUserNotificationType.class.php b/com.woltlab.wcf.notification/files/lib/system/user/notification/type/MailUserNotificationType.class.php deleted file mode 100644 index b95eda3937..0000000000 --- a/com.woltlab.wcf.notification/files/lib/system/user/notification/type/MailUserNotificationType.class.php +++ /dev/null @@ -1,62 +0,0 @@ - - * @package com.woltlab.wcf.notification - * @subpackage system.user.notification.type - * @category Community Framework - */ -class MailUserNotificationType extends AbstractUserNotificationType { - /** - * @see wcf\system\user\notification\type\IUserNotificationType::send() - */ - public function send(UserNotification $notification, UserNotificationRecipient $user, IUserNotificationEvent $event) { - // get message - $message = $event->getMessage($this, array( - 'user' => $user, - 'pageURL' => FileUtil::addTrailingSlash(PAGE_URL) - )); - - // append notification mail footer - $token = $user->notificationMailToken; - if (!$token) { - // generate token if not present - $token = StringUtil::substring($token = StringUtil::getHash(serialize(array($user->userID, StringUtil::getRandomID()))), 0, 20); - $editor = new UserEditor($user->getDecoratedObject()); - $editor->updateUserOptions(array('notificationMailToken' => $token)); - } - $message .= "\n".$user->getLanguage()->getDynamicVariable('wcf.user.notification.type.mail.footer', array( - 'user' => $user, - 'pageURL' => FileUtil::addTrailingSlash(PAGE_URL), - 'token' => $token, - 'notification' => $notification - )); - - // use short output as mail subject and strip its HTML - $shortMessage = StringUtil::stripHTML($notification->shortOutput); - - // build mail - $mail = new Mail(array($user->username => $user->email), $user->getLanguage()->getDynamicVariable('wcf.user.notification.type.mail.subject', array('title' => $shortMessage)), $message); - $mail->send(); - } - - /** - * @see wcf\system\user\notification\type\IUserNotificationType::revoke() - */ - public function revoke(UserNotification $notification, UserNotificationRecipient $user, IUserNotificationEvent $event) { - // unsupported - return; - } -} diff --git a/com.woltlab.wcf.notification/install.sql b/com.woltlab.wcf.notification/install.sql deleted file mode 100644 index 367c463da1..0000000000 --- a/com.woltlab.wcf.notification/install.sql +++ /dev/null @@ -1,92 +0,0 @@ --- notifications -DROP TABLE IF EXISTS wcf1_user_notification; -CREATE TABLE wcf1_user_notification ( - notificationID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, - packageID INT(10) NOT NULL, - eventID INT(10) NOT NULL, - objectID INT(10) NOT NULL DEFAULT 0, - time INT(10) NOT NULL DEFAULT 0, - shortOutput VARCHAR(255) DEFAULT NULL, - mediumOutput TEXT, - longOutput TEXT, - additionalData TEXT -); - --- notification recipients -DROP TABLE IF EXISTS wcf1_user_notification_to_user; -CREATE TABLE wcf1_user_notification_to_user ( - notificationID INT(10) NOT NULL, - userID INT(10) NOT NULL, - confirmed TINYINT(1) NOT NULL DEFAULT 0, - confirmationTime INT(10) NOT NULL DEFAULT 0, - UNIQUE KEY notificationID (notificationID, userID) -); - --- events that create notifications -DROP TABLE IF EXISTS wcf1_user_notification_event; -CREATE TABLE wcf1_user_notification_event ( - eventID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, - packageID INT(10) NOT NULL, - eventName VARCHAR(255) NOT NULL DEFAULT '', - objectTypeID INT(10) NOT NULL, - className VARCHAR(255) NOT NULL DEFAULT '', - languageCategory VARCHAR(255) NOT NULL, - defaultNotificationTypeID INT(10) NULL, - requiresConfirmation TINYINT(1) NOT NULL DEFAULT 0, - acceptURL VARCHAR(255) NOT NULL DEFAULT '', - declineURL VARCHAR(255) NOT NULL DEFAULT '', - permissions TEXT, - options TEXT, - UNIQUE KEY packageID (packageID, eventName) -); - --- user configuration for events -DROP TABLE IF EXISTS wcf1_user_notification_event_to_user; -CREATE TABLE wcf1_user_notification_event_to_user ( - userID INT(10) NOT NULL, - eventID INT(10) NOT NULL, - notificationTypeID INT(10) NOT NULL, - enabled TINYINT(1) NOT NULL DEFAULT 0 -); - --- objects that create notifications -DROP TABLE IF EXISTS wcf1_user_notification_object_type; -CREATE TABLE wcf1_user_notification_object_type ( - objectTypeID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, - packageID INT(10) NOT NULL, - objectType VARCHAR(255) NOT NULL, - className VARCHAR(255) NOT NULL, - permissions TEXT, - options TEXT, - UNIQUE KEY packageID (packageID, objectType) -); - --- notification types (pm, mail, ...) -DROP TABLE IF EXISTS wcf1_user_notification_type; -CREATE TABLE wcf1_user_notification_type ( - notificationTypeID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY, - packageID INT(10) NOT NULL, - notificationType VARCHAR(255) NOT NULL, - className VARCHAR(255) NOT NULL, - permissions TEXT, - options TEXT, - UNIQUE KEY packageID (packageID, notificationType) -); - -ALTER TABLE wcf1_user_notification ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE; -ALTER TABLE wcf1_user_notification ADD FOREIGN KEY (eventID) REFERENCES wcf1_user_notification_event (eventID) ON DELETE CASCADE; - -ALTER TABLE wcf1_user_notification_to_user ADD FOREIGN KEY (notificationID) REFERENCES wcf1_user_notification (notificationID) ON DELETE CASCADE; -ALTER TABLE wcf1_user_notification_to_user ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE CASCADE; - -ALTER TABLE wcf1_user_notification_event ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE; -ALTER TABLE wcf1_user_notification_event ADD FOREIGN KEY (objectTypeID) REFERENCES wcf1_user_notification_object_type (objectTypeID) ON DELETE CASCADE; -ALTER TABLE wcf1_user_notification_event ADD FOREIGN KEY (defaultNotificationTypeID) REFERENCES wcf1_user_notification_type (notificationTypeID) ON DELETE SET NULL; - -ALTER TABLE wcf1_user_notification_event_to_user ADD FOREIGN KEY (userID) REFERENCES wcf1_user (userID) ON DELETE CASCADE; -ALTER TABLE wcf1_user_notification_event_to_user ADD FOREIGN KEY (eventID) REFERENCES wcf1_user_notification_event (eventID) ON DELETE CASCADE; -ALTER TABLE wcf1_user_notification_event_to_user ADD FOREIGN KEY (notificationTypeID) REFERENCES wcf1_user_notification_type (notificationTypeID) ON DELETE CASCADE; - -ALTER TABLE wcf1_user_notification_object_type ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE; - -ALTER TABLE wcf1_user_notification_type ADD FOREIGN KEY (packageID) REFERENCES wcf1_package (packageID) ON DELETE CASCADE; \ No newline at end of file diff --git a/com.woltlab.wcf.notification/package.xml b/com.woltlab.wcf.notification/package.xml deleted file mode 100644 index 3c19547ab8..0000000000 --- a/com.woltlab.wcf.notification/package.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - User Notification System - Provides functions to deliver notification messages - 1.0.0 Alpha 1 - 2010-08-22 - 1 - - - - WoltLab GmbH, Oliver Kliebisch and Tim Düsterhus - http://www.woltlab.com - - - - com.woltlab.wcf - - - - pip.xml - files.tar - install.sql - userNotificationType.xml - coreobject.xml - - \ No newline at end of file diff --git a/com.woltlab.wcf.notification/pip.xml b/com.woltlab.wcf.notification/pip.xml deleted file mode 100644 index 5cf8227c15..0000000000 --- a/com.woltlab.wcf.notification/pip.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - wcf\system\package\plugin\UserNotificationEventPackageInstallationPlugin - wcf\system\package\plugin\UserNotificationObjectTypePackageInstallationPlugin - wcf\system\package\plugin\UserNotificationTypePackageInstallationPlugin - - diff --git a/com.woltlab.wcf.notification/userNotificationType.xml b/com.woltlab.wcf.notification/userNotificationType.xml deleted file mode 100644 index 86ff008301..0000000000 --- a/com.woltlab.wcf.notification/userNotificationType.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - mail - wcf\system\user\notification\type\MailUserNotificationType - - - \ No newline at end of file -- 2.20.1