19 declare(strict_types=1);
35 $lng = $this->dic->language();
36 $ui = $this->dic->ui();
37 $user = $this->dic->user();
38 $ctrl = $this->dic->ctrl();
40 $lng->loadLanguageModule(
"badge");
44 return $this->
if->identifier(
$id);
48 if ($new_badges === 0) {
53 $badge_icon = $this->dic->ui()->factory()->symbol()->icon()->standard(
"bdga",
$lng->txt(
"badge_badge"));
54 $badge_title = $ui->factory()->link()->standard(
55 $lng->txt(
"mm_badges"),
56 $ctrl->getLinkTargetByClass([
"ilDashboardGUI"],
"jumpToBadges")
60 $badge_notification_item = $ui->factory()->item()->notification($badge_title, $badge_icon)
61 ->withDescription(str_replace(
"%1", (
string) $new_badges,
$lng->txt(
"badge_new_badges")))
66 $group =
$factory->standardGroup(
$id(
'badge_bucket_group'))->withTitle(
$lng->txt(
'badge_badge'))
68 $factory->standard(
$id(
'badge_bucket'))->withNotificationItem($badge_notification_item)
70 function () use ($user, $osd_notification_handler):
void {
72 $noti_repo = new \ILIAS\Badge\Notification\BadgeNotificationPrefRepository($user);
73 $noti_repo->updateLastCheckedTimestamp();
75 $osd_notification_handler->deleteStaleNotificationsForUserAndType(
76 $this->dic->user()->getId(),
77 self::NOTIFICATION_TYPE
81 ->withNewAmount($new_badges)
83 ->withOpenedCallable(
static function () {
Interface AbstractNotificationProvider.
static getNewCounter(int $a_user_id)
Interface IdentificationInterface.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static getLatestTimestamp(int $a_user_id)