ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
LSOAdaptiveFilter.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24
29{
33 private \ILIAS\UI\Factory $ui_factory;
37 private \ilLanguage $lng;
41 private \ilCtrl $ctrl;
46
50 public function __construct(
55 ) {
56 $this->ui_factory = $ui_factory;
57 $this->lng = $lng;
58 $this->ctrl = $ctrl;
59 $this->parent_gui = $parent_gui;
60 }
61
68 public function getFilter(string $action, array $input_options, array $output_options): \ILIAS\UI\Component\Input\Container\Filter\Standard
69 {
70 // The filter needs fully qualified URLs (toggle_on/off, expand,
71 // collapse, apply and the form action). Passing the bare command name
72 // ("manageContent") made the browser submit to a relative URL like
73 // "/manageContent", which does not exist. Build a proper link target.
74 $action_url = $this->ctrl->getLinkTarget($this->parent_gui, $action);
75
76 $fields = [
77 'name' => $this->ui_factory->input()->field()->text($this->lng->txt('name')),
78 'input_conditions' => $this->ui_factory->input()->field()->multiselect(
79 $this->lng->txt('input_conditions'),
80 $input_options
81 ),
82 'output_conditions' => $this->ui_factory->input()->field()->multiselect(
83 $this->lng->txt('output_conditions'),
84 $output_options
85 ),
86 'online_status' => $this->ui_factory->input()->field()->select(
87 $this->lng->txt('status'),
88 [
89 'online' => $this->lng->txt('online'),
90 'offline' => $this->lng->txt('offline'),
91 ]
92 ),
93 'position' => $this->ui_factory->input()->field()->multiselect(
94 $this->lng->txt('position'),
95 [
96 'start' => $this->lng->txt('lso_adaptive_start'),
97 'end' => $this->lng->txt('lso_adaptive_end'),
98 ]
99 ),
100 ];
101
102 return $this->ui_factory->input()->container()->filter()->standard(
103 $action_url, // toggle_on
104 $action_url, // toggle_off
105 $action_url, // expand
106 $action_url, // collapse
107 $action_url, // apply
108 $action_url, // form action
109 $fields,
110 [true, true, true, true, true],
111 true,
112 true
113 );
114 }
115}
Creates the filter for adaptive learning sequence content.
ilObjLearningSequenceContentGUI $parent_gui
Parent content GUI.
__construct(\ILIAS\UI\Factory $ui_factory, \ilLanguage $lng, \ilCtrl $ctrl, ilObjLearningSequenceContentGUI $parent_gui)
Creates the adaptive content filter.
getFilter(string $action, array $input_options, array $output_options)
Gets the adaptive content filter.
Definition: UI.php:27
Class ilCtrl provides processing control methods.
language handling
This is how the factory for UI elements looks.
Definition: Factory.php:38
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.