ILIAS  release_7 Revision v7.30-3-g800a261c036
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
50 {
52 $this->checkStringArg('title', $title);
53 $this->checkStringArg('message', $message);
54 $this->checkStringArg('form_action', $form_action);
55 $this->title = $title;
56 $this->message = $message;
57 $this->form_action = $form_action;
58 }
59
60
64 public function getMessage()
65 {
66 return $this->message;
67 }
68
69
73 public function getTitle()
74 {
75 return $this->title;
76 }
77
78
83 {
84 $this->checkStringArg('form_action', $form_action);
85 $clone = clone $this;
86 $clone->form_action = $form_action;
87 return $clone;
88 }
89
90
94 public function withAffectedItems(array $items)
95 {
96 $types = array(Component\Modal\InterruptiveItem::class);
97 $this->checkArgListElements('items', $items, $types);
98 $clone = clone $this;
99 $clone->items = $items;
100 return $clone;
101 }
102
103
107 public function getActionButtonLabel()
108 {
110 }
111
112
113
117 public function withActionButtonLabel(string $action_label) : Component\Modal\Interruptive
118 {
119 $clone = clone $this;
120 $clone->action_button_label = $action_label;
121 return $clone;
122 }
123
124
128 public function getCancelButtonLabel()
129 {
131 }
132
133
137 public function withCancelButtonLabel(string $cancel_label) : Component\Modal\Interruptive
138 {
139 $clone = clone $this;
140 $clone->cancel_button_label = $cancel_label;
141 return $clone;
142 }
143
144
148 public function getAffectedItems()
149 {
150 return $this->items;
151 }
152
153
157 public function getFormAction()
158 {
159 return $this->form_action;
160 }
161}
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
withActionButtonLabel(string $action_label)
Get a modal like this with the action button labeled according to the parameter.The label will be tra...
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
__construct($title, $message, $form_action, SignalGeneratorInterface $signal_generator)
getTitle()
Get the title of this modal.string
withCancelButtonLabel(string $cancel_label)
Get a modal like this with the cancel button labeled according to the parameter.The label will be tra...
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.
checkArgListElements($which, array &$values, $classes)
Check every element of the list if it is an instance of one of the given classes.