19declare(strict_types=1);
86 array $ctrl_structure,
91 $this->security = $security_info;
92 $this->structure = $ctrl_structure;
104 in_array($this->
lowercase($class_name), $this->base_classes,
true);
129 self::KEY_CLASS_NAME,
133 return (
null !== $class_name) ? $this->
lowercase($class_name) :
null;
166 if (empty($children)) {
179 if (empty($children)) {
192 if (empty($parents)) {
205 if (empty($parents)) {
218 throw new ilCtrlException(
"Parameter '$parameter_name' must not be saved, it could mess with the control flow.");
221 if (!preg_match(self::PARAM_NAME_REGEX, $parameter_name)) {
222 throw new ilCtrlException(
"Cannot save parameter '$parameter_name', as it contains invalid characters.");
225 $this->permanent_parameters[$this->
lowercase($class_name)][] = $parameter_name;
233 $class_name = $this->
lowercase($class_name);
234 if (isset($this->permanent_parameters[$class_name])) {
235 unset($this->permanent_parameters[$class_name]);
244 return $this->permanent_parameters[$this->
lowercase($class_name)] ??
null;
252 if (!preg_match(self::PARAM_NAME_REGEX, $parameter_name)) {
253 throw new ilCtrlException(
"Cannot save parameter '$parameter_name', as it contains invalid characters.");
256 $this->temporary_parameters[$this->
lowercase($class_name)][$parameter_name] = $value;
264 $class_name = $this->
lowercase($class_name);
265 if (isset($this->temporary_parameters[$class_name])) {
266 unset($this->temporary_parameters[$class_name]);
275 return $this->temporary_parameters[$this->
lowercase($class_name)] ??
null;
283 $class_name = $this->
lowercase($class_name);
288 if (!empty($this->permanent_parameters[$class_name])) {
289 foreach ($this->permanent_parameters[$class_name] as $index => $permanent_parameter) {
290 if ($parameter_name === $permanent_parameter) {
291 unset($this->permanent_parameters[$class_name][$index]);
303 if (isset($this->temporary_parameters[$class_name])) {
304 unset($this->temporary_parameters[$class_name][$parameter_name]);
313 $this->return_targets[$this->
lowercase($class_name)] = $target_url;
321 return $this->return_targets[$this->
lowercase($class_name)] ??
null;
330 if (
null !== $class_name) {
351 if (
null !== $class_name) {
375 if (isset($this->mapped_structure[$cid][$identifier_key])) {
376 return $this->mapped_structure[$cid][$identifier_key];
379 foreach ($this->structure as $class_info) {
380 if (isset($class_info[$identifier_key]) && $class_info[self::KEY_CLASS_CID] === $cid) {
381 $this->mapped_structure[$cid] = $class_info;
382 return $class_info[$identifier_key];
398 $class_name = $this->
lowercase($class_name);
399 if (isset($this->structure[$class_name])) {
400 return $this->structure[$class_name][$identifier_key];
413 return strtolower($string);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrlStructure holds the currently read control structure.
removeTemporaryParametersByClass(string $class_name)
@inheritDoc
getRelativePathByName(string $class_name)
@inheritDoc
array $permanent_parameters
getChildrenByCid(string $cid)
@inheritDoc
getRelativePathByCid(string $cid)
@inheritDoc
getTemporaryParametersByClass(string $class_name)
@inheritDoc
getValueForKeyByName(string $identifier_key, string $class_name)
Returns a stored structure value of the given key from the corresponding class mapped by name.
getObjNameByName(string $class_name)
@inheritDoc
getPermanentParametersByClass(string $class_name)
@inheritDoc
__construct(array $ctrl_structure, array $base_classes, array $security_info)
ilCtrlStructure Constructor
getUnsafeCommandsByName(string $class_name)
@inheritDoc
getObjNameByCid(string $cid)
@inheritDoc
setReturnTargetByClass(string $class_name, string $target_url)
@inheritDoc
isBaseClass(string $class_name)
@inheritDoc
getParentsByCid(string $cid)
@inheritDoc
getChildrenByName(string $class_name)
@inheritDoc
getValueForKeyByCid(string $identifier_key, string $cid)
Returns a stored structure value of the given key from the corresponding class mapped by CID.
lowercase(string $string)
Helper function to lowercase strings.
removeSingleParameterByClass(string $class_name, string $parameter_name)
@inheritDoc
setTemporaryParameterByClass(string $class_name, string $parameter_name, $value)
@inheritDoc
getReturnTargetByClass(string $class_name)
@inheritDoc
getSafeCommandsByName(string $class_name)
@inheritDoc
getUnsafeCommandsByCid(string $cid)
@inheritDoc
array $temporary_parameters
getParentsByName(string $class_name)
@inheritDoc
getClassNameByCid(string $cid)
@inheritDoc
getClassCidByName(string $class_name)
@inheritDoc
removePermanentParametersByClass(string $class_name)
@inheritDoc
getSafeCommandsByCid(string $cid)
@inheritDoc
setPermanentParameterByClass(string $class_name, string $parameter_name)
@inheritDoc
const PROTECTED_PARAMETERS
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const KEY_UNSAFE_COMMANDS