ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 (protected Container $dic)
 
 getFullyQualifiedClassName ()
 
 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
 

Detailed Description

Member Function Documentation

◆ getNotifications()

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

@inheritDoc

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

Definition at line 36 of file BTNotificationProvider.php.

36 : array
37 {
38 $nr_buckets = count($this->dic->backgroundTasks()->persistence()->getBucketIdsOfUser($this->dic->user()->getId()));
39 if ($nr_buckets === 0) {
40 return [];
41 }
42
43 $this->dic->ui()->mainTemplate()->addJavaScript("assets/js/background_task_refresh.js");
44 $this->dic->language()->loadLanguageModule('background_tasks');
45
46 $id = fn(string $id): IdentificationInterface => $this->if->identifier($id);
47
48 $factory = $this->globalScreen()->notifications()->factory();
49
50 $item_source = new ilBTPopOverGUI($this->dic);
51 $group = $factory->standardGroup($id('bg_task_bucket_group'))
52 ->withTitle($this->txt('background_tasks'))
53 ->addNotification(
54 $factory->standard($id('bg_task_bucket'))
55 ->withNotificationItem($item_source->getNotificationItem($nr_buckets))
56 ->withNewAmount(1)
57 );
58
59 return [
60 $group,
61 ];
62 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
Class ilBTPopOverGUI.
if(!file_exists('../ilias.ini.php'))

References $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 65 of file BTNotificationProvider.php.

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

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: