26use Psr\Http\Message\ServerRequestInterface;
47 protected \ilLanguage
$lng;
51 protected \ILIAS\HTTP\Services
$http;
52 protected \ilGlobalTemplateInterface
$tpl;
61 protected \ILIAS\HTTP\Wrapper\ArrayBasedRequestWrapper
$query;
67 protected array $query_namespace = [
'orgu',
'posedit']
71 $this->
lng = $DIC->language();
72 $this->
lng->loadLanguageModule(
"orgu");
73 $this->
ctrl = $DIC->ctrl();
74 $this->tabsGUI =
$DIC->tabs();
75 $this->
access = $DIC->access();
76 $this->
http = $DIC->http();
77 $this->tpl =
$DIC->ui()->mainTemplate();
79 $this->query =
$DIC->http()->wrapper()->query();
80 $this->request =
$DIC->http()->request();
81 $this->data_factory =
new DataFactory();
83 $here_uri = $this->data_factory->uri(
84 $this->request->getUri()->__toString()
86 $this->url_builder =
new URLBuilder($here_uri);
88 $this->url_builder->acquireParameters($this->query_namespace,
"action",
"rowid");
93 $this->ui_factory =
$DIC[
'ui.factory'];
94 $this->ui_renderer =
$DIC[
'ui.renderer'];
107 abstract protected function index(): void;
124 $this->
ctrl->redirect($this, self::CMD_INDEX);
129 $this->tpl->setContent($html);
138 $this->
ctrl = $DIC->ctrl();
139 $this->
http = $DIC->http();
140 $this->
access = $DIC->access();
141 $this->tabsGUI =
$DIC->tabs();
142 $this->
lng = $DIC->language();
143 $this->tpl =
$DIC->ui()->mainTemplate();
144 $this->
lng->loadLanguageModule(
"orgu");
146 $cmd = $this->
ctrl->getCmd(self::CMD_INDEX);
148 if ($this->action_token &&
149 $this->query->has($this->action_token->getName())
151 $cmd = $this->query->retrieve(
152 $this->action_token->getName(),
153 $this->refinery->to()->string()
157 $next_class = $this->
ctrl->getNextClass();
160 if (strtolower($class) === $next_class) {
161 $instance =
new $class();
163 $instance->setParentGui($this);
164 $this->
ctrl->forwardCommand($instance);
178 if ($this->checkRequestReferenceId()) {
187 $this->tabsGUI->addSubTab($subtab_id, $this->
lng->txt($subtab_id),
$url);
192 $this->tabsGUI->activateSubTab($subtab_id);
195 protected function checkRequestReferenceId()
210 $ref_id = $this->
http->request()->getQueryParams()[
"ref_id"];
221 if ($this->query->has($this->row_id_token->getName())) {
222 return $this->query->retrieve(
223 $this->row_id_token->getName(),
224 $this->refinery->custom()->transformation(fn($v) => (
int) array_shift($v))
227 throw new \Exception(
'no position-id in query');
Customizing of pimple-DIC for ILIAS.
Builds a Color from either hex- or rgb values.
URLBuilderToken $action_token
ilGlobalTemplateInterface $tpl
activeSubTab(string $subtab_id)
const CMD_DEFAULT_PERMISSIONS
pushSubTab(string $subtab_id, string $url)
ILIAS HTTP Services $http
URLBuilderToken $row_id_token
__construct(protected array $query_namespace=['orgu', 'posedit'])
setParentGui(BaseCommands $parent_gui)
DataFactory $data_factory
ServerRequestInterface $request
ILIAS HTTP Wrapper ArrayBasedRequestWrapper $query
An entity that renders components to a string output.
static http()
Fetches the global http state from ILIAS.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...