mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
move creating notification service into extra file
This commit is contained in:
parent
d61f7f0b2a
commit
12ae492f54
|
@ -95,28 +95,7 @@ if($settings->_useHomeAsRootFolder && !$user->isAdmin() && $user->getHomeFolder(
|
|||
$dms->setRootFolderID($user->getHomeFolder());
|
||||
}
|
||||
|
||||
global $logger;
|
||||
$notifier = new SeedDMS_NotificationService($logger);
|
||||
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['notification'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['notification'] as $notificationObj) {
|
||||
if(method_exists($notificationObj, 'preAddService')) {
|
||||
$notificationObj->preAddService($dms, $notifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($settings->_enableEmail) {
|
||||
$notifier->addService(new SeedDMS_EmailNotify($dms, $settings->_smtpSendFrom, $settings->_smtpServer, $settings->_smtpPort, $settings->_smtpUser, $settings->_smtpPassword), 'email');
|
||||
}
|
||||
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['notification'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['notification'] as $notificationObj) {
|
||||
if(method_exists($notificationObj, 'postAddService')) {
|
||||
$notificationObj->postAddService($dms, $notifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
require_once('inc/inc.Notification.php');
|
||||
|
||||
/* Include additional language file for view
|
||||
* This file must set $LANG[xx][]
|
||||
|
|
36
inc/inc.Notification.php
Normal file
36
inc/inc.Notification.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
/**
|
||||
* Create notifcation service
|
||||
*
|
||||
* @category DMS
|
||||
* @package SeedDMS
|
||||
* @license GPL 2
|
||||
* @version @version@
|
||||
* @author Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx>
|
||||
* @copyright Copyright (C) 2002-2005 Markus Westphal,
|
||||
* 2006-2008 Malcolm Cowe, 2010 Uwe Steinmann
|
||||
* @version Release: @package_version@
|
||||
*/
|
||||
|
||||
global $logger;
|
||||
$notifier = new SeedDMS_NotificationService($logger);
|
||||
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['notification'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['notification'] as $notificationObj) {
|
||||
if(method_exists($notificationObj, 'preAddService')) {
|
||||
$notificationObj->preAddService($dms, $notifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($settings->_enableEmail) {
|
||||
$notifier->addService(new SeedDMS_EmailNotify($dms, $settings->_smtpSendFrom, $settings->_smtpServer, $settings->_smtpPort, $settings->_smtpUser, $settings->_smtpPassword), 'email');
|
||||
}
|
||||
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['notification'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['notification'] as $notificationObj) {
|
||||
if(method_exists($notificationObj, 'postAddService')) {
|
||||
$notificationObj->postAddService($dms, $notifier);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user