ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
MessageBox.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24use ILIAS\UI\Implementation\Component\ComponentHelper;
26
28{
29 use ComponentHelper;
30
34 private static array $types = [
36 self::SUCCESS,
37 self::INFO,
38 self::CONFIRMATION
39 ];
40
41 private string $type;
42 private string $message_text;
43 private array $buttons = [];
44 private array $links = [];
45
46 public function __construct($type, string $message_text)
47 {
48 $this->checkArgIsElement("type", $type, self::$types, "message box type");
49 $this->type = $type;
50 $this->message_text = $message_text;
51 }
52
56 public function getType(): string
57 {
58 return $this->type;
59 }
60
64 public function getMessageText(): string
65 {
67 }
68
72 public function getButtons(): array
73 {
74 return $this->buttons;
75 }
76
80 public function getLinks(): array
81 {
82 return $this->links;
83 }
84
88 public function withButtons(array $buttons): C\MessageBox\MessageBox
89 {
90 $types = array(C\Component::class);
91 $this->checkArgListElements("buttons", $buttons, $types);
92
93 $clone = clone $this;
94 $clone->buttons = $buttons;
95 return $clone;
96 }
97
101 public function withLinks(array $links): C\MessageBox\MessageBox
102 {
103 $types = array(C\Component::class);
104 $this->checkArgListElements("links", $links, $types);
105
106 $clone = clone $this;
107 $clone->links = $links;
108 return $clone;
109 }
110
114 public function getPromptButtons(): array
115 {
116 return $this->buttons;
117 }
118
122 public function getPromptTitle(): string
123 {
124 return $this->type;
125 }
126
127
128}
Flags some Component to be a valid content of a Prompt.
@ FAILURE
The progress of the process/task cannot be calculated (yet), but it has started processing.
Definition: Status.php:42