Definition at line 25 of file NotificationManager.php.
◆ __construct()
ILIAS\UI\Component\MainControls\Slate\Notification\NotificationManager::__construct |
( |
protected InternalDomainService |
$domain | ) |
|
◆ getBlogObjectId()
ILIAS\UI\Component\MainControls\Slate\Notification\NotificationManager::getBlogObjectId |
( |
bool |
$in_wsp, |
|
|
int |
$blog_node_id |
|
) |
| |
|
protected |
◆ sendNotification()
ILIAS\UI\Component\MainControls\Slate\Notification\NotificationManager::sendNotification |
( |
string |
$action, |
|
|
bool |
$in_wsp, |
|
|
int |
$blog_node_id, |
|
|
int |
$posting_id, |
|
|
?string |
$comment = null |
|
) |
| |
Definition at line 35 of file NotificationManager.php.
References $comment, ILIAS\UI\Component\MainControls\Slate\Notification\NotificationManager\getBlogObjectId(), ilNotification\getNotificationsForObject(), ILIAS\UI\Component\MainControls\Slate\Notification\NotificationManager\sendSystemNotification(), ilNotification\TYPE_BLOG, and ilNotification\updateNotificationTime().
47 $posting = new \ilBlogPosting($posting_id);
49 $ignore_threshold = ($action ===
"comment");
52 if (!$posting->isApproved()) {
53 $blog_settings = $this->domain->blogSettings()->getByObjId($blog_obj_id);
54 if ($blog_settings?->getApproval()) {
61 $ignore_threshold =
true;
68 if (!$in_wsp && in_array($action, array(
"update",
"new"))) {
69 $this->domain->news()->handle($posting, ($action ===
"update"));
getBlogObjectId(bool $in_wsp, int $blog_node_id)
static getNotificationsForObject(int $type, int $id, ?int $page_id=null, bool $ignore_threshold=false)
Get all users/recipients for given object.
static updateNotificationTime(int $type, int $id, array $user_ids, ?int $page_id=null, bool $activate_new_entries=true)
Update the last mail timestamp for given object and users.
sendSystemNotification(bool $in_wsp, int $blog_node_id, string $action, \ilBlogPosting $posting, ?string $comment, array $users, bool $admin_only)
◆ sendSystemNotification()
ILIAS\UI\Component\MainControls\Slate\Notification\NotificationManager::sendSystemNotification |
( |
bool |
$in_wsp, |
|
|
int |
$blog_node_id, |
|
|
string |
$action, |
|
|
\ilBlogPosting |
$posting, |
|
|
?string |
$comment, |
|
|
array |
$users, |
|
|
bool |
$admin_only |
|
) |
| |
|
protected |
Definition at line 112 of file NotificationManager.php.
References ilBlogPosting\getBlogId(), ilPageObject\getId(), ilBlogPosting\getNotificationAbstract(), ilBlogPosting\getTitle(), ilNotification\TYPE_BLOG, and ilNotification\updateNotificationTime().
Referenced by ILIAS\UI\Component\MainControls\Slate\Notification\NotificationManager\sendNotification().
121 $ntf = new \ilSystemNotification($in_wsp);
122 $ntf->setLangModules(array(
"blog"));
123 $ntf->setRefId($blog_node_id);
124 $ntf->setChangedByUserId($this->current_user_id);
125 $ntf->setSubjectLangId(
'blog_change_notification_subject');
126 $ntf->setIntroductionLangId(
'blog_change_notification_body_' . $action);
127 $ntf->addAdditionalInfo(
'blog_posting', $posting->getTitle());
130 $ntf->addAdditionalInfo(
'comment',
$comment,
true);
133 $ntf->setGotoLangId(
'blog_change_notification_link');
134 $ntf->setReasonLangId(
'blog_change_notification_reason');
136 $abstract = $posting->getNotificationAbstract();
138 $ntf->addAdditionalInfo(
'content', $abstract,
true);
141 $notified = $ntf->sendMailAndReturnRecipients(
143 "_" . $posting->getId(),
144 ($admin_only ?
"write" :
"read")
147 if (count($notified)) {
150 $posting->getBlogId(),
static updateNotificationTime(int $type, int $id, array $user_ids, ?int $page_id=null, bool $activate_new_entries=true)
Update the last mail timestamp for given object and users.
◆ $current_user_id
int ILIAS\UI\Component\MainControls\Slate\Notification\NotificationManager::$current_user_id |
|
protected |
The documentation for this class was generated from the following file: