ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 122 of file Flow.php.

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

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 99 of file Flow.php.

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

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 94 of file Flow.php.

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

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:113

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 108 of file Flow.php.

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

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 113 of file Flow.php.

113 : URI
114 {
115 if (is_object($target_class)) {
116 $target_class = $target_class::class;
117 }
118
119 return $this->getURI($this->getTargetByClass($target_class, $command));
120 }
getTargetByClass(array|string $target_class, ?string $command=null)
Definition: Flow.php:108
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 $request = $this->http->request()->getUri();
88 return new URI($request->getScheme() . '://' . $request->getHost() . '/' . ltrim($with_path, '/'));
89 }

References ILIAS\FileDelivery\http().

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

+ Here is the call graph for this function:
+ 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: