ILIAS  trunk Revision v12.0_alpha-1338-g8f7e531aa3c
ILIAS\GlobalScreen\GUI\Flow\Flow Class Reference
+ Collaboration diagram for ILIAS\GlobalScreen\GUI\Flow\Flow:

Public Member Functions

 __construct (private Services $http, private \ilCtrlInterface $ctrl)
 
 ctrl ()
 
 redirect (string $command, ?string $target_class=null)
 
 getHereAsFlow ()
 
 getParentAsURI (?string $cmd=null)
 
 getHereAsURI (?string $cmd=null)
 
 getTranslationAsURI (?string $command=null)
 
 getURI (string $with_path)
 
 getLinkTarget (object $target_class, ?string $command=null)
 
 getCurrentClass ()
 
 getTargetByClass (array|string $target_class, ?string $command=null)
 
 getTargetURI (object|array|string $target_class, ?string $command=null)
 
 getCommand (?string $fallback=null)
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 31 of file Flow.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\GlobalScreen\GUI\Flow\Flow::__construct ( private Services  $http,
private \ilCtrlInterface  $ctrl 
)

Definition at line 33 of file Flow.php.

36 {
37 }

Member Function Documentation

◆ ctrl()

ILIAS\GlobalScreen\GUI\Flow\Flow::ctrl ( )

◆ getCommand()

ILIAS\GlobalScreen\GUI\Flow\Flow::getCommand ( ?string  $fallback = null)

Definition at line 121 of file Flow.php.

121 : string
122 {
123 $cmd = $this->ctrl->getCmd($fallback);
124 return empty($cmd) ? ($fallback ?? '') : $cmd;
125 }

References ILIAS\GlobalScreen\GUI\Flow\Flow\ctrl().

+ Here is the call graph for this function:

◆ getCurrentClass()

ILIAS\GlobalScreen\GUI\Flow\Flow::getCurrentClass ( )

Definition at line 98 of file Flow.php.

98 : ?string
99 {
100 return $this->ctrl->getCmdClass();
101 }

References ILIAS\GlobalScreen\GUI\Flow\Flow\ctrl().

Referenced by ILIAS\GlobalScreen\GUI\Flow\Flow\redirect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHereAsFlow()

ILIAS\GlobalScreen\GUI\Flow\Flow::getHereAsFlow ( )

Definition at line 51 of file Flow.php.

51 : array
52 {
53 $call_history = $this->ctrl->getCallHistory();
54 return array_map(static fn(array $c): string => $c['cmdClass'], $call_history);
55 }
$c
Definition: deliver.php:25

References $c, and ILIAS\GlobalScreen\GUI\Flow\Flow\ctrl().

Referenced by ILIAS\GlobalScreen\GUI\Flow\Flow\getParentAsURI().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHereAsURI()

ILIAS\GlobalScreen\GUI\Flow\Flow::getHereAsURI ( ?string  $cmd = null)

Definition at line 67 of file Flow.php.

67 : URI
68 {
69 $uri = new URI((string) $this->http->request()->getUri());
70 if ($cmd !== null) {
71 return $uri->withParameter('cmd', $cmd);
72 }
73 return $uri;
74 }
static http()
Fetches the global http state from ILIAS.

References ILIAS\FileDelivery\http().

+ Here is the call graph for this function:

◆ getLinkTarget()

ILIAS\GlobalScreen\GUI\Flow\Flow::getLinkTarget ( object  $target_class,
?string  $command = null 
)
Deprecated:
use getTargetURI instead

Definition at line 93 of file Flow.php.

93 : string
94 {
95 return $this->ctrl->getLinkTarget($target_class, $command);
96 }

References ILIAS\GlobalScreen\GUI\Flow\Flow\ctrl().

+ Here is the call graph for this function:

◆ getParentAsURI()

ILIAS\GlobalScreen\GUI\Flow\Flow::getParentAsURI ( ?string  $cmd = null)

