1 <?php declare(strict_types=1);
21 $lng = $this->dic->language();
22 $ui = $this->dic->ui();
23 $user = $this->dic->user();
24 $ctrl = $this->dic->ctrl();
26 $lng->loadLanguageModule(
"badge");
30 return $this->
if->identifier($id);
34 if ($new_badges == 0) {
39 $badge_icon = $this->dic->ui()->factory()->symbol()->icon()->standard(
"bdga",
$lng->txt(
"badge_badge"))->withIsOutlined(
true);
40 $badge_title = $ui->factory()->link()->standard(
41 $lng->txt(
"mm_badges"),
42 $ctrl->getLinkTargetByClass([
"ilDashboardGUI"],
"jumpToBadges")
45 $badge_notification_item = $ui->factory()->item()->notification($badge_title, $badge_icon)
46 ->withDescription(str_replace(
"%1", $new_badges,
$lng->txt(
"badge_new_badges")))
49 $group =
$factory->standardGroup($id(
'badge_bucket_group'))->withTitle(
$lng->txt(
'badge_badge'))
51 $factory->standard($id(
'badge_bucket'))->withNotificationItem($badge_notification_item)
53 function () use ($user) {
55 $noti_repo = new \ILIAS\Badge\Notification\BadgeNotificationPrefRepository($user);
56 $noti_repo->updateLastCheckedTimestamp();
59 ->withNewAmount($new_badges)
61 ->withOpenedCallable(
function () {
Interface AbstractNotificationProvider.
static getNewCounter(int $a_user_id)
Get new counter.
Interface IdentificationInterface.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
Class BadgeNotificationProvider.
Interface NotificationProvider.
static getLatestTimestamp(int $a_user_id)
Get latest badge.