ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Interruptive.php
Go to the documentation of this file.
1<?php
3
4use ILIAS\UI\Component as Component;
6
11{
12
16 protected $title;
17
21 protected $message;
22
26 protected $action_button_label = 'delete';
27
31 protected $cancel_button_label = 'cancel';
32
36 protected $form_action;
37
41 protected $items = array();
42
51 {
52 parent::__construct($signal_generator);
53 $this->checkStringArg('title', $title);
54 $this->checkStringArg('message', $message);
55 $this->checkStringArg('form_action', $form_action);
56 $this->checkStringArg('action_button_label', $action_button_label);
57 $this->title = $title;
58 $this->message = $message;
59 $this->form_action = $form_action;
60 $this->action_button_label = $action_button_label;
61 }
62
63
67 public function getMessage()
68 {
69 return $this->message;
70 }
71
72
76 public function getTitle()
77 {
78 return $this->title;
79 }
80
81
86 {
87 $this->checkStringArg('form_action', $form_action);
88 $clone = clone $this;
89 $clone->form_action = $form_action;
90 return $clone;
91 }
92
93
97 public function withAffectedItems(array $items)
98 {
99 $types = array(Component\Modal\InterruptiveItem::class);
100 $this->checkArgListElements('items', $items, $types);
101 $clone = clone $this;
102 $clone->items = $items;
103 return $clone;
104 }
105
106
110 public function getActionButtonLabel()
111 {
113 }
114
115
119 public function getCancelButtonLabel()
120 {
122 }
123
124
128 public function getAffectedItems()
129 {
130 return $this->items;
131 }
132
133
137 public function getFormAction()
138 {
139 return $this->form_action;
140 }
141}
An exception for terminatinating execution or to throw for unit testing.
getFormAction()
Get the form action where the action button is sending the IDs of the affected items....
getAffectedItems()
Return the affected items listed in the content by this modal.InterruptiveItem[]
withFormAction($form_action)
Get a modal like this submitting the form to the given form action.Interruptive
getCancelButtonLabel()
Get the label of the cancel button in the footer.string
getActionButtonLabel()
Get the label of the action button in the footer.string
withAffectedItems(array $items)
Get a modal like this listing the given items in the content section below the message....
getMessage()
Get the message of this modal, displayed below the modals title.string
getTitle()
Get the title of this modal.string
__construct($title, $message, $form_action, SignalGeneratorInterface $signal_generator, $action_button_label='delete')
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.
checkArgListElements($which, array &$values, &$classes)
Check every element of the list if it is an instance of one of the given classes.