ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
PresentationHeader.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Badge;
22
25
27{
28 public function __construct(
29 private readonly Container $container,
30 private readonly string $gui
31 ) {
32 }
33
34 public function show(string $active, ?Component $add = null): void
35 {
36 $txt = [$this->container->language(), 'txt'];
37 $toolbar = $this->container->toolbar();
38 $view_control = $this->container->ui()->factory()->viewControl()->mode([
39 $txt('tile_view') => $this->container->ctrl()->getLinkTargetByClass($this->gui, 'listBadges'),
40 $txt('table_view') => $this->container->ctrl()->getLinkTargetByClass($this->gui, 'manageBadges'),
41 ], 'View')->withActive($active);
42
43 $toolbar->addStickyItem($view_control);
44 if ($add) {
45 $toolbar->addStickyItem($add);
46 }
47 }
48}
show(string $active, ?Component $add=null)
__construct(private readonly Container $container, private readonly string $gui)
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
$txt
Definition: error.php:31
A component is the most general form of an entity in the UI.
Definition: Component.php:28
$container
@noRector
Definition: wac.php:37