ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilAwarenessMetaBarProvider Class Reference

Who-Is-Online meta bar provider. More...

+ Inheritance diagram for ilAwarenessMetaBarProvider:
+ Collaboration diagram for ilAwarenessMetaBarProvider:

Public Member Functions

 getAllIdentifications ()
 
 getMetaBarItems ()
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\MetaBar\Provider\AbstractStaticMetaBarProvider
 __construct (Container $dic)
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (protected Container $dic)
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 
 getMetaBarItems ()
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\MetaBar\Provider\MetaBarProviderInterface
 getProviderNameForPresentation ()
 

Private Member Functions

 getId ()
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 globalScreen ()
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Scope\MetaBar\Provider\AbstractStaticMetaBarProvider
Container $dic
 
IdentificationProviderInterface $if
 
MetaBarItemFactory $meta_bar
 

Detailed Description

Who-Is-Online meta bar provider.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 30 of file class.ilAwarenessMetaBarProvider.php.

Member Function Documentation

◆ getAllIdentifications()

ilAwarenessMetaBarProvider::getAllIdentifications ( )

Definition at line 37 of file class.ilAwarenessMetaBarProvider.php.

37 : array
38 {
39 return [$this->getId()];
40 }

References getId().

+ Here is the call graph for this function:

◆ getId()

ilAwarenessMetaBarProvider::getId ( )
private

Definition at line 32 of file class.ilAwarenessMetaBarProvider.php.

33 {
34 return $this->if->identifier('awareness');
35 }

Referenced by getAllIdentifications(), and getMetaBarItems().

+ Here is the caller graph for this function:

◆ getMetaBarItems()

ilAwarenessMetaBarProvider::getMetaBarItems ( )
Returns
isItem[]

Implements ILIAS\GlobalScreen\Scope\MetaBar\Provider\StaticMetaBarProvider.

Definition at line 42 of file class.ilAwarenessMetaBarProvider.php.

42 : array
43 {
44 $ilUser = $this->dic->user();
45 $ref_id = $this->dic->awareness()
46 ->internal()
47 ->gui()
48 ->standardRequest()
49 ->getRefId();
50 $gui = $this->dic->awareness()
51 ->internal()
52 ->gui()
53 ->widget();
54 $manager = $this->dic->awareness()
55 ->internal()
56 ->domain()
57 ->widget(
58 $ilUser->getId(),
60 );
61
62 $is_widget_visible = $manager->isWidgetVisible();
63
64 if (!$is_widget_visible) {
65 return [];
66 }
67
68 $counter = $manager->processMetaBar();
69
70 $result = $gui->getAwarenessList(true);
71 $online = explode(":", $result["cnt"]);
72 $online = (int) $online[0];
73 $content = $this->dic->ui()->factory()->legacy()->content($result["html"]);
74 if ($online === 0) {
75 $is_widget_visible = false;
76 }
77
78 $mb = $this->globalScreen()->metaBar();
79
80 $f = $this->dic->ui()->factory();
81
82 $item = $mb
83 ->topLegacyItem($this->getId())
84 ->addComponentDecorator(static function (ILIAS\UI\Component\Component $c): ILIAS\UI\Component\Component {
85 if ($c instanceof BulkyButton || $c instanceof BulkyLink) {
86 return $c->withAdditionalOnLoadCode(static function (string $id): string {
87 return "$('#$id').on('click', function() {
88 console.log('trigger awareness slate');
89 })";
90 });
91 }
92 return $c;
93 })
94 ->withLegacyContent($content)
95 ->withSymbol(
96 $this->dic->ui()->factory()
97 ->symbol()
98 ->glyph()
99 ->user()
100 ->withCounter($f->counter()->status($counter->getCount()))
101 ->withCounter($f->counter()->novelty($counter->getHighlightCount()))
102 )
103 ->withTitle($this->dic->language()->txt("awra"))
104 ->withPosition(2)
105 ->withAvailableCallable(
106 function () use ($is_widget_visible) {
107 return $is_widget_visible;
108 }
109 );
110
111 return [$item];
112 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$c
Definition: deliver.php:25
$ref_id
Definition: ltiauth.php:66
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
$counter

References $c, $counter, Vendor\Package\$f, $id, $ref_id, getId(), ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen(), and ILIAS\Repository\int().

+ Here is the call graph for this function:

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