ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilCtrl Class Reference

Class ilCtrl provides processing control methods. More...

+ Inheritance diagram for ilCtrl:
+ Collaboration diagram for ilCtrl:

Public Member Functions

 __construct (protected ilCtrlStructureInterface $structure, protected ilCtrlTokenRepositoryInterface $token_repository, protected ilCtrlPathFactoryInterface $path_factory, protected ilCtrlContextInterface $context, protected ResponseSenderStrategy $response_sender, protected ServerRequestInterface $server_request, protected RequestWrapper $post_parameters, protected RequestWrapper $get_parameters, protected Refinery $refinery, protected ilComponentFactory $component_factory, protected ilCtrlSubject $subject, protected ilCtrlQueryParserInterface $query_parser,)
 
 __clone ()
 
 callBaseClass (string $a_base_class=null)
 
 forwardCommand (object $a_gui_object)
 
 getHTML (object $a_gui_object, array $a_parameters=null)
 
 getCmd (string $fallback_command=null)
 
 setCmd (?string $a_cmd)
 
 getCmdClass ()
 
 setCmdClass ($a_cmd_class)
 
 getNextClass ($a_gui_class=null)
 
 saveParameter (object $a_gui_obj, $a_parameter)
 
 saveParameterByClass (string $a_class, $a_parameter)
 
 setParameter (object $a_gui_obj, string $a_parameter, $a_value)
 
 setParameterByClass (string $a_class, string $a_parameter, $a_value)
 
 getParameterArray (object $a_gui_obj)
 
 getParameterArrayByClass (string $a_class)
 
 clearParameters (object $a_gui_obj)
 
 clearParametersByClass (string $a_class)
 
 clearParameterByClass (string $a_class, string $a_parameter)
 
 getLinkTarget (object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
 
 getLinkTargetByClass ( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
 
 getFormAction (object $a_gui_obj, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
 
 getFormActionByClass ( $a_class, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
 
 redirect (object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
 
 redirectByClass ( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
 
 redirectToURL (string $target_url)
 
 setContextObject (int $obj_id, string $obj_type)
 
 getContextObjId ()
 
 getContextObjType ()
 
 getCallHistory ()
 
 lookupClassPath (string $a_class)
 
 lookupOriginalClassName (string $a_class)
 
 getClassForClasspath (string $a_class_path)
 
 setTargetScript (string $a_target_script)
 
 isAsynch ()
 
 setReturn (object $a_gui_obj, string $a_cmd=null)
 
 setReturnByClass (string $a_class, string $a_cmd=null)
 
 returnToParent (object $a_gui_obj, string $a_anchor=null)
 
 getParentReturn (object $a_gui_obj)
 
 getParentReturnByClass (string $a_class)
 
 getRedirectSource ()
 
 insertCtrlCalls ($a_parent, $a_child, string $a_comp_prefix)
 
 checkCurrentPathForClass (string $gui_class)
 
 getCurrentClassPath ()
 
 attachObserver (ilCtrlObserver $observer, ilCtrlEvent $event=ilCtrlEvent::ALL)
 
 detachObserver (ilCtrlObserver $observer, ilCtrlEvent $event=ilCtrlEvent::ALL)
 

Protected Member Functions

 getDeterminedCommand ()
 

Protected Attributes

object $exec_object = null
 
string $command = null
 
array $stacktrace = []
 

Private Member Functions

 getQueryParam (string $parameter_name)
 Returns a parameter with the given name from the current GET request. More...
 
 getTableCommand ()
 
 getPostCommand ()
 Returns the current $_POST command. More...
 
 getTargetUrl ( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $is_escaped=false, bool $is_post=false)
 Helper function that returns a target URL string. More...
 
 isCmdSecure (bool $is_post, string $cmd_class, string $cmd=null)
 Returns whether a given command is considered safe or not. More...
 
 appendParameterStringsByClass (string $class_name, string $target_url, bool $is_escaped=false)
 Appends all parameters for a given class to the given URL. More...
 
 populateCall (string $class_name, string $cmd_mode)
 Helper function that populates a call in the current stacktrace. More...
 
 getClassByObject ($object)
 Helper function that returns the class name of a mixed (object or string) parameter. More...
 

Additional Inherited Members

- Data Fields inherited from ilCtrlInterface
const CMD_POST = 'post'
 
const PARAM_CSRF_TOKEN = 'rtoken'
 $_GET request parameter names, used throughout ilCtrl. More...
 
const PARAM_CID_PATH = 'cmdNode'
 
const PARAM_REDIRECT = 'redirectSource'
 
const PARAM_BASE_CLASS = 'baseClass'
 
const PARAM_CMD_CLASS = 'cmdClass'
 
const PARAM_CMD_MODE = 'cmdMode'
 
const PARAM_CMD_FALLBACK = 'fallbackCmd'
 
const PARAM_CMD = 'cmd'
 
const PROTECTED_PARAMETERS
 
const CMD_MODE_PROCESS = 'execComm'
 different modes used for UI plugins (or in dev-mode). More...
 
const CMD_MODE_ASYNC = 'asynch'
 
const CMD_MODE_HTML = 'getHtml'
 

Detailed Description

Class ilCtrl provides processing control methods.

A global instance is available through $DIC->ctrl() or $ilCtrl.

Author
Thibeau Fuhrer thf@s.nosp@m.tude.nosp@m.r.rai.nosp@m.mann.nosp@m..ch AutoloadingIssuesInspection

Definition at line 35 of file class.ilCtrl.php.

Constructor & Destructor Documentation

◆ __construct()

ilCtrl::__construct ( protected ilCtrlStructureInterface  $structure,
protected ilCtrlTokenRepositoryInterface  $token_repository,
protected ilCtrlPathFactoryInterface  $path_factory,
protected ilCtrlContextInterface  $context,
protected ResponseSenderStrategy  $response_sender,
protected ServerRequestInterface  $server_request,
protected RequestWrapper  $post_parameters,
protected RequestWrapper  $get_parameters,
protected Refinery  $refinery,
protected ilComponentFactory  $component_factory,
protected ilCtrlSubject  $subject,
protected ilCtrlQueryParserInterface  $query_parser 
)

Definition at line 47 of file class.ilCtrl.php.

60  {
61  }

Member Function Documentation

◆ __clone()

ilCtrl::__clone ( )

Definition at line 63 of file class.ilCtrl.php.

References $structure.

64  {
65  $this->structure = clone $this->structure;
66  }
$structure
TOTAL STRUCTURE.

◆ appendParameterStringsByClass()

ilCtrl::appendParameterStringsByClass ( string  $class_name,
string  $target_url,
bool  $is_escaped = false 
)
private

Appends all parameters for a given class to the given URL.

Parameters
string$class_name
string$target_url
bool$is_escaped
Returns
string
Exceptions
ilCtrlException

Definition at line 1076 of file class.ilCtrl.php.

References ILIAS\LTI\ToolProvider\$key, $url, getParameterArrayByClass(), and ILIAS\Repository\refinery().

Referenced by getTargetUrl().

1080  : string {
1081  $class_parameters = $this->getParameterArrayByClass($class_name);
1082  if (!empty($class_parameters)) {
1083  foreach ($class_parameters as $key => $value) {
1084  $target_url = $this->appendParameterString(
1085  $target_url,
1086  $key,
1087  $value,
1088  $is_escaped
1089  );
1090  }
1091  }
1092 
1093  return $target_url;
1094  }
string $key
Consumer key/client ID value.
Definition: System.php:193
getParameterArrayByClass(string $a_class)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ attachObserver()

ilCtrl::attachObserver ( ilCtrlObserver  $observer,
ilCtrlEvent  $event = ilCtrlEvent::ALL 
)

Implements ilCtrlInterface.

Definition at line 726 of file class.ilCtrl.php.

726  : void
727  {
728  $this->subject->attach($observer, $event);
729  }

◆ callBaseClass()

ilCtrl::callBaseClass ( string  $a_base_class = null)

Implements ilCtrlInterface.

Definition at line 71 of file class.ilCtrl.php.

References forwardCommand().

71  : void
72  {
73  // prioritise the context's baseclass over the given one.
74  $a_base_class = $this->context->getBaseClass() ?? $a_base_class;
75 
76  // abort if no baseclass was provided.
77  if (null === $a_base_class) {
78  throw new ilCtrlException(__METHOD__ . " was not given a baseclass and the request doesn't include one either.");
79  }
80 
81  // abort if the provided baseclass is unknown.
82  if (!$this->structure->isBaseClass($a_base_class)) {
83  throw new ilCtrlException("Provided class '$a_base_class' is not a baseclass");
84  }
85 
86  // in case the baseclass was given by argument,
87  // set the context's baseclass.
88  $this->context->setBaseClass($a_base_class);
89 
90  // no null-check needed as previous isBaseClass() was true.
91  $obj_name = $this->structure->getObjNameByName($a_base_class);
92  $this->forwardCommand(new $obj_name());
93  }
forwardCommand(object $a_gui_object)
ilCtrl exceptions
+ Here is the call graph for this function:

◆ checkCurrentPathForClass()

ilCtrl::checkCurrentPathForClass ( string  $gui_class)

Implements ilCtrlInterface.

Definition at line 693 of file class.ilCtrl.php.

693  : bool
694  {
695  $class_cid = $this->structure->getClassCidByName($gui_class);
696  if (null === $class_cid) {
697  return false;
698  }
699 
700  return strpos(
701  $this->context->getPath()->getCidPath() ?? '',
702  $class_cid
703  ) !== false;
704  }

◆ clearParameterByClass()

ilCtrl::clearParameterByClass ( string  $a_class,
string  $a_parameter 
)

Implements ilCtrlInterface.

Definition at line 334 of file class.ilCtrl.php.

334  : void
335  {
336  $this->structure->removeSingleParameterByClass($a_class, $a_parameter);
337  }

◆ clearParameters()

ilCtrl::clearParameters ( object  $a_gui_obj)

Implements ilCtrlInterface.

Definition at line 315 of file class.ilCtrl.php.

References clearParametersByClass(), and getClassByObject().

315  : void
316  {
317  $this->clearParametersByClass($this->getClassByObject($a_gui_obj));
318  }
getClassByObject($object)
Helper function that returns the class name of a mixed (object or string) parameter.
clearParametersByClass(string $a_class)
+ Here is the call graph for this function:

◆ clearParametersByClass()

ilCtrl::clearParametersByClass ( string  $a_class)

Implements ilCtrlInterface.

Definition at line 323 of file class.ilCtrl.php.

Referenced by ilObjExerciseGUI\addContentSubTabs(), clearParameters(), and ilExAssignmentInfo\getInstructionFileInfo().

323  : void
324  {
325  // apparently permanent parameters should not be removable,
326  // therefore the line below stays commented:
327  // $this->structure->removePermanentParametersByClass($a_class);
328  $this->structure->removeTemporaryParametersByClass($a_class);
329  }
+ Here is the caller graph for this function:

◆ detachObserver()

ilCtrl::detachObserver ( ilCtrlObserver  $observer,
ilCtrlEvent  $event = ilCtrlEvent::ALL 
)

Implements ilCtrlInterface.

Definition at line 734 of file class.ilCtrl.php.

734  : void
735  {
736  $this->subject->detach($observer, $event);
737  }

◆ forwardCommand()

ilCtrl::forwardCommand ( object  $a_gui_object)

Implements ilCtrlInterface.

Definition at line 98 of file class.ilCtrl.php.

References populateCall().

Referenced by callBaseClass(), ilGroupUserActionsGUI\executeCommand(), ilAchievementsGUI\executeCommand(), ilPortfolioRoleAssignmentGUI\executeCommand(), ilObjLearningHistorySettingsGUI\executeCommand(), ilContainerSkillGUI\executeCommand(), ilObjCommentsSettingsGUI\executeCommand(), ilContSkillPresentationGUI\executeCommand(), McstPodcastGUI\executeCommand(), ilObjNotesSettingsGUI\executeCommand(), ilObjPersonalWorkspaceSettingsGUI\executeCommand(), ilSkillTreeAdminGUI\executeCommand(), ilObjStyleSheetGUI\executeCommand(), ilNewsTimelineGUI\executeCommand(), ilBookingGatewayGUI\executeCommand(), and ilMediaCreationGUI\executeCommand().

99  {
100  $class_name = get_class($a_gui_object);
101 
102  // @TODO: remove this check once an interface for command classes exists.
103  if (!method_exists($a_gui_object, 'executeCommand')) {
104  throw new ilCtrlException("$class_name doesn't implement executeCommand().");
105  }
106 
107  $this->exec_object = $a_gui_object;
108  $this->populateCall($class_name, self::CMD_MODE_PROCESS);
109 
110  // with forward command we cannot progress, or set
111  // the current command class. Otherwise, the path-
112  // finding gets mixed up, as it can only be used in
113  // getHTML() method calls.
114  $this->context
115  ->setCmdMode(self::CMD_MODE_PROCESS);
116 
117  $this->subject->notify(ilCtrlEvent::COMMAND_CLASS_FORWARD, $class_name);
118 
119  return $a_gui_object->executeCommand();
120  }
ilCtrl exceptions
populateCall(string $class_name, string $cmd_mode)
Helper function that populates a call in the current stacktrace.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCallHistory()

ilCtrl::getCallHistory ( )

Implements ilCtrlInterface.

Definition at line 550 of file class.ilCtrl.php.

References $stacktrace.

550  : array
551  {
552  return $this->stacktrace;
553  }
array $stacktrace

◆ getClassByObject()

ilCtrl::getClassByObject (   $object)
private

Helper function that returns the class name of a mixed (object or string) parameter.

Parameters
object | string$object
Returns
string

Definition at line 1161 of file class.ilCtrl.php.

Referenced by clearParameters(), getFormAction(), getLinkTarget(), getNextClass(), getParameterArray(), getParentReturn(), redirect(), returnToParent(), saveParameter(), setParameter(), and setReturn().

1161  : string
1162  {
1163  return (is_object($object)) ? get_class($object) : $object;
1164  }
+ Here is the caller graph for this function:

◆ getClassForClasspath()

ilCtrl::getClassForClasspath ( string  $a_class_path)

Implements ilCtrlInterface.

Definition at line 579 of file class.ilCtrl.php.

579  : string
580  {
581  $path_info = pathinfo($a_class_path);
582 
583  return substr($path_info['basename'], 6, -4);
584  }

◆ getCmd()

ilCtrl::getCmd ( string  $fallback_command = null)

Implements ilCtrlInterface.

Definition at line 158 of file class.ilCtrl.php.

References $command, and getDeterminedCommand().

Referenced by ilGroupUserActionsGUI\executeCommand(), ilObjNotificationSettingsGUI\executeCommand(), ilAchievementsGUI\executeCommand(), ilSurveySkillDeterminationGUI\executeCommand(), ilMediaPoolImportGUI\executeCommand(), ilIIMEditorServerAdapterGUI\executeCommand(), ilPageEditorServerAdapterGUI\executeCommand(), ilLMImportGUI\executeCommand(), ilPortfolioRoleAssignmentGUI\executeCommand(), ilExcRandomAssignmentGUI\executeCommand(), ilSurveySkillGUI\executeCommand(), ilSurveySkillThresholdsGUI\executeCommand(), ilAccordionPropertiesStorageGUI\executeCommand(), ilContainerBlockPropertiesStorageGUI\executeCommand(), ilExAssTypeWikiTeamGUI\executeCommand(), ilContainerFilterAdminGUI\executeCommand(), ilBookingPreferencesGUI\executeCommand(), ilTablePropertiesStorageGUI\executeCommand(), ilObjLearningHistorySettingsGUI\executeCommand(), ilRecommendedContentRoleConfigGUI\executeCommand(), ilPCQuestionGUI\executeCommand(), ilObjCommentsSettingsGUI\executeCommand(), McstPodcastGUI\executeCommand(), ilSurveyConstraintsGUI\executeCommand(), ilObjNotesSettingsGUI\executeCommand(), ilDerivedTasksGUI\executeCommand(), ilObjPersonalWorkspaceSettingsGUI\executeCommand(), ilAssignmentPresentationGUI\executeCommand(), ilTaggingSlateContentGUI\executeCommand(), ilClassificationBlockGUI\executeCommand(), ilLearningHistoryGUI\executeCommand(), ilPDTasksBlockGUI\executeCommand(), ilSkillTreeAdminGUI\executeCommand(), ilTaxonomySettingsGUI\executeCommand(), ilGroupAddToGroupActionGUI\executeCommand(), ilBookingProcessWithoutScheduleGUI\executeCommand(), ilBookingReservationsGUI\executeCommand(), ilBookingProcessWithScheduleGUI\executeCommand(), ilObjStyleSheetGUI\executeCommand(), ilBookingGatewayGUI\executeCommand(), ilMediaCreationGUI\executeCommand(), and ilContainerGUI\forwardToPageObject().

158  : ?string
159  {
160  $command = $this->getDeterminedCommand() ?? $fallback_command;
161  if (null !== $this->command && $command === $this->command) {
162  // don't broadcast command determination event on consecutive
163  // method calls.
164  return $command;
165  }
166 
167  $this->subject->notify(ilCtrlEvent::COMMAND_DETERMINATION, $command);
168  $this->command = $command;
169 
170  return $command ?? ''; // remove null-coalesce
171  }
getDeterminedCommand()
string $command
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCmdClass()

ilCtrl::getCmdClass ( )

Implements ilCtrlInterface.

Definition at line 190 of file class.ilCtrl.php.

190  : ?string
191  {
192  if (null !== ($cmd_class = $this->context->getCmdClass())) {
193  return strtolower($this->structure->getObjNameByName($cmd_class));
194  }
195 
196  return '';
197  }

◆ getContextObjId()

ilCtrl::getContextObjId ( )

Implements ilCtrlInterface.

Definition at line 534 of file class.ilCtrl.php.

534  : ?int
535  {
536  return $this->context->getObjId();
537  }

◆ getContextObjType()

ilCtrl::getContextObjType ( )

Implements ilCtrlInterface.

Definition at line 542 of file class.ilCtrl.php.

542  : ?string
543  {
544  return $this->context->getObjType();
545  }

◆ getCurrentClassPath()

ilCtrl::getCurrentClassPath ( )

Implements ilCtrlInterface.

Definition at line 709 of file class.ilCtrl.php.

Referenced by ilObjGlossaryGUI\showTaxonomy(), and ilObjTaxonomyGUI\showTree().

709  : array
710  {
711  if (null === $this->context->getPath()->getCidPath()) {
712  return [];
713  }
714 
715  $class_paths = [];
716  foreach ($this->context->getPath()->getCidArray(SORT_ASC) as $cid) {
717  $class_paths[] = $this->structure->getObjNameByCid($cid);
718  }
719 
720  return $class_paths;
721  }
+ Here is the caller graph for this function:

◆ getDeterminedCommand()

ilCtrl::getDeterminedCommand ( )
protected

Definition at line 739 of file class.ilCtrl.php.

References $command, getPostCommand(), getQueryParam(), getTableCommand(), and isCmdSecure().

Referenced by getCmd(), and populateCall().

739  : ?string
740  {
741  // retrieve $_GET and $_POST parameters.
742  $post_command = $this->getPostCommand();
743  $get_command = $this->getQueryParam(self::PARAM_CMD);
744  $table_command = $this->getTableCommand();
745 
746  $is_post = (self::CMD_POST === $get_command);
747 
748  // if the $_GET command is 'post', either the $_POST
749  // command or $_GETs fallback command is used.
750  // for now, the table command is used as fallback as well,
751  // but this will be removed once the implementation of
752  // table actions change.
753  $command = ($is_post) ?
754  $post_command ?? $table_command ?? $this->getQueryParam(self::PARAM_CMD_FALLBACK) :
755  $get_command;
756 
757  // override the command that has been set during a
758  // request via ilCtrl::setCmd().
759  $context_command = $this->context->getCmd();
760  if (null !== $context_command && self::CMD_POST !== $context_command) {
761  $command = $context_command;
762  }
763 
764  if (null === $command) {
765  return $command;
766  }
767 
768  // if the command is for post requests, or the command
769  // is not considered safe, the csrf-validation must pass.
770  $cmd_class = $this->context->getCmdClass();
771  if (null !== $cmd_class && !$this->isCmdSecure($is_post, $cmd_class, $command)) {
772  $stored_token = $this->token_repository->getToken();
773  $sent_token = $this->getQueryParam(self::PARAM_CSRF_TOKEN);
774 
775  if (null !== $sent_token && $stored_token->verifyWith($sent_token)) {
776  return $command;
777  }
778  return null;
779  }
780 
781  return $command;
782  }
getPostCommand()
Returns the current $_POST command.
isCmdSecure(bool $is_post, string $cmd_class, string $cmd=null)
Returns whether a given command is considered safe or not.
getTableCommand()
getQueryParam(string $parameter_name)
Returns a parameter with the given name from the current GET request.
string $command
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFormAction()

ilCtrl::getFormAction ( object  $a_gui_obj,
string  $a_fallback_cmd = null,
string  $a_anchor = null,
bool  $is_async = false,
bool  $has_xml_style = false 
)

Implements ilCtrlInterface.

Definition at line 380 of file class.ilCtrl.php.

References getClassByObject(), and getFormActionByClass().

Referenced by ilBookingBulkCreationTableGUI\__construct(), ilTermDefinitionBulkCreationTableGUI\__construct(), ilExAssignmentTeamLogTableGUI\__construct(), ilParticipantsPerAssignmentTableGUI\__construct(), ilFeedbackConfirmationTable2GUI\__construct(), ilAddAnswerFormBuilder\__construct(), ILIAS\Style\Content\CharacteristicTableGUI\__construct(), ilTestSkillLevelThresholdsTableGUI\__construct(), ilPortfolioRoleAssignmentGUI\confirmAssignmentDeletion(), ilContSkillAdminGUI\confirmDeleteSelectedLocalProfiles(), ilContSkillAdminGUI\confirmDeleteSingleLocalProfile(), ilContSkillAdminGUI\confirmRemoveSelectedGlobalProfiles(), ilContSkillAdminGUI\confirmRemoveSelectedSkill(), ilContSkillAdminGUI\confirmRemoveSingleGlobalProfile(), ilContSkillAdminGUI\deassignCompetencesConfirm(), ilObjStyleSheetGUI\deleteObject(), ilMediaCreationGUI\editTitlesAndDescriptions(), ilObjMediaPoolGUI\editTitlesAndDescriptions(), ilExSubmissionTeamGUI\getAdoptForm(), ilObjStyleSheetGUI\getCloneForm(), ilObjStyleSheetGUI\getCreateForm(), ilObjStyleSheetGUI\getImportForm(), ilPCAMDFormGUI\getPortfolioForm(), ilPortfolioRoleAssignmentGUI\initAssignmentForm(), ilUserProfileInfoSettingsGUI\initForm(), ilObjNotificationSettingsGUI\initForm(), ilMediaCreationGUI\initPoolSelection(), ilObjStyleSheetGUI\initPropertiesForm(), ilBookingGatewayGUI\initSettingsForm(), ilContSkillAdminGUI\initSettingsForm(), ilMediaCreationGUI\initUrlForm(), and ilContSkillAdminGUI\listProfiles().

386  : string {
387  return $this->getFormActionByClass(
388  $this->getClassByObject($a_gui_obj),
389  $a_fallback_cmd,
390  $a_anchor,
391  $is_async,
392  $has_xml_style
393  );
394  }
getClassByObject($object)
Helper function that returns the class name of a mixed (object or string) parameter.
getFormActionByClass( $a_class, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFormActionByClass()

ilCtrl::getFormActionByClass (   $a_class,
string  $a_fallback_cmd = null,
string  $a_anchor = null,
bool  $is_async = false,
bool  $has_xml_style = false 
)

Implements ilCtrlInterface.

Definition at line 399 of file class.ilCtrl.php.

References getTargetUrl().

Referenced by ilPortfolioTemplatePageGUI\getCourseSortAction(), ilPortfolioPageGUI\getCourseSortAction(), and getFormAction().

405  : string {
406  return $this->getTargetUrl(
407  $a_class,
408  $a_fallback_cmd,
409  $a_anchor,
410  $is_async,
411  $has_xml_style,
412  true
413  ) ?? '';
414  }
getTargetUrl( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $is_escaped=false, bool $is_post=false)
Helper function that returns a target URL string.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilCtrl::getHTML ( object  $a_gui_object,
array  $a_parameters = null 
)

Implements ilCtrlInterface.

Definition at line 125 of file class.ilCtrl.php.

References $context, $exec_object, $structure, and populateCall().

125  : string
126  {
127  $class_name = get_class($a_gui_object);
128 
129  // @TODO: remove this check once an interface for command classes exists.
130  if (!method_exists($a_gui_object, 'getHTML')) {
131  throw new ilCtrlException("$class_name doesn't implement getHTML().");
132  }
133 
134  $isolatad_structure = $this->structure;
135  $isolated_context = $this->context;
136  $isolated_object = $this->exec_object;
137 
138  $this->exec_object = $a_gui_object;
139  $this->populateCall($class_name, self::CMD_MODE_HTML);
140  $this->context
141  ->setCmdClass($class_name)
142  ->setCmdMode(self::CMD_MODE_HTML);
143 
144  $html = (null !== $a_parameters) ?
145  $a_gui_object->getHTML($a_parameters) :
146  $a_gui_object->getHTML();
147 
148  $this->structure = $isolatad_structure;
149  $this->context = $isolated_context;
150  $this->exec_object = $isolated_object;
151 
152  return $html;
153  }
$context
Definition: webdav.php:31
object $exec_object
$structure
TOTAL STRUCTURE.
ilCtrl exceptions
populateCall(string $class_name, string $cmd_mode)
Helper function that populates a call in the current stacktrace.
+ Here is the call graph for this function:

◆ getLinkTarget()

ilCtrl::getLinkTarget ( object  $a_gui_obj,
string  $a_cmd = null,
string  $a_anchor = null,
bool  $is_async = false,
bool  $has_xml_style = false 
)

Implements ilCtrlInterface.

Definition at line 342 of file class.ilCtrl.php.

References getClassByObject(), and getLinkTargetByClass().

Referenced by ilObjWorkspaceFolderGUI\addContentSubTabs(), ilObjExerciseGUI\addContentSubTabs(), ilTaxMDGUI\addSubTab(), ilGroupAddToGroupActionGUI\confirmAddUser(), ilLMPageObjectGUI\create(), ilContainerFilterAdminGUI\executeCommand(), ilContSkillMemberTableGUI\fillRow(), ilCopySelfAssQuestionTableGUI\fillRow(), ilContProfileTableGUI\fillRow(), ilObjLearningHistorySettingsGUI\getAdminTabs(), ilObjCommentsSettingsGUI\getAdminTabs(), ilObjNotesSettingsGUI\getAdminTabs(), ilObjPersonalWorkspaceSettingsGUI\getAdminTabs(), ilContainerFilterAdminGUI\getFieldSelectionForm(), ilNoteGUI\getGlyph(), ilLikeGUI\getHTML(), ilNoteGUI\getNumber(), ilObjPortfolioGUI\getOfflineMessage(), ilPortfolioRepositoryGUI\getPortfolioList(), ilObjContentObjectGUI\getPublicAccessColValue(), ilPCAMDFormGUI\getTemplateForm(), ilNoteGUI\getTriggerShyButton(), ilNoteGUI\getWidget(), ilObjPortfolioAdministrationGUI\initAuthorshipForm(), ilObjLearningHistorySettingsGUI\initForm(), ilObjCommentsSettingsGUI\initForm(), ilObjNotesSettingsGUI\initForm(), ilObjBookingPoolGUI\initHeaderAction(), ilStructureObjectGUI\initInsertTemplateForm(), ilLMPageObjectGUI\initNewPageForm(), ilBookingPreferencesGUI\initPreferenceForm(), ilObjSkillTreeGUI\initTreeForm(), ilStructureObjectGUI\insertTemplate(), ilContSkillAdminGUI\listCompetences(), ilRecommendedContentRoleConfigGUI\listItems(), ilMediaCreationGUI\listPoolItems(), ilTaggingClassificationProvider\render(), ilLearningHistoryGUI\renderButton(), ilContainerRenderer\renderHelperGeneric(), ilTaggingSlateContentGUI\renderResourcesForTag(), ilObjDashboardSettingsGUI\setSettingsSubTabs(), ilBookingGatewayGUI\setSubTabs(), ilPDNotesGUI\setToolbar(), ilGroupAddToGroupActionGUI\show(), ilSkillRootGUI\showImportForm(), and ilSkillProfileGUI\showLevelsWithLocalContext().

348  : string {
349  return $this->getLinkTargetByClass(
350  $this->getClassByObject($a_gui_obj),
351  $a_cmd,
352  $a_anchor,
353  $is_async,
354  $has_xml_style
355  );
356  }
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
getClassByObject($object)
Helper function that returns the class name of a mixed (object or string) parameter.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLinkTargetByClass()

ilCtrl::getLinkTargetByClass (   $a_class,
string  $a_cmd = null,
string  $a_anchor = null,
bool  $is_async = false,
bool  $has_xml_style = false 
)

Implements ilCtrlInterface.

Definition at line 361 of file class.ilCtrl.php.

References getTargetUrl().

Referenced by ilBlockGUI\addRepoCommands(), ilContainerSkillGUI\addTabs(), ilExAssTypeWikiTeamGUI\buildSubmissionPropertiesAndActions(), ilSkillProfileGUI\createLocal(), ilContProfileTableGUI\fillRow(), ilBookingParticipantsTableGUI\fillRow(), ilKSDocumentationGotoLink\generateRedirectURL(), ilContainerPageGUI\getAdditionalPageActions(), ilObjLearningHistorySettingsGUI\getAdminTabs(), ilObjCommentsSettingsGUI\getAdminTabs(), ilObjNotesSettingsGUI\getAdminTabs(), ilObjPersonalWorkspaceSettingsGUI\getAdminTabs(), ilNoteGUI\getButton(), ilAccessibilitySupportContactsGUI\getFooterLink(), ilSurveyContainsDataMessageBoxGUI\getHTML(), McstPodcastGUI\getHTML(), ilExAssignmentInfo\getInstructionFileInfo(), ilAchievementsGUI\getLinks(), getLinkTarget(), ilPortfolioRepositoryGUI\getPortfolioList(), ilNoteGUI\getShyButton(), ilPageObjectGUI\getTinyMenu(), ilPortfolioTemplatePageGUI\getViewPageLink(), ilPortfolioPageGUI\getViewPageLink(), ilHelpGUI\initHelp(), ilBookingPreferencesGUI\listBookingResults(), ilContSkillAdminGUI\listProfiles(), ilSkillTreeAdminGUI\listTrees(), redirectByClass(), ilExAssTypeWikiTeamGUI\renderOverviewContent(), setReturnByClass(), ilBookingGatewayGUI\setSubTabs(), ilPDNotesGUI\setToolbar(), and ilSkillProfileGUI\showLevelsWithLocalContext().

367  : string {
368  return $this->getTargetUrl(
369  $a_class,
370  $a_cmd,
371  $a_anchor,
372  $is_async,
373  $has_xml_style
374  ) ?? '';
375  }
getTargetUrl( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $is_escaped=false, bool $is_post=false)
Helper function that returns a target URL string.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNextClass()

ilCtrl::getNextClass (   $a_gui_class = null)

Implements ilCtrlInterface.

Definition at line 214 of file class.ilCtrl.php.

References getClassByObject().

Referenced by ilGroupUserActionsGUI\executeCommand(), ilObjNotificationSettingsGUI\executeCommand(), ilAchievementsGUI\executeCommand(), ilExSubmissionTextGUI\executeCommand(), ilPageEditorServerAdapterGUI\executeCommand(), ilIIMEditorServerAdapterGUI\executeCommand(), ilObjPluginDispatchGUI\executeCommand(), ilPortfolioRoleAssignmentGUI\executeCommand(), ilExcCriteriaGUI\executeCommand(), ilExcRandomAssignmentGUI\executeCommand(), ilExAssTypeWikiTeamGUI\executeCommand(), ilFormPropertyDispatchGUI\executeCommand(), ilBookingPreferencesGUI\executeCommand(), ilContainerFilterAdminGUI\executeCommand(), ilObjLearningHistorySettingsGUI\executeCommand(), ilWikiStatGUI\executeCommand(), ilPageMultiLangGUI\executeCommand(), ilRecommendedContentRoleConfigGUI\executeCommand(), McstImageGalleryGUI\executeCommand(), ilBookingScheduleGUI\executeCommand(), ilBookingParticipantGUI\executeCommand(), McstPodcastGUI\executeCommand(), ilObjCommentsSettingsGUI\executeCommand(), ilSurveyRaterGUI\executeCommand(), ilObjNotesSettingsGUI\executeCommand(), ilDerivedTasksGUI\executeCommand(), ilObjPersonalWorkspaceSettingsGUI\executeCommand(), ilImageMapEditorGUI\executeCommand(), ilAssignmentPresentationGUI\executeCommand(), ilTaggingGUI\executeCommand(), ilRatingGUI\executeCommand(), ilTaggingSlateContentGUI\executeCommand(), ilBadgeManagementGUI\executeCommand(), ilRepositoryObjectSearchBlockGUI\executeCommand(), ilLearningHistoryGUI\executeCommand(), ilRatingCategoryGUI\executeCommand(), ilWikiImportantPagesBlockGUI\executeCommand(), ilExSubmissionTeamGUI\executeCommand(), ilSkillTreeAdminGUI\executeCommand(), ilWikiFunctionsBlockGUI\executeCommand(), ilTaxonomySettingsGUI\executeCommand(), ilGroupAddToGroupActionGUI\executeCommand(), ilObjSCORM2004LearningModuleGUI\executeCommand(), ilLikeGUI\executeCommand(), ilPropertyFormGUI\executeCommand(), ilExSubmissionGUI\executeCommand(), ilBookingProcessWithoutScheduleGUI\executeCommand(), ilBookingProcessWithScheduleGUI\executeCommand(), ilBookingReservationsGUI\executeCommand(), ilObjStyleSheetGUI\executeCommand(), ilPDNewsBlockGUI\executeCommand(), ilBookingGatewayGUI\executeCommand(), ilMediaCreationGUI\executeCommand(), ilNewsForContextBlockGUI\executeCommand(), ilBookingObjectGUI\getPoolOverallLimit(), and ilTable2GUI\getSelectedColumns().

214  : ?string
215  {
216  if (null === $a_gui_class && null === $this->exec_object) {
217  return '';
218  }
219 
220  if (null === $this->context->getPath()) {
221  return '';
222  }
223 
224  $next_cid = $this->context->getPath()->getNextCid(
225  $this->getClassByObject($a_gui_class ?? $this->exec_object)
226  );
227 
228  if (null !== $next_cid) {
229  return strtolower($this->structure->getObjNameByCid($next_cid) ?? '');
230  }
231 
232  return '';
233  }
getClassByObject($object)
Helper function that returns the class name of a mixed (object or string) parameter.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParameterArray()

ilCtrl::getParameterArray ( object  $a_gui_obj)

Implements ilCtrlInterface.

Definition at line 278 of file class.ilCtrl.php.

References getClassByObject(), and getParameterArrayByClass().

278  : array
279  {
280  return $this->getParameterArrayByClass($this->getClassByObject($a_gui_obj));
281  }
getClassByObject($object)
Helper function that returns the class name of a mixed (object or string) parameter.
getParameterArrayByClass(string $a_class)
+ Here is the call graph for this function:

◆ getParameterArrayByClass()

ilCtrl::getParameterArrayByClass ( string  $a_class)

Implements ilCtrlInterface.

Definition at line 286 of file class.ilCtrl.php.

References ILIAS\LTI\ToolProvider\$key, and getQueryParam().

Referenced by appendParameterStringsByClass(), and getParameterArray().

286  : array
287  {
288  if (null === $this->structure->getClassCidByName($a_class)) {
289  throw new ilCtrlException("Cannot find provided class '$a_class' in the control structure.");
290  }
291 
292  $parameters = [];
293  $permanent_parameters = $this->structure->getPermanentParametersByClass($a_class);
294  if (null !== $permanent_parameters) {
295  foreach ($permanent_parameters as $parameter) {
296  $parameters[$parameter] = $this->getQueryParam($parameter);
297  }
298  }
299 
300  $temporary_parameters = $this->structure->getTemporaryParametersByClass($a_class);
301  if (null !== $temporary_parameters) {
302  // override existing ones, as temporary parameters
303  // are prioritised over fetched ones.
304  foreach ($temporary_parameters as $key => $value) {
305  $parameters[$key] = $value;
306  }
307  }
308 
309  return $parameters;
310  }
getQueryParam(string $parameter_name)
Returns a parameter with the given name from the current GET request.
string $key
Consumer key/client ID value.
Definition: System.php:193
ilCtrl exceptions
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParentReturn()

ilCtrl::getParentReturn ( object  $a_gui_obj)

Implements ilCtrlInterface.

Definition at line 650 of file class.ilCtrl.php.

References getClassByObject(), and getParentReturnByClass().

Referenced by ilPageContentGUI\getParentReturn().

650  : ?string
651  {
652  return $this->getParentReturnByClass($this->getClassByObject($a_gui_obj));
653  }
getClassByObject($object)
Helper function that returns the class name of a mixed (object or string) parameter.
getParentReturnByClass(string $a_class)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParentReturnByClass()

ilCtrl::getParentReturnByClass ( string  $a_class)

Implements ilCtrlInterface.

Definition at line 658 of file class.ilCtrl.php.

References $path.

Referenced by getParentReturn(), and returnToParent().

658  : ?string
659  {
660  $path = $this->path_factory->find($this->context, $a_class);
661  if (null !== $path->getCidPath()) {
662  foreach ($path->getCidArray() as $cid) {
663  $current_class = $this->structure->getClassNameByCid($cid);
664  $return_target = $this->structure->getReturnTargetByClass($current_class);
665  if (null !== $return_target) {
666  return $return_target;
667  }
668  }
669  }
670 
671  return null;
672  }
$path
Definition: ltiservices.php:32
+ Here is the caller graph for this function:

◆ getPostCommand()

ilCtrl::getPostCommand ( )
private

Returns the current $_POST command.

Returns
string|null

Definition at line 835 of file class.ilCtrl.php.

References ILIAS\Repository\refinery().

Referenced by getDeterminedCommand().

835  : ?string
836  {
837  if ($this->post_parameters->has(self::PARAM_CMD)) {
838  return $this->post_parameters->retrieve(
839  self::PARAM_CMD,
840  $this->refinery->custom()->transformation(
841  static function ($value): ?string {
842  if (!empty($value)) {
843  if (is_array($value)) {
844  // this most likely only works by accident, but
845  // the selected or clicked command button will
846  // always be sent as first array entry. This
847  // should definitely be done differently.
848  return (string) array_key_first($value);
849  }
850 
851  return (string) $value;
852  }
853 
854  return null;
855  }
856  )
857  );
858  }
859 
860  return null;
861  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQueryParam()

ilCtrl::getQueryParam ( string  $parameter_name)
private

Returns a parameter with the given name from the current GET request.

Parameters
string$parameter_name
Returns
string|null

Definition at line 790 of file class.ilCtrl.php.

References ILIAS\Repository\refinery().

Referenced by getDeterminedCommand(), and getParameterArrayByClass().

790  : ?string
791  {
792  if ($this->get_parameters->has($parameter_name)) {
793  return $this->get_parameters->retrieve(
794  $parameter_name,
795  $this->refinery->to()->string()
796  );
797  }
798 
799  return null;
800  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRedirectSource()

ilCtrl::getRedirectSource ( )

Implements ilCtrlInterface.

Definition at line 677 of file class.ilCtrl.php.

677  : ?string
678  {
679  return $this->context->getRedirectSource();
680  }

◆ getTableCommand()

ilCtrl::getTableCommand ( )
private
Deprecated:

Definition at line 805 of file class.ilCtrl.php.

References ILIAS\Repository\refinery().

Referenced by getDeterminedCommand().

805  : ?string
806  {
807  if ($this->post_parameters->has('table_top_cmd')) {
808  return $this->post_parameters->retrieve(
809  'table_top_cmd',
810  $this->refinery->custom()->transformation(function ($item): ?string {
811  return is_array($item) ? key($item) : null;
812  })
813  );
814  }
815  // Button on top of the table
816  if ($this->post_parameters->has('select_cmd2')) {
817  return $this->post_parameters->has('selected_cmd2')
818  ? $this->post_parameters->retrieve('selected_cmd2', $this->refinery->to()->string())
819  : null;
820  }
821  // Button at bottom of the table
822  if ($this->post_parameters->has('select_cmd')) {
823  return $this->post_parameters->has('selected_cmd')
824  ? $this->post_parameters->retrieve('selected_cmd', $this->refinery->to()->string())
825  : null;
826  }
827 
828  return null;
829  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTargetUrl()

ilCtrl::getTargetUrl (   $a_class,
string  $a_cmd = null,
string  $a_anchor = null,
bool  $is_async = false,
bool  $is_escaped = false,
bool  $is_post = false 
)
private

Helper function that returns a target URL string.

(that function is horrific, I'm sorry little one)

Parameters
array | string$a_class
string | null$a_cmd
string | null$a_anchor
bool$is_async
bool$is_escaped
bool$is_post
Returns
string|null
Exceptions
ilCtrlException

Definition at line 875 of file class.ilCtrl.php.

References $path, $token, appendParameterStringsByClass(), isCmdSecure(), and ilUIHookPluginGUI\KEEP.

Referenced by getFormActionByClass(), and getLinkTargetByClass().

882  : ?string {
883  if (empty($a_class)) {
884  throw new ilCtrlException(__METHOD__ . " was provided with an empty class or class-array.");
885  }
886 
887  $is_array = is_array($a_class);
888 
889  $path = $this->path_factory->find($this->context, $a_class);
890  if (null !== ($exception = $path->getException())) {
891  throw $exception;
892  }
893 
894  $base_class = $path->getBaseClass();
895  if (null === $base_class) {
896  throw new ilCtrlException("Cannot find a valid baseclass in the cid path '{$path->getCidPath()}'");
897  }
898 
899  $target_url = $this->context->getTargetScript();
900  $target_url = $this->appendParameterString(
901  $target_url,
902  self::PARAM_BASE_CLASS,
903  urlencode($base_class), // encode in case of namespaced classes
904  $is_escaped
905  );
906 
907  $cmd_class = ($is_array) ?
908  $a_class[array_key_last($a_class)] :
909  $a_class;
910 
911  // only append the cid path and command class params
912  // if they exist.
913  if (null !== $path->getNextCid($base_class)) {
914  $target_url = $this->appendParameterString(
915  $target_url,
916  self::PARAM_CID_PATH,
917  $path->getCidPath(),
918  $is_escaped
919  );
920 
921  $target_url = $this->appendParameterString(
922  $target_url,
923  self::PARAM_CMD_CLASS,
924  urlencode($cmd_class), // encode in case of namespaced classes
925  $is_escaped
926  );
927  }
928 
929  // if the target url is generated for form actions,
930  // the command must be set to 'post'.
931  if ($is_post) {
932  $target_url = $this->appendParameterString(
933  $target_url,
934  self::PARAM_CMD,
935  self::CMD_POST,
936  $is_escaped
937  );
938  }
939 
940  // the actual command is appended as fallback command
941  // for form actions and 'normal' get requests.
942  if (!empty($a_cmd)) {
943  $target_url = $this->appendParameterString(
944  $target_url,
945  ($is_post) ? self::PARAM_CMD_FALLBACK : self::PARAM_CMD,
946  $a_cmd,
947  $is_escaped
948  );
949  }
950 
951  // collect all parameters of classes within the current
952  // targets path and append them to the target url.
953  foreach ($path->getCidArray(SORT_ASC) as $cid) {
954  $class_name = $this->structure->getClassNameByCid($cid);
955  if (null === $class_name) {
956  throw new ilCtrlException("Classname for cid '$cid' in current path cannot be found.");
957  }
958 
959  $target_url = $this->appendParameterStringsByClass(
960  $class_name,
961  $target_url,
962  $is_escaped
963  );
964  }
965 
966  // append a csrf token if the command is considered
967  // unsafe or the link is for form actions.
968  if (!$this->isCmdSecure($is_post, $cmd_class, $a_cmd)) {
969  $token = $this->token_repository->getToken();
970  $target_url = $this->appendParameterString(
971  $target_url,
972  self::PARAM_CSRF_TOKEN,
973  $token->getToken(),
974  $is_escaped
975  );
976  }
977 
978  if ($is_async) {
979  $target_url = $this->appendParameterString(
980  $target_url,
981  self::PARAM_CMD_MODE,
982  self::CMD_MODE_ASYNC,
983  $is_escaped
984  );
985  }
986 
987  if (!empty($a_anchor)) {
988  $target_url .= "#$a_anchor";
989  }
990 
991  return $target_url;
992  }
isCmdSecure(bool $is_post, string $cmd_class, string $cmd=null)
Returns whether a given command is considered safe or not.
$path
Definition: ltiservices.php:32
$token
Definition: xapitoken.php:70
appendParameterStringsByClass(string $class_name, string $target_url, bool $is_escaped=false)
Appends all parameters for a given class to the given URL.
ilCtrl exceptions
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertCtrlCalls()

ilCtrl::insertCtrlCalls (   $a_parent,
  $a_child,
string  $a_comp_prefix 
)

Implements ilCtrlInterface.

Definition at line 685 of file class.ilCtrl.php.

685  : void
686  {
687  throw new ilCtrlException(__METHOD__ . " is deprecated and must not be used.");
688  }
ilCtrl exceptions

◆ isAsynch()

ilCtrl::isAsynch ( )

Implements ilCtrlInterface.

Definition at line 597 of file class.ilCtrl.php.

Referenced by ilLearningHistoryGUI\getHistoryHtml(), ilBlockGUI\getHTML(), ilNoteGUI\getWidget(), ilLearningHistoryGUI\renderButton(), ilNoteGUI\renderContent(), and ilContainerRenderer\renderHelperGeneric().

597  : bool
598  {
599  return $this->context->isAsync();
600  }
+ Here is the caller graph for this function:

◆ isCmdSecure()

ilCtrl::isCmdSecure ( bool  $is_post,
string  $cmd_class,
string  $cmd = null 
)
private

Returns whether a given command is considered safe or not.

Parameters
bool$is_post
string$cmd_class
string | null$cmd
Returns
bool

Definition at line 1034 of file class.ilCtrl.php.

Referenced by getDeterminedCommand(), and getTargetUrl().

1034  : bool
1035  {
1036  // if no command is specified, the command is
1037  // considered safe if it's not a POST command.
1038  if (null === $cmd) {
1039  return !$is_post;
1040  }
1041 
1042  // if the given command class doesn't exist, the
1043  // command is not considered safe as it might've been
1044  // tampered with.
1045  $obj_name = $this->structure->getObjNameByName($cmd_class);
1046  if (null === $obj_name) {
1047  return false;
1048  }
1049 
1050  // if the command class does not yet implement the
1051  // ilCtrlSecurityInterface, the command is considered
1052  // safe if it's not a POST command.
1053  if (!is_a($obj_name, ilCtrlSecurityInterface::class, true)) {
1054  return !$is_post;
1055  }
1056 
1057  // the post command is considered safe if it's contained
1058  // in the list of safe post commands.
1059  if ($is_post) {
1060  return in_array($cmd, $this->structure->getSafeCommandsByName($cmd_class), true);
1061  }
1062 
1063  // the get command is considered safe if it's not
1064  // contained in the list of unsafe get commands.
1065  return !in_array($cmd, $this->structure->getUnsafeCommandsByName($cmd_class), true);
1066  }
+ Here is the caller graph for this function:

◆ lookupClassPath()

ilCtrl::lookupClassPath ( string  $a_class)

Implements ilCtrlInterface.

Definition at line 558 of file class.ilCtrl.php.

References $path.

558  : string
559  {
560  $path = $this->structure->getRelativePathByName($a_class);
561  if (null === $path) {
562  throw new ilCtrlException("Class '$a_class' cannot be found in the control structure.");
563  }
564 
565  return $path;
566  }
$path
Definition: ltiservices.php:32
ilCtrl exceptions

◆ lookupOriginalClassName()

ilCtrl::lookupOriginalClassName ( string  $a_class)

Implements ilCtrlInterface.

Definition at line 571 of file class.ilCtrl.php.

571  : ?string
572  {
573  return $this->structure->getObjNameByName($a_class);
574  }

◆ populateCall()

ilCtrl::populateCall ( string  $class_name,
string  $cmd_mode 
)
private

Helper function that populates a call in the current stacktrace.

Parameters
string$class_name
string$cmd_mode

Definition at line 1144 of file class.ilCtrl.php.

References getDeterminedCommand().

Referenced by forwardCommand(), and getHTML().

1144  : void
1145  {
1146  $obj_name = $this->structure->getObjNameByName($class_name);
1147 
1148  $this->stacktrace[] = [
1149  self::PARAM_CMD_CLASS => $obj_name,
1150  self::PARAM_CMD_MODE => $cmd_mode,
1151  self::PARAM_CMD => $this->getDeterminedCommand(),
1152  ];
1153  }
getDeterminedCommand()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirect()

ilCtrl::redirect ( object  $a_gui_obj,
string  $a_cmd = null,
string  $a_anchor = null,
bool  $is_async = false 
)

Implements ilCtrlInterface.

Definition at line 419 of file class.ilCtrl.php.

References getClassByObject(), and redirectByClass().

Referenced by ilBadgeProfileGUI\activate(), ilBadgeProfileGUI\activateInCard(), ilExcCriteriaGUI\add(), ilExAssignmentEditorGUI\addAssignmentObject(), ilObjMediaCastGUI\addMobsToCast(), ilObjMediaPoolGUI\addMobsToPool(), ilPCTabsGUI\addTab(), ilExSubmissionFileGUI\addUploadObject(), ilObjItemGroupGUI\afterSave(), ilObjBlogGUI\afterSave(), ilSkillTreeNodeGUI\afterUpdate(), ilRecommendedContentRoleConfigGUI\assignItem(), ilObjExerciseAdministrationGUI\cancel(), ilObjBlogAdministrationGUI\cancel(), ilObjMediaCastSettingsGUI\cancel(), ilObjPortfolioAdministrationGUI\cancel(), ilObjTaggingSettingsGUI\cancel(), ilObjAwarenessAdministrationGUI\cancel(), ilObjStyleSheetGUI\cancelColorDeletionObject(), ilObjStyleSheetGUI\cancelColorSavingObject(), ilSkillRootGUI\cancelDelete(), ilObjMediaPoolGUI\cancelSave(), ilPCTabsGUI\cancelTabDeletion(), ilObjStyleSheetGUI\cancelTemplateDeletionObject(), ilObjStyleSheetGUI\cancelTemplateSavingObject(), ilWikiPageGUI\cancelWikiPageDeletion(), ilInternalLinkGUI\changeLinkType(), ilRecommendedContentRoleConfigGUI\checkPushPermission(), ilGlossaryPresentationGUI\chooseLetter(), ilBadgeManagementGUI\clearClipboard(), ilPortfolioRoleAssignmentGUI\confirmAssignmentDeletion(), ilContSkillAdminGUI\confirmDeleteSelectedLocalProfiles(), ilContSkillAdminGUI\confirmDeleteSingleLocalProfile(), ilContSkillAdminGUI\confirmRemoveSelectedGlobalProfiles(), ilContSkillAdminGUI\confirmRemoveSelectedSkill(), ilContSkillAdminGUI\confirmRemoveSingleGlobalProfile(), ilExcCriteriaGUI\create(), ilBadgeProfileGUI\deactivate(), ilBadgeProfileGUI\deactivateInCard(), ilContSkillAdminGUI\deassignCompetences(), ilContSkillAdminGUI\deassignCompetencesConfirm(), ilPortfolioRoleAssignmentGUI\deleteAssignments(), ilObjStyleSheetGUI\deleteColorObject(), ilPCFileListGUI\deleteFileItem(), ilBasicSkillGUI\deleteLevel(), ilObjStyleSheetGUI\deleteMediaQueriesObject(), ilContSkillAdminGUI\deleteSelectedLocalProfiles(), ilContSkillAdminGUI\deleteSingleLocalProfile(), ilObjMediaObjectGUI\deleteSrtFilesObject(), ilObjStyleSheetGUI\deleteTemplateKeepClassesObject(), ilObjStyleSheetGUI\deleteTemplateObject(), ilExAssignmentEditorGUI\downloadGlobalFeedbackFileObject(), ilPCInteractiveImageGUI\edit(), ilExSubmissionTextGUI\editAssignmentTextObject(), ilNewsItemGUI\exitUpdateNewsItem(), ilObjMediaObjectGUI\extractPreviewImageObject(), ilBadgeManagementGUI\getBadgesFromMultiAction(), ilObjBadgeAdministrationGUI\getObjectBadgesFromMultiAction(), ilContSkillAdminGUI\initCompetenceAssignmentForm(), ilSurveyParticipantsGUI\inviteUsers(), ilBadgeManagementGUI\pasteBadges(), ilContSkillAdminGUI\publishAssignments(), ilEditClipboardGUI\remove(), ilMultilingualismGUI\removeLanguages(), ilContSkillAdminGUI\removeSelectedGlobalProfiles(), ilContSkillAdminGUI\removeSelectedSkill(), ilContSkillAdminGUI\removeSingleGlobalProfile(), ilInternalLinkGUI\resetLinkList(), ilObjMediaPoolGUI\returnFromItem(), ilTaxMDGUI\save(), ilObjNotificationSettingsGUI\save(), ilUserProfileInfoSettingsGUI\save(), ilObjSkillTreeGUI\save(), ilPortfolioRoleAssignmentGUI\saveAssignment(), ilObjPortfolioAdministrationGUI\saveAuthorship(), ilContSkillAdminGUI\saveCompetenceAssignment(), ilContainerFilterAdminGUI\saveFields(), ilObjStyleSheetGUI\saveMediaQueryOrderObject(), ilObjMediaObjectGUI\saveMultiSrtObject(), ilObjBookingPoolGUI\saveNotificationObject(), ilObjStyleSheetGUI\saveObject(), ilPCFileListGUI\savePositions(), ilPCFileListGUI\savePositionsAndClasses(), ilBookingPreferencesGUI\savePreferences(), ilUserPrivacySettingsGUI\savePrivacySettings(), ilContSkillAdminGUI\saveSelectedProfile(), ilContSkillAdminGUI\saveSelectedSkill(), ilObjLearningHistorySettingsGUI\saveSettings(), ilObjNotesSettingsGUI\saveSettings(), ilObjCommentsSettingsGUI\saveSettings(), ilBookingGatewayGUI\saveSettings(), ilContSkillAdminGUI\saveSettings(), ilObjMediaPoolGUI\saveTitlesAndDescriptions(), ilExerciseManagementGUI\selectAssignmentObject(), ilExerciseManagementGUI\selectParticipantObject(), ilMediaCreationGUI\selectPool(), ilObjContentObjectGUI\sendMailToBlockedUsers(), ilInternalLinkGUI\setMedPoolFolder(), ilBookingGatewayGUI\show(), ilPCImageMapEditorGUI\updateAreas(), ilExSubmissionTextGUI\updateAssignmentTextObject(), ilObjStyleSheetGUI\updateObject(), and ilObjMediaObjectGUI\uploadSubtitleFileObject().

424  : void {
425  $this->redirectByClass(
426  $this->getClassByObject($a_gui_obj),
427  $a_cmd,
428  $a_anchor,
429  $is_async
430  );
431  }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
getClassByObject($object)
Helper function that returns the class name of a mixed (object or string) parameter.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirectByClass()

ilCtrl::redirectByClass (   $a_class,
string  $a_cmd = null,
string  $a_anchor = null,
bool  $is_async = false 
)

Implements ilCtrlInterface.

Definition at line 436 of file class.ilCtrl.php.

References getLinkTargetByClass(), and redirectToURL().

Referenced by ilObjCmiXapiVerificationGUI\_goto(), ilObjLTIConsumerVerificationGUI\_goto(), ilObjCourseVerificationGUI\_goto(), ilObjCourseReferenceGUI\_goto(), ilObjCmiXapiGUI\_goto(), ilObjDataCollectionGUI\_goto(), ilLMPageObjectGUI\_goto(), ilGlossaryTermGUI\_goto(), ilStructureObjectGUI\_goto(), ilObjLTIConsumerGUI\_goto(), ilObjSurveyGUI\_goto(), ilObjWorkspaceFolderGUI\_goto(), ilObjSurveyQuestionPoolGUI\_goto(), ilObjPortfolioGUI\_goto(), ilObjWikiGUI\_goto(), ilObjGlossaryGUI\_goto(), ilObjMediaPoolGUI\_goto(), ilObjMediaCastGUI\_goto(), ilObjLinkResourceGUI\_goto(), ilObjQuestionPoolGUI\_goto(), ilObjContentObjectGUI\_goto(), ilObjectGUI\_gotoRepositoryNode(), ilObjectGUI\_gotoRepositoryRoot(), ilObjectGUI\_gotoSharedWorkspaceNode(), ilNoteGUI\activateComments(), ilObjFileBasedLMGUI\cancelCreationObject(), ilContainerGUI\competencesObject(), ilObjSkillTreeGUI\confirmedDeleteTrees(), ilObjPortfolioTemplateGUI\createFromTemplate(), ilExSubmissionObjectGUI\createPortfolioFromAssignmentObject(), ilContentStyleSettingsGUI\createStyle(), ilNoteGUI\deactivateComments(), ilObjExerciseVerificationGUI\downloadFromPortfolioPage(), ilObjStyleSheetGUI\editObject(), ilObjLearningSequenceGUI\forwardByClass(), ilAdministrationGUI\jumpToPluginSlot(), ilSkillProfileGUI\listLocalProfiles(), ilGlossaryPresentationGUI\listTermByGivenAsPanel(), redirect(), ilObjFileBasedLMGUI\redirectAfterCreation(), ilObjSessionGUI\redirectToParentContentPageObject(), ilRepositoryGUI\redirectToRoot(), ilObjSkillTreeGUI\save(), ilAchievementsGUI\show(), ilBookingGatewayGUI\show(), ilPDNotesGUI\showPrivateNotes(), ilObjExerciseGUI\startAssignmentObject(), and ilObjFileBasedLMGUI\toFilesystem().

441  : void {
442  $this->redirectToURL(
443  $this->getLinkTargetByClass(
444  $a_class,
445  $a_cmd,
446  $a_anchor,
447  $is_async
448  )
449  );
450  }
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
redirectToURL(string $target_url)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ redirectToURL()

ilCtrl::redirectToURL ( string  $target_url)

Implements ilCtrlInterface.

Definition at line 455 of file class.ilCtrl.php.

References Vendor\Package\$e, $response, exit, and ILIAS\UI\examples\Symbol\Glyph\Header\header().

Referenced by ilObjUserFolderGUI\_goto(), ilObjTaxonomyGUI\cancel(), redirectByClass(), ilKSDocumentationGotoLink\redirectWithGotoLink(), and returnToParent().

455  : void
456  {
457  // prepend the ILIAS HTTP path if it wasn't already.
458  if (defined("ILIAS_HTTP_PATH") &&
459  strpos($target_url, "://") === false &&
460  strpos($target_url, "/") !== 0
461  ) {
462  $target_url = ILIAS_HTTP_PATH . "/" . $target_url;
463  }
464 
465  // this line can be dropped after discussion with TB or JF,
466  // it keeps the functionality of UI plugin hooks alive.
467  $target_url = $this->modifyUrlWithPluginHooks($target_url);
468 
469  // initialize http response object
470  $response = new Response();
471 
472  // there's an exceptional case for asynchronous file uploads
473  // where a json response is delivered.
474  if ('application/json' === $this->server_request->getHeaderLine('Accept')) {
475  try {
476  $body = Streams::ofString(
477  json_encode(
478  [
479  'redirect_url' => $target_url,
480  'success' => true,
481  'message' => 'called redirect after asynchronous file-upload request.',
482  ],
483  JSON_THROW_ON_ERROR
484  )
485  );
486  } catch (Throwable $exception) {
487  $body = Streams::ofString($exception->getMessage());
488  }
489 
490  $response = $response->withBody($body);
491  } else {
492  $response = $response->withAddedHeader('Location', $target_url);
493  }
494 
495  // manually trigger session_write_close() due to exceptions stored
496  // in the ILIAS database, otherwise this method is called by exit()
497  // which leads to the exceptions not being written to the database.
498  session_write_close();
499 
500  try {
501  $this->response_sender->sendResponse($response);
502  } catch (ResponseSendingException $e) {
503  header("Location: $target_url");
504  if ('application/json' === $this->server_request->getHeaderLine('Accept')) {
505  $content = (null !== $response->getBody()) ?
506  $response->getBody()->getContents() :
507  [];
508 
509  echo json_encode($content, JSON_THROW_ON_ERROR);
510  }
511  } catch (Throwable $t) {
512  header("Location: $target_url");
513  echo $t->getMessage();
514  }
515 
516  exit;
517  }
exit
Definition: login.php:29
$response
Definition: xapitoken.php:93
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ returnToParent()

ilCtrl::returnToParent ( object  $a_gui_obj,
string  $a_anchor = null 
)

Implements ilCtrlInterface.

Definition at line 627 of file class.ilCtrl.php.

References getClassByObject(), getParentReturnByClass(), and redirectToURL().

Referenced by ilMediaCreationGUI\cancel(), ilMediaCreationGUI\cancelCreate(), ilContainerGUI\cancelMoveLinkObject(), ilMediaPoolPageGUI\cancelSaveNewMediaPoolPage(), ilNewsItemGUI\cancelSaveNewsItem(), ilNewsForContextBlockGUI\cancelSettings(), ilObjStyleSheetGUI\copyStyleObject(), ilNewsItemGUI\exitSaveNewsItem(), ilContainerGUI\keepObjectsInClipboardObject(), ilObjStyleSheetGUI\returnToUpperContextObject(), and ilMediaCreationGUI\saveTitlesAndDescriptions().

627  : void
628  {
629  $class_name = $this->getClassByObject($a_gui_obj);
630  $target_url = $this->getParentReturnByClass($class_name);
631 
632  // append redirect source to target url.
633  $target_url = $this->appendParameterString(
634  $target_url,
635  self::PARAM_REDIRECT,
636  $class_name
637  );
638 
639  // append the provided anchor if necessary.
640  if (null !== $a_anchor) {
641  $target_url .= "#$a_anchor";
642  }
643 
644  $this->redirectToURL($target_url);
645  }
getClassByObject($object)
Helper function that returns the class name of a mixed (object or string) parameter.
getParentReturnByClass(string $a_class)
redirectToURL(string $target_url)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveParameter()

ilCtrl::saveParameter ( object  $a_gui_obj,
  $a_parameter 
)

Implements ilCtrlInterface.

Definition at line 238 of file class.ilCtrl.php.

References getClassByObject(), and saveParameterByClass().

Referenced by ilContSkillAdminGUI\assignCompetences(), ilSurveySkillGUI\assignSkillToQuestion(), ilMediaCreationGUI\editTitlesAndDescriptions(), ilObjMediaPoolGUI\editTitlesAndDescriptions(), ilNewsTimelineGUI\executeCommand(), ilBookingGatewayGUI\initPool(), and ilStructureObjectGUI\insertTemplate().

238  : void
239  {
240  $this->saveParameterByClass($this->getClassByObject($a_gui_obj), $a_parameter);
241  }
getClassByObject($object)
Helper function that returns the class name of a mixed (object or string) parameter.
saveParameterByClass(string $a_class, $a_parameter)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveParameterByClass()

ilCtrl::saveParameterByClass ( string  $a_class,
  $a_parameter 
)

Implements ilCtrlInterface.

Definition at line 246 of file class.ilCtrl.php.

Referenced by ilContainerContentGUI\getRightColumnHTML(), and saveParameter().

246  : void
247  {
248  if (!empty($a_parameter)) {
249  if (is_array($a_parameter)) {
250  foreach ($a_parameter as $parameter) {
251  $this->structure->setPermanentParameterByClass($a_class, $parameter);
252  }
253  } else {
254  $this->structure->setPermanentParameterByClass($a_class, $a_parameter);
255  }
256  }
257  }
+ Here is the caller graph for this function:

◆ setCmd()

ilCtrl::setCmd ( ?string  $a_cmd)

Implements ilCtrlInterface.

Definition at line 176 of file class.ilCtrl.php.

Referenced by ilObjectCopyGUI\keepObjectsInClipboard().

176  : void
177  {
178  if (!empty($a_cmd)) {
179  $this->context->setCmd($a_cmd);
180  $this->command = $a_cmd;
181  } else {
182  $this->context->setCmd(null);
183  $this->command = null;
184  }
185  }
+ Here is the caller graph for this function:

◆ setCmdClass()

ilCtrl::setCmdClass (   $a_cmd_class)

Implements ilCtrlInterface.

Definition at line 202 of file class.ilCtrl.php.

Referenced by ilColumnGUI\addBlock().

202  : void
203  {
204  if (!empty($a_cmd_class)) {
205  $this->context->setCmdClass($a_cmd_class);
206  } else {
207  $this->context->setCmdClass(null);
208  }
209  }
+ Here is the caller graph for this function:

◆ setContextObject()

ilCtrl::setContextObject ( int  $obj_id,
string  $obj_type 
)

Implements ilCtrlInterface.

Definition at line 522 of file class.ilCtrl.php.

522  : void
523  {
524  // cannot process object without object type.
525  if (!empty($obj_type)) {
526  $this->context->setObjId($obj_id);
527  $this->context->setObjType($obj_type);
528  }
529  }

◆ setParameter()

ilCtrl::setParameter ( object  $a_gui_obj,
string  $a_parameter,
  $a_value 
)

Implements ilCtrlInterface.

Definition at line 262 of file class.ilCtrl.php.

References getClassByObject(), and setParameterByClass().

Referenced by ilObjBlogGUI\addHeaderActionForCommand(), ilObjMediaCastGUI\addMobsToCast(), ilObjWikiGUI\addPagesSubTabs(), ilObjWikiGUI\addPageTabs(), ilPCDataTableGUI\afterCreation(), ilPCTabsGUI\afterCreation(), ilObjMediaPoolGUI\cancelFolderUpdate(), ilInternalLinkGUI\changeLinkType(), ilInternalLinkGUI\changeTargetObject(), ilGroupAddToGroupActionGUI\confirmAddUser(), ilNoteGUI\confirmDelete(), ilLMPageObjectGUI\create(), ilSkillTreeNodeGUI\deleteNodes(), ilNoteGUI\deleteNote(), ilRatingCategoryGUI\edit(), ilObjStyleSheetGUI\editColorObject(), ilStructureObjectGUI\editMasterLanguage(), ilObjContentObjectGUI\editMasterLanguage(), ilObjStyleSheetGUI\editMediaQueryObject(), ilObjSkillTreeGUI\editSkills(), ilObjSkillTreeGUI\editSkillTemplates(), ilObjStyleSheetGUI\editTemplateObject(), ilGroupAddToGroupActionGUI\executeCommand(), ilColumnGUI\executeCommand(), ilLMGlossaryTableGUI\fillRow(), ilLMMenuItemsTableGUI\fillRow(), ilTaxonomyListTableGUI\fillRow(), ilRatingCategoryTableGUI\fillRow(), ilHelpModuleTableGUI\fillRow(), ilStyleMediaQueryTableGUI\fillRow(), ilBookingSchedulesTableGUI\fillRow(), ilBadgeImageTemplateTableGUI\fillRow(), ilStyleColorTableGUI\fillRow(), ilTableTemplatesTableGUI\fillRow(), ilExerciseVerificationTableGUI\fillRow(), ilPageLayoutTableGUI\fillRow(), ilSurveySkillTableGUI\fillRow(), ilContSkillMemberTableGUI\fillRow(), ilSurveySkillAssignmentTableGUI\fillRow(), ilExcCriteriaTableGUI\fillRow(), ilTaxonomyTableGUI\fillRow(), ilCopySelfAssQuestionTableGUI\fillRow(), ilNewItemGroupTableGUI\fillRow(), ilContProfileTableGUI\fillRow(), ilBadgePersonalTableGUI\fillRow(), ilExcCriteriaCatalogueTableGUI\fillRow(), ilSkillLevelTableGUI\fillRow(), ilWorkspaceAccessTableGUI\fillRow(), ilAssignmentsPerParticipantTableGUI\fillRow(), ilParticipantsPerAssignmentTableGUI\fillRow(), ilNoteGUI\getGlyph(), ilLikeGUI\getHTML(), ilColumnGUI\getHTML(), ilCommentGUI\getListHTML(), ilNoteGUI\getNotesHTML(), ilNoteGUI\getNumber(), ilPortfolioRepositoryGUI\getPortfolioList(), ilNoteGUI\getTriggerShyButton(), ilNoteGUI\getWidget(), ilInternalLinkGUI\init(), ilExAssignmentEditorGUI\initAssignmentForm(), ilObjBookingPoolGUI\initHeaderAction(), ilBookingGatewayGUI\initPool(), ilSkillProfileGUI\initProfileForm(), ilStructureObjectGUI\insertTemplate(), ilExAssignmentEditorGUI\listAssignmentsObject(), ilMediaCreationGUI\listPoolItems(), ilPageEditorGUI\pasteFromClipboard(), ilPCContentIncludeGUI\poolSelection(), ilTaggingClassificationProvider\render(), ilLearningHistoryGUI\renderButton(), ilContainerRenderer\renderHelperGeneric(), ilInternalLinkGUI\resetLinkList(), ilObjMediaPoolGUI\returnFromItem(), ilObjContentObjectGUI\savePageLayout(), ilExerciseManagementGUI\selectAssignmentObject(), ilExerciseManagementGUI\selectParticipantObject(), ilPCContentIncludeGUI\selectPool(), ilPCMediaObjectGUI\selectPool(), ilPCQuestionGUI\selectPool(), ilMediaCreationGUI\selectPool(), ilInternalLinkGUI\selectRepositoryItem(), ilSurveySkillThresholdsGUI\selectSkill(), ilObjMediaPoolGUI\setContentSubTabs(), ilInternalLinkGUI\setMedPoolFolder(), ilTable2GUI\setOrderLink(), ilObjContentObjectGUI\setPageLayoutInHierarchy(), ilSkillProfileGUI\showLevelsWithTableContext(), ilRepositorySelectorInputGUI\showRepositorySelection(), ilStructureObjectGUI\switchToLanguage(), and ilObjContentObjectGUI\switchToLanguage().

262  : void
263  {
264  $this->setParameterByClass($this->getClassByObject($a_gui_obj), $a_parameter, $a_value);
265  }
getClassByObject($object)
Helper function that returns the class name of a mixed (object or string) parameter.
setParameterByClass(string $a_class, string $a_parameter, $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setParameterByClass()

ilCtrl::setParameterByClass ( string  $a_class,
string  $a_parameter,
  $a_value 
)

Implements ilCtrlInterface.

Definition at line 270 of file class.ilCtrl.php.

Referenced by ilObjCmiXapiVerificationGUI\_goto(), ilObjLTIConsumerVerificationGUI\_goto(), ilObjCourseVerificationGUI\_goto(), ilObjCourseReferenceGUI\_goto(), ilObjCmiXapiGUI\_goto(), ilObjDataCollectionGUI\_goto(), ilLMPageObjectGUI\_goto(), ilGlossaryTermGUI\_goto(), ilStructureObjectGUI\_goto(), ilObjLTIConsumerGUI\_goto(), ilObjSurveyGUI\_goto(), ilObjWorkspaceFolderGUI\_goto(), ilObjSurveyQuestionPoolGUI\_goto(), ilObjPortfolioGUI\_goto(), ilObjWikiGUI\_goto(), ilObjGlossaryGUI\_goto(), ilObjMediaPoolGUI\_goto(), ilObjMediaCastGUI\_goto(), ilObjLinkResourceGUI\_goto(), ilObjQuestionPoolGUI\_goto(), ilObjContentObjectGUI\_goto(), ilObjectGUI\_gotoRepositoryNode(), ilObjectGUI\_gotoRepositoryRoot(), ilObjectGUI\_gotoSharedWorkspaceNode(), ilPCFileListGUI\addFileItem(), ilBlockGUI\addRepoCommands(), ilBasicSkillGUI\afterSave(), ilBasicSkillTemplateGUI\afterSave(), ilSkillTemplateReferenceGUI\afterSave(), ilExAssTypeWikiTeamGUI\buildSubmissionPropertiesAndActions(), ilBlogPostingGUI\cancelBlogPostingDeletion(), ilObjWikiGUI\cancelCreationPageUsingTemplateObject(), ilObjPortfolioTemplateGUI\createFromTemplate(), ilExSubmissionObjectGUI\createPortfolioFromAssignmentObject(), ilObjExerciseVerificationGUI\downloadFromPortfolioPage(), ilFoundUsersTableGUI\fillRow(), ilTermQuickListTableGUI\fillRow(), ilLinksTableGUI\fillRow(), ilContentStylesTableGUI\fillRow(), ilContProfileTableGUI\fillRow(), ilSkillCatTableGUI\fillRow(), ilBookingParticipantsTableGUI\fillRow(), ilObjLearningSequenceGUI\forwardByClass(), ilKSDocumentationGotoLink\generateRedirectURL(), McstPodcastGUI\getHTML(), ilRepositorySelector2InputGUI\getHTML(), ilExAssignmentInfo\getInstructionFileInfo(), ilNoteGUI\getItemForNote(), ilNewsForContextBlockGUI\getJSEnabler(), ilPCFileItemFileSelectorGUI\getNodeHref(), ilPoolSelectorGUI\getNodeHref(), ilTaxonomyExplorerGUI\getNodeHref(), ilMediaPoolExplorerGUI\getNodeHref(), ilSkillTemplateTreeExplorerGUI\getNodeHref(), ilRepositoryExplorerGUI\getNodeHref(), ilRepositorySelectorExplorerGUI\getNodeHref(), ilPersonalSkillExplorerGUI\getNodeHref(), ilBlockGUI\getPaginationViewControl(), ilPortfolioRepositoryGUI\getPortfolioList(), ilNoteGUI\getShyButton(), ilExAssignmentGUI\getSubmissionLink(), ILIAS\Exercise\Assignment\PropertyAndActionBuilderUI\getSubmissionLink(), ilBlogPostingGUI\getTabs(), ilPortfolioTemplatePageGUI\getViewPageLink(), ilPortfolioPageGUI\getViewPageLink(), ilBookingPreferencesGUI\listBookingResults(), ilObjFileBasedLMGUI\redirectAfterCreation(), ilContainerReferenceGUI\redirectObject(), ilBasicSkillTemplateGUI\redirectToParent(), ilSkillTemplateReferenceGUI\redirectToParent(), ilObjSessionGUI\redirectToParentContentPageObject(), ilRepositoryGUI\redirectToRoot(), ilRepositorySelector2InputGUI\render(), ILIAS\Blog\Navigation\ToolbarNavigationRenderer\renderActionDropdown(), ilExAssTypeWikiTeamGUI\renderOverviewContent(), setParameter(), ilObjSkillTreeGUI\showLocator(), ilObjWikiGUI\showTemplateSelectionObject(), ilObjExerciseGUI\startAssignmentObject(), and ilExerciseManagementGUI\waitingDownloadObject().

270  : void
271  {
272  $this->structure->setTemporaryParameterByClass($a_class, $a_parameter, $a_value);
273  }
+ Here is the caller graph for this function:

◆ setReturn()

ilCtrl::setReturn ( object  $a_gui_obj,
string  $a_cmd = null 
)

Implements ilCtrlInterface.

Definition at line 605 of file class.ilCtrl.php.

References getClassByObject(), and setReturnByClass().

Referenced by ilAssignmentPresentationGUI\executeCommand(), ilTaxonomySettingsGUI\executeCommand(), and ilBookingGatewayGUI\executeCommand().

605  : void
606  {
607  $this->setReturnByClass($this->getClassByObject($a_gui_obj), $a_cmd);
608  }
getClassByObject($object)
Helper function that returns the class name of a mixed (object or string) parameter.
setReturnByClass(string $a_class, string $a_cmd=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setReturnByClass()

ilCtrl::setReturnByClass ( string  $a_class,
string  $a_cmd = null 
)

Implements ilCtrlInterface.

Definition at line 613 of file class.ilCtrl.php.

References getLinkTargetByClass().

Referenced by ilObjectCopyGUI\cancel(), and setReturn().

613  : void
614  {
615  $this->structure->setReturnTargetByClass(
616  $a_class,
617  $this->getLinkTargetByClass(
618  $a_class,
619  $a_cmd
620  )
621  );
622  }
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTargetScript()

ilCtrl::setTargetScript ( string  $a_target_script)

Implements ilCtrlInterface.

Definition at line 589 of file class.ilCtrl.php.

Referenced by ilObjCourseReferenceGUI\_goto(), ilObjCmiXapiGUI\_goto(), ilObjLTIConsumerGUI\_goto(), ilObjLinkResourceGUI\_goto(), ilObjectPluginGUI\afterSave(), ilImageMapEditorGUI\editMapAreas(), ilObjLearningSequenceGUI\forwardByClass(), and ilKSDocumentationGotoLink\generateRedirectURL().

589  : void
590  {
591  $this->context->setTargetScript($a_target_script);
592  }
+ Here is the caller graph for this function:

Field Documentation

◆ $command

string ilCtrl::$command = null
protected

Definition at line 38 of file class.ilCtrl.php.

Referenced by getCmd(), and getDeterminedCommand().

◆ $exec_object

object ilCtrl::$exec_object = null
protected

Definition at line 37 of file class.ilCtrl.php.

Referenced by getHTML().

◆ $stacktrace

array ilCtrl::$stacktrace = []
protected

Definition at line 45 of file class.ilCtrl.php.

Referenced by getCallHistory().


The documentation for this class was generated from the following file: