ILIAS  release_8 Revision v8.24
ILIAS\BackgroundTasks\Provider\BTNotificationProvider Class Reference

Class BTNotificationProvider. More...

+ Inheritance diagram for ILIAS\BackgroundTasks\Provider\BTNotificationProvider:
+ Collaboration diagram for ILIAS\BackgroundTasks\Provider\BTNotificationProvider:

Public Member Functions

 getNotifications ()
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\Notification\Provider\AbstractNotificationProvider
 __construct (Container $dic)
 @inheritDoc More...
 
 getAdministrativeNotifications ()
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (Container $dic)
 @inheritDoc More...
 
 getFullyQualifiedClassName ()
 @inheritDoc More...
 
 getProviderNameForPresentation ()
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 
 getNotifications ()
 
 getAdministrativeNotifications ()
 

Private Member Functions

 txt (string $id)
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 globalScreen ()
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Scope\Notification\Provider\AbstractNotificationProvider
Container $dic
 
IdentificationProviderInterface $if
 
NotificationFactory $notification_factory
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
Container $dic
 

Detailed Description

Member Function Documentation

◆ getNotifications()

ILIAS\BackgroundTasks\Provider\BTNotificationProvider::getNotifications ( )

@inheritDoc

Implements ILIAS\GlobalScreen\Scope\Notification\Provider\NotificationProvider.

Definition at line 35 of file BTNotificationProvider.php.

35 : array
36 {
37 $nr_buckets = count($this->dic->backgroundTasks()->persistence()->getBucketIdsOfUser($this->dic->user()->getId()));
38 if ($nr_buckets === 0) {
39 return [];
40 }
41
42 $this->dic->ui()->mainTemplate()->addJavaScript("./Services/BackgroundTasks/js/background_task_refresh.js");
43 $this->dic->language()->loadLanguageModule('background_tasks');
44
45 $id = fn (string $id): IdentificationInterface => $this->if->identifier($id);
46
47 $factory = $this->globalScreen()->notifications()->factory();
48
49 $item_source = new ilBTPopOverGUI($this->dic);
50 $group = $factory->standardGroup($id('bg_task_bucket_group'))
51 ->withTitle($this->txt('background_tasks'))
52 ->addNotification(
53 $factory->standard($id('bg_task_bucket'))
54 ->withNotificationItem($item_source->getNotificationItem($nr_buckets))
55 ->withNewAmount(1)
56 );
57
58 return [
59 $group,
60 ];
61 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
Class ilBTPopOverGUI.
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: confirmReg.php:20
$factory
Definition: metadata.php:75

References $factory, $id, ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen(), and ILIAS\BackgroundTasks\Provider\BTNotificationProvider\txt().

+ Here is the call graph for this function:

◆ txt()

ILIAS\BackgroundTasks\Provider\BTNotificationProvider::txt ( string  $id)
private

Definition at line 64 of file BTNotificationProvider.php.

64 : string
65 {
66 return $this->dic->language()->txt($id);
67 }

References $id.

Referenced by ILIAS\BackgroundTasks\Provider\BTNotificationProvider\getNotifications().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: