ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\SystemCheck\Table\Task\Handler Class Reference
+ Inheritance diagram for ILIAS\SystemCheck\Table\Task\Handler:
+ Collaboration diagram for ILIAS\SystemCheck\Table\Task\Handler:

Public Member Functions

 __construct (protected readonly DataFactory $data_factory, protected readonly UIServices $ui, protected readonly ilLanguage $lng, protected readonly HTTPServices $http, protected readonly DataRetrievalInterface $data_retrieval, protected readonly RefineryFactory $refinery, protected readonly ilCtrl $ctrl, protected readonly bool $actions_permitted=false)
 
 getHTML ()
 
 handleTableActions ()
 
 handleTableActions ()
 
 getHTML ()
 

Data Fields

const string TABLE_COL_TITLE = 'title'
 
const string TABLE_COL_DESCRIPTION = 'description'
 
const string TABLE_COL_LAST_UPDATE = 'last_update'
 
const string TABLE_COL_STATUS = 'status'
 

Protected Member Functions

 getColumns ()
 
 getActions ()
 
 initTable ()
 
 getTable ()
 

Protected Attributes

const string TABLE_ID = "sc_groups"
 
const string TABLE_ACTION_ID = "table_action"
 
const string ROW_ID = "row_ids"
 
const string LNG_TABLE_TITLE = 'sysc_task_overview'
 
const string LNG_TABLE_COL_TITLE = 'title'
 
const string LNG_TABLE_COL_DESCRIPTION = 'description'
 
const string LNG_TABLE_COL_LAST_UPDATE = 'last_update'
 
const string LNG_TABLE_COL_STATUS = 'status'
 
DataTable $table
 
URLBuilder $url_builder
 
ilURLBuilderToken $action_parameter_token
 
ilURLBuilderToken $row_id_token
 

Detailed Description

Definition at line 36 of file Handler.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\SystemCheck\Table\Task\Handler::__construct ( protected readonly DataFactory  $data_factory,
protected readonly UIServices  $ui,
protected readonly ilLanguage  $lng,
protected readonly HTTPServices  $http,
protected readonly DataRetrievalInterface  $data_retrieval,
protected readonly RefineryFactory  $refinery,
protected readonly ilCtrl  $ctrl,
protected readonly bool  $actions_permitted = false 
)

Definition at line 56 of file Handler.php.

65 {
66 $this->initTable();
67 }

References ILIAS\SystemCheck\Table\Task\Handler\initTable().

+ Here is the call graph for this function:

Member Function Documentation

◆ getActions()

ILIAS\SystemCheck\Table\Task\Handler::getActions ( )
finalprotected

Definition at line 87 of file Handler.php.

87 : array
88 {
89 if (!$this->actions_permitted) {
90 return [];
91 }
92 $this->url_builder = new URLBuilder($this->data_factory->uri($this->http->request()->getUri()->__toString()));
93 list($this->url_builder, $this->action_parameter_token, $this->row_id_token) =
94 $this->url_builder->acquireParameters(
95 ['datatable', self::TABLE_ID],
96 self::TABLE_ACTION_ID,
97 self::ROW_ID
98 );
99 $actions = [];
100 foreach ($this->data_retrieval->getAllActions() as $command => $txt) {
101 $actions[$command] = $this->ui->factory()->table()->action()->single(
102 $txt,
103 $this->url_builder->withParameter($this->action_parameter_token, $command),
104 $this->row_id_token
105 );
106 }
107 return $actions;
108 }

References ILIAS\Repository\ui().

Referenced by ILIAS\SystemCheck\Table\Task\Handler\initTable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getColumns()

ILIAS\SystemCheck\Table\Task\Handler::getColumns ( )
finalprotected

Definition at line 69 of file Handler.php.

69 : array
70 {
71 return [
72 self::TABLE_COL_TITLE => $this->ui->factory()->table()->column()->text(
73 $this->lng->txt(self::LNG_TABLE_COL_TITLE)
74 )->withIsSortable(true),
75 self::TABLE_COL_DESCRIPTION => $this->ui->factory()->table()->column()->text(
76 $this->lng->txt(self::LNG_TABLE_COL_DESCRIPTION)
77 )->withIsSortable(true),
78 self::TABLE_COL_LAST_UPDATE => $this->ui->factory()->table()->column()->text(
79 $this->lng->txt(self::LNG_TABLE_COL_LAST_UPDATE)
80 )->withIsSortable(true),
81 self::TABLE_COL_STATUS => $this->ui->factory()->table()->column()->text(
82 $this->lng->txt(self::LNG_TABLE_COL_STATUS)
83 )->withIsSortable(true)
84 ];
85 }

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

+ Here is the call graph for this function:

◆ getHTML()

ILIAS\SystemCheck\Table\Task\Handler::getHTML ( )
final

Implements ILIAS\SystemCheck\I\Table\Task\HandlerInterface.

Definition at line 128 of file Handler.php.

128 : string
129 {
130 return $this->ui->renderer()->render([$this->getTable()]);
131 }

