ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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
34
41 {
42 parent::__construct($signal_generator);
43 $this->checkStringArg('title', $title);
44 $content = $this->toArray($content);
45 $types = array(Component\Component::class);
46 $this->checkArgListElements('content', $content, $types);
47 $this->title = $title;
48 $this->content = $content;
49 }
50
51
55 public function getTitle()
56 {
57 return $this->title;
58 }
59
60
64 public function getContent()
65 {
66 return $this->content;
67 }
68
69
73 public function getActionButtons()
74 {
76 }
77
78
82 public function withActionButtons(array $buttons)
83 {
84 $types = array(Button\Button::class);
85 $this->checkArgListElements('buttons', $buttons, $types);
86 $clone = clone $this;
87 $clone->action_buttons = $buttons;
88 return $clone;
89 }
90
91
95 public function getCancelButtonLabel()
96 {
98 }
99
104 public function withCancelButtonLabel($label)
105 {
106 $clone = clone $this;
107 $clone->cancel_button_label = $label;
108 return $clone;
109 }
110}
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:95
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:82
__construct($title, $content, SignalGeneratorInterface $signal_generator)
Definition: RoundTrip.php:40
getContent()
Get the components representing the content of the modal.\ILIAS\UI\Component\Component[]
Definition: RoundTrip.php:64
getActionButtons()
Get all action buttons in the footer of the modal.\ILIAS\UI\Component\Button\Button[]
Definition: RoundTrip.php:73
getTitle()
Get the title of the modal.string
Definition: RoundTrip.php:55
This describes commonalities between standard and primary buttons.
Definition: Button.php:16
A component is the most general form of an entity in the UI.
Definition: Component.php:14
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.