ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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, ?array $filter_data, ?array $additional_parameters)
 This is called by the table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 
 getTotalRowCount (?array $filter_data, ?array $additional_parameters)
 Mainly for the purpose of pagination-support, it is important to know about the total number of records available. More...
 
 get ()
 
 render ()
 

Data Fields

const ACTION_TOKEN = 'action'
 
const ID_TOKEN = 'id'
 
const TABLE_NS = 'cond_trigger_table'
 
const ACTION_TOKEN_NS = self::TABLE_NS . '_' . self::ACTION_TOKEN
 
const 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.

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

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  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ get()

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

Definition at line 160 of file ConditionTriggerTableGUI.php.

References ILIAS\Conditions\Configuration\ConditionTriggerTableGUI\getActions(), ILIAS\Conditions\Configuration\ConditionTriggerTableGUI\getColumns(), and ILIAS\Repository\lng().

160  : Data
161  {
162  return $this->ui_factory
163  ->table()
164  ->data(
165  $this,
166  $this->lng->txt('active_preconditions'),
167  $this->getColumns(),
168  )
169  ->withId(self::class)
170  ->withActions($this->getActions())
171  ->withRequest($this->http_request);
172  }
+ Here is the call graph for this function:

◆ getActions()

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

Definition at line 120 of file ConditionTriggerTableGUI.php.

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

Referenced by ILIAS\Conditions\Configuration\ConditionTriggerTableGUI\get().

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

◆ getColumns()

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

Definition at line 97 of file ConditionTriggerTableGUI.php.

References ILIAS\Repository\lng().

Referenced by ILIAS\Conditions\Configuration\ConditionTriggerTableGUI\get().

97  : array
98  {
99  return [
100  'trigger' => $this->ui_factory
101  ->table()
102  ->column()
103  ->link($this->lng->txt('rbac_precondition_source')),
104  'condition' => $this->ui_factory
105  ->table()
106  ->column()
107  ->text($this->lng->txt('condition'))
108  ->withIsSortable(true),
109  'obligatory' => $this->ui_factory
110  ->table()
111  ->column()
112  ->statusIcon($this->lng->txt('precondition_obligatory'))
113  ->withIsSortable(false)
114  ];
115  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRows()

ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::getRows ( DataRowBuilder  $row_builder,
array  $visible_column_ids,
Range  $range,
Order  $order,
?array  $filter_data,
?array  $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.

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

84  : Generator {
85  $records = $this->provider->limitData($range, $order);
86  foreach ($records as $row) {
87  $id = $row['id'];
88  yield $row_builder->buildDataRow((string) $id, $row);
89  }
90  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ getTotalRowCount()

ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::getTotalRowCount ( ?array  $filter_data,
?array  $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 92 of file ConditionTriggerTableGUI.php.

92  : ?int
93  {
94  return count($this->provider->getData());
95  }

◆ render()

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

Definition at line 175 of file ConditionTriggerTableGUI.php.

175  : string
176  {
177  return $this->ui_renderer->render(
178  [
179  $this->get()
180  ]
181  );
182  }

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 ILIAS\Conditions\Configuration\ConditionTriggerTableGUI::ACTION_TOKEN = 'action'

Definition at line 38 of file ConditionTriggerTableGUI.php.

◆ ACTION_TOKEN_NS

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

Definition at line 42 of file ConditionTriggerTableGUI.php.

◆ ID_TOKEN

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

Definition at line 39 of file ConditionTriggerTableGUI.php.

◆ ID_TOKEN_NS

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

Definition at line 44 of file ConditionTriggerTableGUI.php.

◆ TABLE_NS

const 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: