ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ILIAS\Conditions\Configuration\ConditionTriggerTableGUI Class Reference
+ Inheritance diagram for ILIAS\Conditions\Configuration\ConditionTriggerTableGUI:
+ Collaboration diagram for ILIAS\Conditions\Configuration\ConditionTriggerTableGUI:

Public Member Functions

 __construct (ConditionTriggerProvider $provider, bool $allow_optional_conditions)
 
 getRows (DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 This is called by the table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 
 getTotalRowCount (mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 Mainly for the purpose of pagination-support, it is important to know about the total number of records available. More...
 
 get ()
 
 render ()
 
 getRows (DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 This is called by the table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 
 getTotalRowCount (mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 Mainly for the purpose of pagination-support, it is important to know about the total number of records available. More...
 

Data Fields

const string ACTION_TOKEN = 'action'
 
const string ID_TOKEN = 'id'
 
const string TABLE_NS = 'cond_trigger_table'
 
const string ACTION_TOKEN_NS = self::TABLE_NS . '_' . self::ACTION_TOKEN
 
const string ID_TOKEN_NS = self::TABLE_NS . '_' . self::ID_TOKEN
 

Protected Member Functions

 getColumns ()
 
 getActions ()
 

Protected Attributes

Psr Http Message ServerRequestInterface $http_request
 
ILIAS UI Renderer $ui_renderer
 
ILIAS UI Factory $ui_factory
 
DataFactory $data_factory
 
ConditionTriggerProvider $provider
 
bool $allow_optional_conditions
 
readonly ilLanguage $lng
 
readonly ilObjUser $user
 
readonly ilCtrl $ctrl
 

Detailed Description

Definition at line 36 of file ConditionTriggerTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::__construct ( ConditionTriggerProvider  $provider,
bool  $allow_optional_conditions 
)

Definition at line 59 of file ConditionTriggerTableGUI.php.

60 {
61 global $DIC;
62
63 $this->provider = $provider;
64 $this->allow_optional_conditions = $allow_optional_conditions;
65
66 $this->lng = $DIC->language();
67 $this->lng->loadLanguageModule('rbac');
68 $this->user = $DIC->user();
69 $this->ctrl = $DIC->ctrl();
70 $this->ui_factory = $DIC->ui()->factory();
71 $this->data_factory = new DataFactory();
72 $this->ui_renderer = $DIC->ui()->renderer();
73 $this->http_request = $DIC->http()->request();
74 }
global $DIC
Definition: shib_login.php:26

References ILIAS\Conditions\Configuration\ConditionTriggerTableGUI\$allow_optional_conditions, $DIC, ILIAS\Conditions\Configuration\ConditionTriggerTableGUI\$provider, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ get()

ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::get ( )

Definition at line 164 of file ConditionTriggerTableGUI.php.

164 : Data
165 {
166 return $this->ui_factory
167 ->table()
168 ->data(
169 $this,
170 $this->lng->txt('active_preconditions'),
171 $this->getColumns(),
172 )
173 ->withId(self::class)
174 ->withActions($this->getActions())
175 ->withRequest($this->http_request);
176 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getActions()

ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::getActions ( )
protected
Returns
array<string, \ILIAS\UI\Component\Table\Action\Action>

Definition at line 124 of file ConditionTriggerTableGUI.php.

124 : array
125 {
126 $uri_command_handler = $this->data_factory->uri(
127 ILIAS_HTTP_PATH . '/' . $this->ctrl->getLinkTargetByClass(
128 ilConditionHandlerGUI::class,
129 'handleConditionTriggerTableActions'
130 )
131 );
132 [
133 $url_builder,
134 $action_parameter_token,
135 $row_id_token
136 ] =
137 (new URLBuilder($uri_command_handler))->acquireParameters(
138 [self::TABLE_NS],
139 self::ACTION_TOKEN,
140 self::ID_TOKEN
141 );
142
143 $actions['edit'] = $this->ui_factory->table()->action()->single(
144 $this->lng->txt('edit'),
145 $url_builder->withParameter($action_parameter_token, 'editConditionTrigger'),
146 $row_id_token
147 );
148 if ($this->allow_optional_conditions) {
149 $actions['saveCompulsory'] = $this->ui_factory->table()->action()->multi(
150 $this->lng->txt('rbac_precondition_save_obligatory'),
151 $url_builder->withParameter($action_parameter_token, 'saveCompulsory'),
152 $row_id_token
153 );
154 }
155 $actions['confirmDeleteConditionTrigger'] = $this->ui_factory->table()->action()->standard(
156 $this->lng->txt('delete'),
157 $url_builder->withParameter($action_parameter_token, 'confirmDeleteConditionTrigger'),
158 $row_id_token
159 )->withAsync(true);
160 return $actions;
161 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getColumns()

ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::getColumns ( )
protected

Definition at line 101 of file ConditionTriggerTableGUI.php.

101 : array
102 {
103 return [
104 'trigger' => $this->ui_factory
105 ->table()
106 ->column()
107 ->link($this->lng->txt('rbac_precondition_source')),
108 'condition' => $this->ui_factory
109 ->table()
110 ->column()
111 ->text($this->lng->txt('rbac_precondition_condition'))
112 ->withIsSortable(true),
113 'obligatory' => $this->ui_factory
114 ->table()
115 ->column()
116 ->statusIcon($this->lng->txt('precondition_obligatory'))
117 ->withIsSortable(false)
118 ];
119 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getRows()

ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::getRows ( DataRowBuilder  $row_builder,
array  $visible_column_ids,
Range  $range,
Order  $order,
mixed  $additional_viewcontrol_data,
mixed  $filter_data,
mixed  $additional_parameters 
)

This is called by the table to retrieve rows; map data-records to rows using the $row_builder e.g.

yield $row_builder->buildStandardRow($row_id, $record).

Parameters
string[]$visible_column_ids

Implements ILIAS\UI\Component\Table\DataRetrieval.

Definition at line 77 of file ConditionTriggerTableGUI.php.

85 : Generator {
86 $records = $this->provider->limitData($range, $order);
87 foreach ($records as $row) {
88 $id = $row['id'];
89 yield $row_builder->buildDataRow((string) $id, $row);
90 }
91 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
buildDataRow(string $id, array $record)

References $id, and ILIAS\UI\Component\Table\DataRowBuilder\buildDataRow().

+ Here is the call graph for this function:

◆ getTotalRowCount()

ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::getTotalRowCount ( mixed  $additional_viewcontrol_data,
mixed  $filter_data,
mixed  $additional_parameters 
)

Mainly for the purpose of pagination-support, it is important to know about the total number of records available.

Given the nature of a DataTable, which is, opposite to a PresentationTable, rather administrative than explorative, this information will increase user experience quite a bit. However, you may return null, if the call is to costly, but expect the View Control to look a little different in this case.

Make sure that potential filters or user restrictions are being applied to the count.

Implements ILIAS\UI\Component\Table\DataRetrieval.

Definition at line 93 of file ConditionTriggerTableGUI.php.

97 : ?int {
98 return count($this->provider->getData());
99 }

◆ render()

ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::render ( )

Definition at line 179 of file ConditionTriggerTableGUI.php.

179 : string
180 {
181 return $this->ui_renderer->render(
182 [
183 $this->get()
184 ]
185 );
186 }

Field Documentation

◆ $allow_optional_conditions

bool ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::$allow_optional_conditions
protected

◆ $ctrl

readonly ilCtrl ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::$ctrl
protected

Definition at line 56 of file ConditionTriggerTableGUI.php.

◆ $data_factory

DataFactory ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::$data_factory
protected

Definition at line 49 of file ConditionTriggerTableGUI.php.

◆ $http_request

Psr Http Message ServerRequestInterface ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::$http_request
protected

Definition at line 46 of file ConditionTriggerTableGUI.php.

◆ $lng

readonly ilLanguage ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::$lng
protected

Definition at line 54 of file ConditionTriggerTableGUI.php.

◆ $provider

ConditionTriggerProvider ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::$provider
protected

◆ $ui_factory

ILIAS UI Factory ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::$ui_factory
protected

Definition at line 48 of file ConditionTriggerTableGUI.php.

◆ $ui_renderer

ILIAS UI Renderer ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::$ui_renderer
protected

Definition at line 47 of file ConditionTriggerTableGUI.php.

◆ $user

readonly ilObjUser ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::$user
protected

Definition at line 55 of file ConditionTriggerTableGUI.php.

◆ ACTION_TOKEN

const string ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::ACTION_TOKEN = 'action'

Definition at line 38 of file ConditionTriggerTableGUI.php.

◆ ACTION_TOKEN_NS

const string ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::ACTION_TOKEN_NS = self::TABLE_NS . '_' . self::ACTION_TOKEN

Definition at line 42 of file ConditionTriggerTableGUI.php.

◆ ID_TOKEN

const string ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::ID_TOKEN = 'id'

Definition at line 39 of file ConditionTriggerTableGUI.php.

◆ ID_TOKEN_NS

const string ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::ID_TOKEN_NS = self::TABLE_NS . '_' . self::ID_TOKEN

Definition at line 44 of file ConditionTriggerTableGUI.php.

◆ TABLE_NS

const string ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::TABLE_NS = 'cond_trigger_table'

Definition at line 40 of file ConditionTriggerTableGUI.php.


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