Definition at line 57 of file Flow.php.

57 : URI
58 {
59 $this->ctrl->getCallHistory();
60 $command_classes = $this->getHereAsFlow();
61 // remove the last class
62 array_pop($command_classes);
63
64 return $this->getTargetURI($command_classes, $cmd);
65 }
getTargetURI(object|array|string $target_class, ?string $command=null)
Definition: Flow.php:112

References ILIAS\GlobalScreen\GUI\Flow\Flow\ctrl(), ILIAS\GlobalScreen\GUI\Flow\Flow\getHereAsFlow(), and ILIAS\GlobalScreen\GUI\Flow\Flow\getTargetURI().

+ Here is the call graph for this function:

◆ getTargetByClass()

ILIAS\GlobalScreen\GUI\Flow\Flow::getTargetByClass ( array|string  $target_class,
?string  $command = null 
)
Deprecated:
use getTargetURI instead

Definition at line 107 of file Flow.php.

107 : string
108 {
109 return $this->ctrl->getLinkTargetByClass($target_class, $command);
110 }

References ILIAS\GlobalScreen\GUI\Flow\Flow\ctrl().

Referenced by ILIAS\GlobalScreen\GUI\Flow\Flow\getTargetURI().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTargetURI()

ILIAS\GlobalScreen\GUI\Flow\Flow::getTargetURI ( object|array|string  $target_class,
?string  $command = null 
)

Definition at line 112 of file Flow.php.

112 : URI
113 {
114 if (is_object($target_class)) {
115 $target_class = $target_class::class;
116 }
117
118 return $this->getURI($this->getTargetByClass($target_class, $command));
119 }
getTargetByClass(array|string $target_class, ?string $command=null)
Definition: Flow.php:107
getURI(string $with_path)
Definition: Flow.php:85

References ILIAS\GlobalScreen\GUI\Flow\Flow\getTargetByClass(), and ILIAS\GlobalScreen\GUI\Flow\Flow\getURI().

Referenced by ILIAS\GlobalScreen\GUI\Flow\Flow\getParentAsURI(), and ILIAS\GlobalScreen\GUI\Flow\Flow\getTranslationAsURI().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTranslationAsURI()

ILIAS\GlobalScreen\GUI\Flow\Flow::getTranslationAsURI ( ?string  $command = null)

Definition at line 76 of file Flow.php.

76 : URI
77 {
78 $classes = array_map(static fn(array $c): string => $c['cmdClass'], $this->ctrl->getCallHistory());
79
80 $classes[] = MultiLanguageGUI::class;
81
82 return $this->getTargetURI(MultiLanguageGUI::class, $command);
83 }

References $c, ILIAS\GlobalScreen\GUI\Flow\Flow\ctrl(), and ILIAS\GlobalScreen\GUI\Flow\Flow\getTargetURI().

+ Here is the call graph for this function:

◆ getURI()

ILIAS\GlobalScreen\GUI\Flow\Flow::getURI ( string  $with_path)

Definition at line 85 of file Flow.php.

85 : URI
86 {
87 return new URI(rtrim(ILIAS_HTTP_PATH, '/') . '/' . ltrim($with_path, '/'));
88 }

Referenced by ILIAS\GlobalScreen\GUI\Flow\Flow\getTargetURI().

+ Here is the caller graph for this function:

◆ redirect()

ILIAS\GlobalScreen\GUI\Flow\Flow::redirect ( string  $command,
?string  $target_class = null 
)

Definition at line 44 of file Flow.php.

44 : never
45 {
46 $target_class ??= $this->getCurrentClass();
47
48 $this->ctrl->redirectByClass($target_class, $command);
49 }

References ILIAS\GlobalScreen\GUI\Flow\Flow\ctrl(), and ILIAS\GlobalScreen\GUI\Flow\Flow\getCurrentClass().

+ Here is the call graph for this function:

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