ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
interface.ilCtrlInterface.php
Go to the documentation of this file.
1 <?php
2 
26 interface ilCtrlInterface
27 {
32  public const CMD_POST = 'post';
33 
37  public const PARAM_CSRF_TOKEN = 'rtoken';
38  public const PARAM_CID_PATH = 'cmdNode';
39  public const PARAM_REDIRECT = 'redirectSource';
40  public const PARAM_BASE_CLASS = 'baseClass';
41  public const PARAM_CMD_CLASS = 'cmdClass';
42  public const PARAM_CMD_MODE = 'cmdMode';
43  public const PARAM_CMD_FALLBACK = 'fallbackCmd';
44  public const PARAM_CMD = 'cmd';
45 
49  public const PROTECTED_PARAMETERS = [
50  self::PARAM_BASE_CLASS,
51  self::PARAM_CMD_CLASS,
52  self::PARAM_CID_PATH,
53  self::PARAM_CSRF_TOKEN,
54  ];
55 
59  public const CMD_MODE_PROCESS = 'execComm';
60  public const CMD_MODE_ASYNC = 'asynch';
61  public const CMD_MODE_HTML = 'getHtml';
62 
72  public function callBaseClass(string $a_base_class = null): void;
73 
85  public function forwardCommand(object $a_gui_object);
86 
96  public function getHTML(object $a_gui_object, array $a_parameters = null): string;
97 
105  public function getCmd(string $fallback_command = null): ?string;
106 
115  public function setCmd(?string $a_cmd): void;
116 
123  public function getCmdClass(): ?string;
124 
133  public function setCmdClass($a_cmd_class): void;
134 
143  public function getNextClass($a_gui_class = null): ?string;
144 
154  public function saveParameter(object $a_gui_obj, $a_parameter): void;
155 
171  public function saveParameterByClass(string $a_class, $a_parameter): void;
172 
183  public function setParameter(object $a_gui_obj, string $a_parameter, $a_value): void;
184 
197  public function setParameterByClass(string $a_class, string $a_parameter, $a_value): void;
198 
206  public function getParameterArray(object $a_gui_obj): array;
207 
215  public function getParameterArrayByClass(string $a_class): array;
216 
222  public function clearParameters(object $a_gui_obj): void;
223 
229  public function clearParametersByClass(string $a_class): void;
230 
237  public function clearParameterByClass(string $a_class, string $a_parameter): void;
238 
250  public function getLinkTarget(
251  object $a_gui_obj,
252  string $a_cmd = null,
253  string $a_anchor = null,
254  bool $is_async = false,
255  bool $has_xml_style = false
256  ): string;
257 
269  public function getLinkTargetByClass(
270  $a_class,
271  string $a_cmd = null,
272  string $a_anchor = null,
273  bool $is_async = false,
274  bool $has_xml_style = false
275  ): string;
276 
287  public function getFormAction(
288  object $a_gui_obj,
289  string $a_fallback_cmd = null,
290  string $a_anchor = null,
291  bool $is_async = false,
292  bool $has_xml_style = false
293  ): string;
294 
306  public function getFormActionByClass(
307  $a_class,
308  string $a_fallback_cmd = null,
309  string $a_anchor = null,
310  bool $is_async = false,
311  bool $has_xml_style = false
312  ): string;
313 
323  public function redirect(
324  object $a_gui_obj,
325  string $a_cmd = null,
326  string $a_anchor = null,
327  bool $is_async = false
328  ): void;
329 
339  public function redirectByClass(
340  $a_class,
341  string $a_cmd = null,
342  string $a_anchor = null,
343  bool $is_async = false
344  ): void;
345 
351  public function redirectToURL(string $target_url): void;
352 
362  public function setContextObject(int $obj_id, string $obj_type): void;
363 
372  public function getContextObjId(): ?int;
373 
382  public function getContextObjType(): ?string;
383 
389  public function getCallHistory(): array;
390 
399  public function lookupClassPath(string $a_class): string;
400 
407  public function lookupOriginalClassName(string $a_class): ?string;
408 
420  public function getClassForClasspath(string $a_class_path): string;
421 
427  public function setTargetScript(string $a_target_script): void;
428 
434  public function isAsynch(): bool;
435 
444  public function setReturn(object $a_gui_obj, string $a_cmd = null): void;
445 
454  public function setReturnByClass(string $a_class, string $a_cmd = null): void;
455 
465  public function getParentReturn(object $a_gui_obj): ?string;
466 
475  public function getParentReturnByClass(string $a_class): ?string;
476 
486  public function returnToParent(object $a_gui_obj, string $a_anchor = null): void;
487 
493  public function getRedirectSource(): ?string;
494 
508  public function insertCtrlCalls($a_parent, $a_child, string $a_comp_prefix): void;
509 
517  public function checkCurrentPathForClass(string $gui_class): bool;
518 
524  public function getCurrentClassPath(): array;
525 
529  public function attachObserver(ilCtrlObserver $observer, ilCtrlEvent $event = ilCtrlEvent::ALL): void;
530 
534  public function detachObserver(ilCtrlObserver $observer, ilCtrlEvent $event = ilCtrlEvent::ALL): void;
535 }
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
Returns a link target for the given information.
setParameterByClass(string $a_class, string $a_parameter, $a_value)
Sets a parameter for the given GUI class and appends the given value as well.
attachObserver(ilCtrlObserver $observer, ilCtrlEvent $event=ilCtrlEvent::ALL)
Attaches an observer to ALL or a specific.
const CMD_MODE_PROCESS
different modes used for UI plugins (or in dev-mode).
saveParameterByClass(string $a_class, $a_parameter)
Sets a parameter for the given GUI class that must be passed in every target link generation...
getHTML(object $a_gui_object, array $a_parameters=null)
Returns the HTML output of another GUI object by invoking getHTML() with optional parameters on it...
detachObserver(ilCtrlObserver $observer, ilCtrlEvent $event=ilCtrlEvent::ALL)
Detaches an observer from ALL or a specific.
saveParameter(object $a_gui_obj, $a_parameter)
Sets parameters for the given object.
clearParameters(object $a_gui_obj)
Removes all currently set or saved parameters for the given GUI object.
getFormAction(object $a_gui_obj, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
Returns a form action link for the given information.
clearParametersByClass(string $a_class)
Removes all currently set or saved parameters for the given GUI class.
clearParameterByClass(string $a_class, string $a_parameter)
Removes a specific parameter of a specific class that is currently set or saved.
getCallHistory()
Returns the descending stacktrace of ilCtrl calls that have been made.
getCmdClass()
Returns the fully-qualified classname of the requested command class.
getContextObjId()
Returns the current context&#39;s object id.
getClassForClasspath(string $a_class_path)
Returns the effective classname for a given path.
getFormActionByClass( $a_class, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
Returns a form action link for the given information.
getRedirectSource()
Returns the current redirect source.
const PARAM_CSRF_TOKEN
$_GET request parameter names, used throughout ilCtrl.
redirectToURL(string $target_url)
Redirects to the given target URL.
event string being used if
ilCtrlEvent
isAsynch()
Returns whether the current request is an asynchronous one.
forwardCommand(object $a_gui_object)
Forwards the request by invoking executeCommand() on the given GUI object and fires an according ilCt...
getCurrentClassPath()
Get current class path as array of class file names.
getCmd(string $fallback_command=null)
Returns the command passed with the current POST or GET request and fires an according ilCtrlEvent...
insertCtrlCalls($a_parent, $a_child, string $a_comp_prefix)
Inserts an ilCtrl call record into the database.
getParameterArrayByClass(string $a_class)
Returns all parameters that have been saved or set for a given GUI class.
setCmdClass($a_cmd_class)
Sets the command class that should be executed next.
setContextObject(int $obj_id, string $obj_type)
Sets the current object (id and type) of ilCtrl&#39;s context.
callBaseClass(string $a_base_class=null)
Calls the currently provided baseclass.
checkCurrentPathForClass(string $gui_class)
Check if current CID trace contains a certain gui class.
setCmd(?string $a_cmd)
Sets the current command.
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
Sets a parameter for the given GUI object and appends the given value.
getParameterArray(object $a_gui_obj)
Returns all parameters that have been saved or set for a GUI object.
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
Redirects to the provided GUI class.
setReturn(object $a_gui_obj, string $a_cmd=null)
Sets the return command of a given GUI object.
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
Returns a link target for the given information.
returnToParent(object $a_gui_obj, string $a_anchor=null)
Redirects to next parent class set with setReturn().
lookupOriginalClassName(string $a_class)
This method was introduced due to composer being case-sensitive when autoloading classes.
lookupClassPath(string $a_class)
Get class path that can be used in include statements for a given class name.
setReturnByClass(string $a_class, string $a_cmd=null)
Sets the return command of a given class.
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
Redirects to another GUI object.
getNextClass($a_gui_class=null)
Returns the fully-qualified classname of the next class in the control flow.
setTargetScript(string $a_target_script)
Sets the current ilCtrl target script (default ilias.php).
getContextObjType()
Returns the current context&#39;s object type.
getParentReturn(object $a_gui_obj)
getParentReturnByClass(string $a_class)