ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSCComponentTaskGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
25{
26 protected ilCtrl $ctrl;
27 protected ilLanguage $lng;
29
30 protected ?ilSCTask $task;
31
32 public function __construct(?ilSCTask $task = null)
33 {
34 global $DIC;
35 $this->task = $task;
36
37 $this->ctrl = $DIC->ctrl();
38 $this->lng = $DIC->language();
39 $this->tpl = $DIC->ui()->mainTemplate();
40 }
41
48 abstract public function getActions(): array;
49
50 abstract public function getTitle(): string;
51
52 abstract public function getDescription(): string;
53
54 abstract public function getGroupTitle(): string;
55
56 abstract public function getGroupDescription(): string;
57
58 protected function getLang(): ilLanguage
59 {
60 return $this->lng;
61 }
62
63 protected function getCtrl(): ilCtrl
64 {
65 return $this->ctrl;
66 }
67
68 public function getTask(): ilSCTask
69 {
70 return $this->task;
71 }
72
73 public function executeCommand(): void
74 {
75 $next_class = $this->getCtrl()->getNextClass($this);
76 $cmd = $this->getCtrl()->getCmd();
77
78 switch ($next_class) {
79 default:
80 $this->$cmd();
81 break;
82 }
83 }
84
85 protected function showSimpleConfirmation(string $a_text, string $a_btn_text, string $a_cmd): void
86 {
87 $confirm = new ilConfirmationGUI();
88 $confirm->setFormAction($this->getCtrl()->getFormAction($this));
89 $confirm->setConfirm($a_btn_text, $a_cmd);
90 $confirm->setCancel($this->lng->txt('cancel'), 'cancel');
91 $confirm->setHeaderText($a_text);
92
93 $this->tpl->setContent($confirm->getHTML());
94 }
95
96 protected function cancel(): void
97 {
98 $this->getCtrl()->returnToParent($this);
99 }
100}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
language handling
Abstract class for component tasks.
getActions()
array( 'txt' => $lng->txt('sysc_action_repair') 'command' => 'repairTask' );
__construct(?ilSCTask $task=null)
ilGlobalTemplateInterface $tpl
showSimpleConfirmation(string $a_text, string $a_btn_text, string $a_cmd)
Defines a system check task.
global $DIC
Definition: shib_login.php:26