|
| | __construct (ilToolbarGUI $toolbar, \ILIAS\UI\Factory $ui_factory, ilCtrl $ctrl, ilLanguage $lng) |
| |
| | 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) |
| |
Definition at line 21 of file class.ilDclSwitcher.php.
◆ __construct()
◆ addSwitcherToToolbar()
| ilDclSwitcher::addSwitcherToToolbar |
( |
array |
$links, |
|
|
string |
$label |
|
) |
| |
|
protected |
◆ addTableSwitcherToToolbar()
| ilDclSwitcher::addTableSwitcherToToolbar |
( |
array |
$tables, |
|
|
string |
$target_class, |
|
|
string |
$target_cmd, |
|
|
int |
$table_id = 0 |
|
) |
| |
- Parameters
-
Definition at line 39 of file class.ilDclSwitcher.php.
39 : void
40 {
41 $this->
ctrl->clearParameterByClass($target_class,
'tableview_id');
42 $links = [];
43 $current = '';
44 foreach ($tables as $table) {
45 $title = $table->getTitle();
46 if ($table->getId() == $table_id) {
47 $current = $title;
48 }
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));
52 }
53 $this->
ctrl->clearParameterByClass($target_class,
'table_id');
54
56 }
addSwitcherToToolbar(array $links, string $label)
References addSwitcherToToolbar(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().
◆ addViewSwitcherToToolbar()
| ilDclSwitcher::addViewSwitcherToToolbar |
( |
array |
$views, |
|
|
int |
$table_id, |
|
|
string |
$target_class, |
|
|
string |
$target_cmd, |
|
|
int |
$tableview_id = 0 |
|
) |
| |
- Parameters
-
Definition at line 61 of file class.ilDclSwitcher.php.
61 : void
62 {
63 $this->
ctrl->setParameterByClass($target_class,
'table_id', $table_id);
64 $links = [];
65 $current = '';
66 foreach ($views as $view) {
67 $title = $view->getTitle();
68 if ($view->getId() == $tableview_id) {
69 $current = $title;
70 }
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));
74 }
75 $this->
ctrl->clearParameterByClass($target_class,
'tableview_id');
76 $this->
ctrl->clearParameterByClass($target_class,
'table_id');
77
79 }
References addSwitcherToToolbar(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().
◆ $ctrl
◆ $lng
◆ $toolbar
◆ $ui_factory
| ILIAS UI Factory ilDclSwitcher::$ui_factory |
|
protected |
The documentation for this class was generated from the following file: