ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
interface.ilCtrlInterface.php
Go to the documentation of this file.
1<?php
2
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 = [
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
113 public function getCmdClass(): ?string;
114
123 public function getNextClass($a_gui_class = null): ?string;
124
134 public function saveParameter(object $a_gui_obj, $a_parameter): void;
135
151 public function saveParameterByClass(string $a_class, $a_parameter): void;
152
163 public function setParameter(object $a_gui_obj, string $a_parameter, $a_value): void;
164
177 public function setParameterByClass(string $a_class, string $a_parameter, $a_value): void;
178
186 public function getParameterArray(object $a_gui_obj): array;
187
195 public function getParameterArrayByClass(string $a_class): array;
196
202 public function clearParameters(object $a_gui_obj): void;
203
209 public function clearParametersByClass(string $a_class): void;
210
217 public function clearParameterByClass(string $a_class, string $a_parameter): void;
218
230 public function getLinkTarget(
231 object $a_gui_obj,
232 ?string $a_cmd = null,
233 ?string $a_anchor = null,
234 bool $is_async = false,
235 bool $has_xml_style = false
236 ): string;
237
249 public function getLinkTargetByClass(
250 $a_class,
251 ?string $a_cmd = null,
252 ?string $a_anchor = null,
253 bool $is_async = false,
254 bool $has_xml_style = false
255 ): string;
256
267 public function getFormAction(
268 object $a_gui_obj,
269 ?string $a_fallback_cmd = null,
270 ?string $a_anchor = null,
271 bool $is_async = false,
272 bool $has_xml_style = false
273 ): string;
274
286 public function getFormActionByClass(
287 $a_class,
288 ?string $a_fallback_cmd = null,
289 ?string $a_anchor = null,
290 bool $is_async = false,
291 bool $has_xml_style = false
292 ): string;
293
303 public function redirect(
304 object $a_gui_obj,
305 ?string $a_cmd = null,
306 ?string $a_anchor = null,
307 bool $is_async = false
308 ): void;
309
319 public function redirectByClass(
320 $a_class,
321 ?string $a_cmd = null,
322 ?string $a_anchor = null,
323 bool $is_async = false
324 ): void;
325
331 public function redirectToURL(string $target_url): void;
332
342 public function setContextObject(int $obj_id, string $obj_type): void;
343
352 public function getContextObjId(): ?int;
353
362 public function getContextObjType(): ?string;
363
369 public function getCallHistory(): array;
370
379 public function lookupClassPath(string $a_class): string;
380
387 public function lookupOriginalClassName(string $a_class): ?string;
388
400 public function getClassForClasspath(string $a_class_path): string;
401
407 public function setTargetScript(string $a_target_script): void;
408
414 public function isAsynch(): bool;
415
424 public function setReturn(object $a_gui_obj, ?string $a_cmd = null): void;
425
434 public function setReturnByClass(string $a_class, ?string $a_cmd = null): void;
435
445 public function getParentReturn(object $a_gui_obj): ?string;
446
455 public function getParentReturnByClass(string $a_class): ?string;
456
466 public function returnToParent(object $a_gui_obj, ?string $a_anchor = null): void;
467
473 public function getRedirectSource(): ?string;
474
488 public function insertCtrlCalls($a_parent, $a_child, string $a_comp_prefix): void;
489
497 public function checkCurrentPathForClass(string $gui_class): bool;
498
504 public function getCurrentClassPath(): array;
505
509 public function attachObserver(ilCtrlObserver $observer, ilCtrlEvent $event = ilCtrlEvent::ALL): void;
510
514 public function detachObserver(ilCtrlObserver $observer, ilCtrlEvent $event = ilCtrlEvent::ALL): void;
515}
ilCtrlEvent
@ ALL
event string being used if
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
clearParametersByClass(string $a_class)
Removes all currently set or saved parameters for the given GUI class.
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
Sets a parameter for the given GUI object and appends the given value.
getParameterArrayByClass(string $a_class)
Returns all parameters that have been saved or set for a given GUI class.
getCurrentClassPath()
Get current class path as array of class file names.
redirectToURL(string $target_url)
Redirects to the given target URL.
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
Redirects to the provided GUI class.
getContextObjId()
Returns the current context's object id.
isAsynch()
Returns whether the current request is an asynchronous one.
detachObserver(ilCtrlObserver $observer, ilCtrlEvent $event=ilCtrlEvent::ALL)
Detaches an observer from ALL or a specific.
setTargetScript(string $a_target_script)
Sets the current ilCtrl target script (default ilias.php).
attachObserver(ilCtrlObserver $observer, ilCtrlEvent $event=ilCtrlEvent::ALL)
Attaches an observer to ALL or a specific.
const PARAM_CSRF_TOKEN
$_GET request parameter names, used throughout ilCtrl.
saveParameterByClass(string $a_class, $a_parameter)
Sets a parameter for the given GUI class that must be passed in every target link generation.
setContextObject(int $obj_id, string $obj_type)
Sets the current object (id and type) of ilCtrl's context.
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.
clearParameters(object $a_gui_obj)
Removes all currently set or saved parameters for the given GUI object.
getCmdClass()
Returns the fully-qualified classname of the requested command class.
clearParameterByClass(string $a_class, string $a_parameter)
Removes a specific parameter of a specific class that is currently set or saved.
lookupClassPath(string $a_class)
Get class path that can be used in include statements for a given class name.
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.
getClassForClasspath(string $a_class_path)
Returns the effective classname for a given path.
forwardCommand(object $a_gui_object)
Forwards the request by invoking executeCommand() on the given GUI object and fires an according ilCt...
checkCurrentPathForClass(string $gui_class)
Check if current CID trace contains a certain gui class.
insertCtrlCalls($a_parent, $a_child, string $a_comp_prefix)
Inserts an ilCtrl call record into the database.
getNextClass($a_gui_class=null)
Returns the fully-qualified classname of the next class in the control flow.
getParentReturn(object $a_gui_obj)
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
Redirects to another GUI object.
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.
setReturn(object $a_gui_obj, ?string $a_cmd=null)
Sets the return command of a given GUI object.
callBaseClass(?string $a_base_class=null)
Calls the currently provided baseclass.
getParameterArray(object $a_gui_obj)
Returns all parameters that have been saved or set for a GUI object.
getRedirectSource()
Returns the current redirect source.
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.
getContextObjType()
Returns the current context's object type.
getCallHistory()
Returns the descending stacktrace of ilCtrl calls that have been made.
getCmd(?string $fallback_command=null)
Returns the command passed with the current POST or GET request and fires an according ilCtrlEvent.
saveParameter(object $a_gui_obj, $a_parameter)
Sets parameters for the given object.
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.
const CMD_MODE_PROCESS
different modes used for UI plugins (or in dev-mode).
setReturnByClass(string $a_class, ?string $a_cmd=null)
Sets the return command of a given class.
setParameterByClass(string $a_class, string $a_parameter, $a_value)
Sets a parameter for the given GUI class and appends the given value as well.
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.
getParentReturnByClass(string $a_class)