References ILIAS\SystemCheck\Table\Task\Handler\getTable(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ getTable()

ILIAS\SystemCheck\Table\Task\Handler::getTable ( )
finalprotected

Definition at line 123 of file Handler.php.

123 : DataTable
124 {
125 return $this->table;
126 }

References ILIAS\SystemCheck\Table\Task\Handler\$table.

Referenced by ILIAS\SystemCheck\Table\Task\Handler\getHTML().

+ Here is the caller graph for this function:

◆ handleTableActions()

ILIAS\SystemCheck\Table\Task\Handler::handleTableActions ( )
final

Implements ILIAS\SystemCheck\I\Table\Task\HandlerInterface.

Definition at line 133 of file Handler.php.

133 : void
134 {
135 if (!$this->http->wrapper()->query()->has($this->action_parameter_token->getName())) {
136 return;
137 }
138 if (!$this->http->wrapper()->query()->has($this->row_id_token->getName())) {
139 return;
140 }
141 if (!$this->actions_permitted) {
142 return;
143 }
144 $action = $this->http->wrapper()->query()->retrieve(
145 $this->action_parameter_token->getName(),
146 $this->refinery->kindlyTo()->string()
147 );
148 $tokens = $this->http->wrapper()->query()->retrieve(
149 $this->row_id_token->getName(),
150 $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->int())
151 );
152 $task_id = (int) $tokens[0];
153 $task_handler = ilSCComponentTaskFactory::getComponentTask($task_id);
154 $this->ctrl->setParameterByClass(get_class($task_handler), 'task_id', $task_id);
155 $this->ctrl->redirectByClass(get_class($task_handler), $action);
156 $this->ctrl->clearParameterByClass(get_class($task_handler), 'task_id');
157 }
static http()
Fetches the global http state from ILIAS.

References ILIAS\Repository\ctrl(), ilSCComponentTaskFactory\getComponentTask(), ILIAS\FileDelivery\http(), and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ initTable()

ILIAS\SystemCheck\Table\Task\Handler::initTable ( )
finalprotected

Definition at line 110 of file Handler.php.

110 : void
111 {
112 if (!isset($this->table)) {
113 $this->table = $this->ui->factory()->table()->data(
114 $this->data_retrieval,
115 $this->lng->txt(self::LNG_TABLE_TITLE),
116 $this->getColumns(),
117 )
118 ->withActions($this->getActions())
119 ->withId(self::TABLE_ID)->withRequest($this->http->request());
120 }
121 }

References ILIAS\SystemCheck\Table\Task\Handler\getActions(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

Referenced by ILIAS\SystemCheck\Table\Task\Handler\__construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $action_parameter_token

ilURLBuilderToken ILIAS\SystemCheck\Table\Task\Handler::$action_parameter_token
protected

Definition at line 53 of file Handler.php.

◆ $row_id_token

ilURLBuilderToken ILIAS\SystemCheck\Table\Task\Handler::$row_id_token
protected

Definition at line 54 of file Handler.php.

◆ $table

DataTable ILIAS\SystemCheck\Table\Task\Handler::$table
protected

Definition at line 51 of file Handler.php.

Referenced by ILIAS\SystemCheck\Table\Task\Handler\getTable().

◆ $url_builder

URLBuilder ILIAS\SystemCheck\Table\Task\Handler::$url_builder
protected

Definition at line 52 of file Handler.php.

◆ LNG_TABLE_COL_DESCRIPTION

const string ILIAS\SystemCheck\Table\Task\Handler::LNG_TABLE_COL_DESCRIPTION = 'description'
protected

Definition at line 47 of file Handler.php.

◆ LNG_TABLE_COL_LAST_UPDATE

const string ILIAS\SystemCheck\Table\Task\Handler::LNG_TABLE_COL_LAST_UPDATE = 'last_update'
protected

Definition at line 48 of file Handler.php.

◆ LNG_TABLE_COL_STATUS

const string ILIAS\SystemCheck\Table\Task\Handler::LNG_TABLE_COL_STATUS = 'status'
protected

Definition at line 49 of file Handler.php.

◆ LNG_TABLE_COL_TITLE

const string ILIAS\SystemCheck\Table\Task\Handler::LNG_TABLE_COL_TITLE = 'title'
protected

Definition at line 46 of file Handler.php.

◆ LNG_TABLE_TITLE

const string ILIAS\SystemCheck\Table\Task\Handler::LNG_TABLE_TITLE = 'sysc_task_overview'
protected

Definition at line 45 of file Handler.php.

◆ ROW_ID

const string ILIAS\SystemCheck\Table\Task\Handler::ROW_ID = "row_ids"
protected

Definition at line 40 of file Handler.php.

◆ TABLE_ACTION_ID

const string ILIAS\SystemCheck\Table\Task\Handler::TABLE_ACTION_ID = "table_action"
protected

Definition at line 39 of file Handler.php.

◆ TABLE_COL_DESCRIPTION

const string ILIAS\SystemCheck\Table\Task\Handler::TABLE_COL_DESCRIPTION = 'description'

Definition at line 42 of file Handler.php.

◆ TABLE_COL_LAST_UPDATE

const string ILIAS\SystemCheck\Table\Task\Handler::TABLE_COL_LAST_UPDATE = 'last_update'

Definition at line 43 of file Handler.php.

◆ TABLE_COL_STATUS

const string ILIAS\SystemCheck\Table\Task\Handler::TABLE_COL_STATUS = 'status'

Definition at line 44 of file Handler.php.

◆ TABLE_COL_TITLE

const string ILIAS\SystemCheck\Table\Task\Handler::TABLE_COL_TITLE = 'title'

Definition at line 41 of file Handler.php.

◆ TABLE_ID

const string ILIAS\SystemCheck\Table\Task\Handler::TABLE_ID = "sc_groups"
protected

Definition at line 38 of file Handler.php.


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