Conflicts: main/inc/lib/hook/HookEvent.class.php1.10.x
parent
bedb3b01e9
commit
dd2fc3f2d8
@ -0,0 +1,42 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
/** |
||||
* This file contains the Hook Event class for Content of Notifications |
||||
*/ |
||||
|
||||
/** |
||||
* Class HookNotificationContent |
||||
*/ |
||||
class HookNotificationContent extends HookEvent implements HookNotificationContentEventInterface |
||||
{ |
||||
|
||||
/** |
||||
* Construct |
||||
*/ |
||||
protected function __construct() |
||||
{ |
||||
parent::__construct('HookNotificationContent'); |
||||
} |
||||
|
||||
/** |
||||
* @param int $type |
||||
* @return int |
||||
*/ |
||||
public function notifyNotificationContent($type) |
||||
{ |
||||
/** @var \HookNotificationContentObserverInterface $observer */ |
||||
if (isset($this->eventData['content'])) { |
||||
$this->eventData['type'] = $type; |
||||
foreach ($this->observers as $observer) { |
||||
$data = $observer->hookNotificationContent($this); |
||||
if (isset($data['content'])) { |
||||
$this->setEventData($data); |
||||
} |
||||
} |
||||
|
||||
return $this->eventData; |
||||
} |
||||
|
||||
return null; |
||||
} |
||||
} |
@ -0,0 +1,42 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
/** |
||||
* This file contains the Hook Event class for Title of Notifications |
||||
*/ |
||||
|
||||
/** |
||||
* Class HookNotificationTitle |
||||
*/ |
||||
class HookNotificationTitle extends HookEvent implements HookNotificationTitleEventInterface |
||||
{ |
||||
|
||||
/** |
||||
* Construct |
||||
*/ |
||||
protected function __construct() |
||||
{ |
||||
parent::__construct('HookNotificationTitle'); |
||||
} |
||||
|
||||
/** |
||||
* @param int $type |
||||
* @return int |
||||
*/ |
||||
public function notifyNotificationTitle($type) |
||||
{ |
||||
/** @var \HookNotificationTitleObserverInterface $observer */ |
||||
if (isset($this->eventData['title'])) { |
||||
$this->eventData['type'] = $type; |
||||
foreach ($this->observers as $observer) { |
||||
$data = $observer->hookNotificationTitle($this); |
||||
if (isset($data['title'])) { |
||||
$this->setEventData($data); |
||||
} |
||||
} |
||||
|
||||
return $this->eventData; |
||||
} |
||||
|
||||
return null; |
||||
} |
||||
} |
@ -0,0 +1,14 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
/** |
||||
* Interface HookNotificationContentEventInterface |
||||
*/ |
||||
interface HookNotificationContentEventInterface extends HookEventInterface |
||||
{ |
||||
/** |
||||
* @param int $type |
||||
* @return int |
||||
*/ |
||||
public function notifyNotificationContent($type); |
||||
} |
@ -0,0 +1,14 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
/** |
||||
* Interface HookNotificationContentObserverInterface |
||||
*/ |
||||
interface HookNotificationContentObserverInterface extends HookObserverInterface |
||||
{ |
||||
/** |
||||
* @param HookNotificationContentEventInterface $hook |
||||
* @return int |
||||
*/ |
||||
public function hookNotificationContent(HookNotificationContentEventInterface $hook); |
||||
} |
@ -0,0 +1,14 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
/** |
||||
* Interface HookNotificationTitleEventInterface |
||||
*/ |
||||
interface HookNotificationTitleEventInterface extends HookEventInterface |
||||
{ |
||||
/** |
||||
* @param int $type |
||||
* @return int |
||||
*/ |
||||
public function notifyNotificationTitle($type); |
||||
} |
@ -0,0 +1,14 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
/** |
||||
* Interface HookNotificationTitleObserverInterface |
||||
*/ |
||||
interface HookNotificationTitleObserverInterface extends HookObserverInterface |
||||
{ |
||||
/** |
||||
* @param HookNotificationTitleEventInterface $hook |
||||
* @return int |
||||
*/ |
||||
public function hookNotificationTitle(HookNotificationTitleEventInterface $hook); |
||||
} |
Loading…
Reference in new issue