ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ()
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\Notification\Provider\AbstractNotificationProvider
 __construct (Container $dic)
 
 getAdministrativeNotifications ()
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (protected Container $dic)
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 

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 ( )

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

Definition at line 35 of file BTNotificationProvider.php.

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

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("assets/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  }
if(!file_exists('../ilias.ini.php'))
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ 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.

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

64  : string
65  {
66  return $this->dic->language()->txt($id);
67  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the caller graph for this function:

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