19declare(strict_types=1);
41 $this->
ctrl->clearParameterByClass($target_class,
'tableview_id');
44 foreach ($tables as $table) {
45 $title = $table->getTitle();
46 if ($table->getId() == $table_id) {
49 $title = ($current === $title ?
'✓ ' :
'⠀ ') . $title;
50 $this->
ctrl->setParameterByClass($target_class,
'table_id', $table->getId());
51 $links[] = $this->ui_factory->link()->standard($title, $this->
ctrl->getLinkTargetByClass($target_class, $target_cmd));
53 $this->
ctrl->clearParameterByClass($target_class,
'table_id');
61 public function addViewSwitcherToToolbar(array $views,
int $table_id,
string $target_class,
string $target_cmd,
int $tableview_id = 0): void
63 $this->
ctrl->setParameterByClass($target_class,
'table_id', $table_id);
66 foreach ($views as $view) {
67 $title = $view->getTitle();
68 if ($view->getId() == $tableview_id) {
71 $title = ($current === $title ?
'✓⠀' :
'⠀⠀') . $title;
72 $this->
ctrl->setParameterByClass($target_class,
'tableview_id', $view->getId());
73 $links[] = $this->ui_factory->link()->standard($title, $this->
ctrl->getLinkTargetByClass($target_class, $target_cmd));
75 $this->
ctrl->clearParameterByClass($target_class,
'tableview_id');
76 $this->
ctrl->clearParameterByClass($target_class,
'table_id');
88 if (count($links) > 1) {
90 $this->ui_factory->dropdown()->standard($links)->withLabel($label)
Class ilCtrl provides processing control methods.
ILIAS UI Factory $ui_factory
addTableSwitcherToToolbar(array $tables, string $target_class, string $target_cmd, int $table_id=0)
addViewSwitcherToToolbar(array $views, int $table_id, string $target_class, string $target_cmd, int $tableview_id=0)
addSwitcherToToolbar(array $links, string $label)
__construct(ilToolbarGUI $toolbar, \ILIAS\UI\Factory $ui_factory, ilCtrl $ctrl, ilLanguage $lng)
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.