ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
RoundTrip.php
Go to the documentation of this file.
1 <?php
3 
7 
11 class RoundTrip extends Modal implements Component\Modal\RoundTrip
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  {
75  return $this->action_buttons;
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 }
getCancelButtonLabel()
Get the label of the cancel button in the footer, as language key.string
Definition: RoundTrip.php:95
getTitle()
Get the title of the modal.string
Definition: RoundTrip.php:55
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.
getActionButtons()
Get all action buttons in the footer of the modal.[]
Definition: RoundTrip.php:73
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
checkArgListElements($which, array &$values, &$classes)
Check every element of the list if it is an instance of one of the given classes. ...
getContent()
Get the components representing the content of the modal.[]
Definition: RoundTrip.php:64
Create styles array
The data for the language used.
toArray($value)
Wrap the given value in an array if it is no array.
__construct($title, $content, SignalGeneratorInterface $signal_generator)
Definition: RoundTrip.php:40
This describes commonalities between standard and primary buttons.
Definition: Button.php:15