ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ILIAS\GlobalScreen\ADNProvider Class Reference

Class ADNProvider. More...

+ Inheritance diagram for ILIAS\GlobalScreen\ADNProvider:
+ Collaboration diagram for ILIAS\GlobalScreen\ADNProvider:

Public Member Functions

 __construct (Container $dic)
 
 getNotifications ()
 

Protected Member Functions

 getSummary (ilADNNotification|\ActiveRecord $item)
 

Protected Attributes

MarkdownFormattingToHTML $markdown
 
BasicAccessCheckClosures $access
 

Private Member Functions

 handleDenotation (ilADNNotification $item, AdministrativeNotification $adn)
 
 combineClosure (Closure $closure, ?Closure $additional=null)
 

Detailed Description

Class ADNProvider.

Definition at line 36 of file ADNProvider.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\GlobalScreen\ADNProvider::__construct ( Container  $dic)

Definition at line 41 of file ADNProvider.php.

References ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\Repository\access().

42  {
44  $this->access = BasicAccessCheckClosuresSingleton::getInstance();
45  $this->markdown = $dic->refinery()->string()->markdown();
46  }
__construct(Container $dic, ilPlugin $plugin)
$dic
Definition: result.php:31
+ Here is the call graph for this function:

Member Function Documentation

◆ combineClosure()

ILIAS\GlobalScreen\ADNProvider::combineClosure ( Closure  $closure,
?Closure  $additional = null 
)
private

Definition at line 124 of file ADNProvider.php.

Referenced by ILIAS\GlobalScreen\ADNProvider\getNotifications().

124  : Closure
125  {
126  if ($additional instanceof Closure) {
127  return static fn(): bool => $additional() && $closure();
128  }
129 
130  return $closure;
131  }
+ Here is the caller graph for this function:

◆ getNotifications()

ILIAS\GlobalScreen\ADNProvider::getNotifications ( )

◆ getSummary()

ILIAS\GlobalScreen\ADNProvider::getSummary ( ilADNNotification|\ActiveRecord  $item)
protected

Definition at line 48 of file ADNProvider.php.

Referenced by ILIAS\GlobalScreen\ADNProvider\getNotifications().

48  : string
49  {
50  return $this->markdown->toHTML()->transform(
51  $item->getBody()
52  );
53  }
+ Here is the caller graph for this function:

◆ handleDenotation()

ILIAS\GlobalScreen\ADNProvider::handleDenotation ( ilADNNotification  $item,
AdministrativeNotification  $adn 
)
private

Definition at line 107 of file ADNProvider.php.

References ilADNNotification\getType(), ilADNNotification\getTypeDuringEvent(), ilADNNotification\isDuringEvent(), ilADNNotification\isPermanent(), ilADNNotification\TYPE_ERROR, and ilADNNotification\TYPE_WARNING.

Referenced by ILIAS\GlobalScreen\ADNProvider\getNotifications().

110  : AdministrativeNotification {
111  $settype = (static fn(int $type, AdministrativeNotification $adn): AdministrativeNotification => match ($type) {
112  ilADNNotification::TYPE_ERROR => $adn->withBreakingDenotation(),
113  ilADNNotification::TYPE_WARNING => $adn->withImportantDenotation(),
114  default => $adn->withNeutralDenotation(),
115  });
116 
117  // denotation during event
118  if (!$item->isPermanent() && $item->isDuringEvent()) {
119  return $settype($item->getTypeDuringEvent(), $adn);
120  }
121  return $settype($item->getType(), $adn);
122  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

BasicAccessCheckClosures ILIAS\GlobalScreen\ADNProvider::$access
protected

Definition at line 39 of file ADNProvider.php.

◆ $markdown

MarkdownFormattingToHTML ILIAS\GlobalScreen\ADNProvider::$markdown
protected

Definition at line 38 of file ADNProvider.php.


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