ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
RoundTrip.php
Go to the documentation of this file.
1<?php
3
4use ILIAS\UI\Component as Component;
7
12{
13
17 protected $action_buttons = array();
18
22 protected $title;
23
27 protected $content;
28
32 protected $cancel_button_label = 'cancel';
33
35 protected $replace_signal;
36
37
44 {
46 $this->checkStringArg('title', $title);
47 $content = $this->toArray($content);
48 $types = array(Component\Component::class);
49 $this->checkArgListElements('content', $content, $types);
50 $this->title = $title;
51 $this->content = $content;
52 }
53
54
58 public function getTitle()
59 {
60 return $this->title;
61 }
62
63
67 public function getContent()
68 {
69 return $this->content;
70 }
71
72
76 public function getActionButtons()
77 {
79 }
80
81
85 public function withActionButtons(array $buttons)
86 {
87 $types = array(Button\Button::class);
88 $this->checkArgListElements('buttons', $buttons, $types);
89 $clone = clone $this;
90 $clone->action_buttons = $buttons;
91 return $clone;
92 }
93
94
98 public function getCancelButtonLabel()
99 {
101 }
102
107 public function withCancelButtonLabel($label)
108 {
109 $clone = clone $this;
110 $clone->cancel_button_label = $label;
111 return $clone;
112 }
113
117 public function getReplaceSignal()
118 {
120 }
121
125 public function initSignals()
126 {
127 parent::initSignals();
128 //signal generator from parent class
129 $this->replace_signal = $this->signal_generator->create("ILIAS\\UI\\Implementation\\Component\\ReplaceSignal");
130 }
131
135 public function withContent($content)
136 {
137 $clone = clone $this;
138 $clone->content = $content;
139
140 return $clone;
141 }
142}
An exception for terminatinating execution or to throw for unit testing.
getCancelButtonLabel()
Get the label of the cancel button in the footer, as language key.string
Definition: RoundTrip.php:98
withActionButtons(array $buttons)
Get a modal like this with the provided action buttons in the footer.Note that the footer always cont...
Definition: RoundTrip.php:85
__construct($title, $content, SignalGeneratorInterface $signal_generator)
Definition: RoundTrip.php:43
getContent()
Get the components representing the content of the modal.\ILIAS\UI\Component\Component[]
Definition: RoundTrip.php:67
getReplaceSignal()
Get the signal to replace the content of this modal.\ILIAS\UI\Component\ReplaceSignal
Definition: RoundTrip.php:117
withContent($content)
Get Modal like this with the provided components representing the content of the modal....
Definition: RoundTrip.php:135
getActionButtons()
Get all action buttons in the footer of the modal.\ILIAS\UI\Component\Button\Button[]
Definition: RoundTrip.php:76
initSignals()
Set the show/close/replace signals for this modal.
Definition: RoundTrip.php:125
getTitle()
Get the title of the modal.string
Definition: RoundTrip.php:58
A component is the most general form of an entity in the UI.
Definition: Component.php:14
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.
toArray($value)
Wrap the given value in an array if it is no array.
checkArgListElements($which, array &$values, $classes)
Check every element of the list if it is an instance of one of the given classes.