ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Interruptive.php
Go to the documentation of this file.
1 <?php
3 
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 
85  public function withFormAction($form_action)
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 }
getTitle()
Get the title of this modal.string
withFormAction($form_action)
Get a modal like this submitting the form to the given form action.Interruptive
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.
__construct($title, $message, $form_action, SignalGeneratorInterface $signal_generator, $action_button_label='delete')
checkArgListElements($which, array &$values, &$classes)
Check every element of the list if it is an instance of one of the given classes. ...
Create styles array
The data for the language used.
getCancelButtonLabel()
Get the label of the cancel button in the footer.string
getAffectedItems()
Return the affected items listed in the content by this modal.InterruptiveItem[]
getMessage()
Get the message of this modal, displayed below the modals title.string
getFormAction()
Get the form action where the action button is sending the IDs of the affected items.string
withAffectedItems(array $items)
Get a modal like this listing the given items in the content section below the message.The IDs of the interruptive items are sent via POST to the form action of this modal.$itemsInterruptive
getActionButtonLabel()
Get the label of the action button in the footer.string