ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
interface.ilCtrlInterface.php
Go to the documentation of this file.
1 <?php
2 
25 interface ilCtrlInterface
26 {
31  public const CMD_POST = 'post';
32 
36  public const PARAM_CSRF_TOKEN = 'rtoken';
37  public const PARAM_CID_PATH = 'cmdNode';
38  public const PARAM_REDIRECT = 'redirectSource';
39  public const PARAM_BASE_CLASS = 'baseClass';
40  public const PARAM_CMD_CLASS = 'cmdClass';
41  public const PARAM_CMD_MODE = 'cmdMode';
42  public const PARAM_CMD_FALLBACK = 'fallbackCmd';
43  public const PARAM_CMD = 'cmd';
44 
48  public const PROTECTED_PARAMETERS = [
49  self::PARAM_BASE_CLASS,
50  self::PARAM_CMD_CLASS,
51  self::PARAM_CID_PATH,
52  self::PARAM_CSRF_TOKEN,
53  ];
54 
58  public const CMD_MODE_PROCESS = 'execComm';
59  public const CMD_MODE_ASYNC = 'asynch';
60  public const CMD_MODE_HTML = 'getHtml';
61 
69  public function callBaseClass(string $a_base_class = null): void;
70 
82  public function forwardCommand(object $a_gui_object);
83 
93  public function getHTML(object $a_gui_object, array $a_parameters = null): string;
94 
101  public function getCmd(string $fallback_command = null): ?string;
102 
111  public function setCmd(?string $a_cmd): void;
112 
119  public function getCmdClass(): ?string;
120 
129  public function setCmdClass($a_cmd_class): void;
130 
139  public function getNextClass($a_gui_class = null): ?string;
140 
150  public function saveParameter(object $a_gui_obj, $a_parameter): void;
151 
167  public function saveParameterByClass(string $a_class, $a_parameter): void;
168 
179  public function setParameter(object $a_gui_obj, string $a_parameter, $a_value): void;
180 
193  public function setParameterByClass(string $a_class, string $a_parameter, $a_value): void;
194 
202  public function getParameterArray(object $a_gui_obj): array;
203 
211  public function getParameterArrayByClass(string $a_class): array;
212 
218  public function clearParameters(object $a_gui_obj): void;
219 
225  public function clearParametersByClass(string $a_class): void;
226 
233  public function clearParameterByClass(string $a_class, string $a_parameter): void;
234 
246  public function getLinkTarget(
247  object $a_gui_obj,
248  string $a_cmd = null,
249  string $a_anchor = null,
250  bool $is_async = false,
251  bool $has_xml_style = false
252  ): string;
253 
265  public function getLinkTargetByClass(
266  $a_class,
267  string $a_cmd = null,
268  string $a_anchor = null,
269  bool $is_async = false,
270  bool $has_xml_style = false
271  ): string;
272 
283  public function getFormAction(
284  object $a_gui_obj,
285  string $a_fallback_cmd = null,
286  string $a_anchor = null,
287  bool $is_async = false,
288  bool $has_xml_style = false
289  ): string;
290 
302  public function getFormActionByClass(
303  $a_class,
304  string $a_fallback_cmd = null,
305  string $a_anchor = null,
306  bool $is_async = false,
307  bool $has_xml_style = false
308  ): string;
309 
319  public function redirect(
320  object $a_gui_obj,
321  string $a_cmd = null,
322  string $a_anchor = null,
323  bool $is_async = false
324  ): void;
325 
335  public function redirectByClass(
336  $a_class,
337  string $a_cmd = null,
338  string $a_anchor = null,
339  bool $is_async = false
340  ): void;
341 
347  public function redirectToURL(string $target_url): void;
348 
358  public function setContextObject(int $obj_id, string $obj_type): void;
359 
368  public function getContextObjId(): ?int;
369 
378  public function getContextObjType(): ?string;
379 
385  public function getCallHistory(): array;
386 
395  public function lookupClassPath(string $a_class): string;
396 
403  public function lookupOriginalClassName(string $a_class): ?string;
404 
416  public function getClassForClasspath(string $a_class_path): string;
417 
423  public function setTargetScript(string $a_target_script): void;
424 
430  public function isAsynch(): bool;
431 
440  public function setReturn(object $a_gui_obj, string $a_cmd = null): void;
441 
450  public function setReturnByClass(string $a_class, string $a_cmd = null): void;
451 
461  public function getParentReturn(object $a_gui_obj): ?string;
462 
471  public function getParentReturnByClass(string $a_class): ?string;
472 
482  public function returnToParent(object $a_gui_obj, string $a_anchor = null): void;
483 
489  public function getRedirectSource(): ?string;
490 
504  public function insertCtrlCalls($a_parent, $a_child, string $a_comp_prefix): void;
505 
513  public function checkCurrentPathForClass(string $gui_class): bool;
514 
520  public function getCurrentClassPath(): array;
521 }
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.
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...
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.
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.
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.
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)