ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
Interruptive.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
22 
25 
29 class Interruptive extends Modal implements M\Interruptive
30 {
34  protected array $items = array();
35  protected string $title;
36  protected string $message;
37  protected string $action_button_label = 'delete';
38  protected string $cancel_button_label = 'cancel';
39  protected string $form_action;
40 
41  public function __construct(
42  string $title,
43  string $message,
44  string $form_action,
46  ) {
47  parent::__construct($signal_generator);
48  $this->checkStringArg('title', $title);
49  $this->checkStringArg('message', $message);
50  $this->checkStringArg('form_action', $form_action);
51  $this->title = $title;
52  $this->message = $message;
53  $this->form_action = $form_action;
54  }
55 
59  public function getMessage(): string
60  {
61  return $this->message;
62  }
63 
67  public function getTitle(): string
68  {
69  return $this->title;
70  }
71 
75  public function withFormAction(string $form_action): M\Interruptive
76  {
77  $clone = clone $this;
78  $clone->form_action = $form_action;
79  return $clone;
80  }
81 
85  public function withAffectedItems(array $items): M\Interruptive
86  {
87  $types = array(M\InterruptiveItem::class);
88  $this->checkArgListElements('items', $items, $types);
89  $clone = clone $this;
90  $clone->items = $items;
91  return $clone;
92  }
93 
97  public function getActionButtonLabel(): string
98  {
100  }
101 
102 
106  public function withActionButtonLabel(string $action_label): M\Interruptive
107  {
108  $clone = clone $this;
109  $clone->action_button_label = $action_label;
110  return $clone;
111  }
112 
116  public function getCancelButtonLabel(): string
117  {
119  }
120 
124  public function withCancelButtonLabel(string $cancel_label): M\Interruptive
125  {
126  $clone = clone $this;
127  $clone->cancel_button_label = $cancel_label;
128  return $clone;
129  }
130 
134  public function getAffectedItems(): array
135  {
136  return $this->items;
137  }
138 
139  public function getFormAction(): string
140  {
141  return $this->form_action;
142  }
143 }
__construct(string $title, string $message, string $form_action, SignalGeneratorInterface $signal_generator)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Factory.php:21
SignalGeneratorInterface $signal_generator
Definition: Modal.php:42
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Factory.php:21
__construct(Container $dic, ilPlugin $plugin)