ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (Container $dic)
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 
- 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
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
Container $dic
 

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.

References getId().

37  : array
38  {
39  return [$this->getId()];
40  }
+ Here is the call graph for this function:

◆ getId()

ilAwarenessMetaBarProvider::getId ( )
private

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

Referenced by getAllIdentifications(), and getMetaBarItems().

33  {
34  return $this->if->identifier('awareness');
35  }
+ 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.

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

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(),
59  $ref_id
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($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  }
Class Factory.
$c
Definition: cli.php:38
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ref_id
Definition: ltiauth.php:67
$ilUser
Definition: imgupload.php:34
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

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