ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Interruptive.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25
26class Interruptive extends Modal implements M\Interruptive
27{
31 protected array $items = array();
32 protected string $title;
33 protected string $message;
34 protected ?string $action_button_label = null;
35 protected ?string $cancel_button_label = null;
36 protected string $form_action;
37
38 public function __construct(
39 string $title,
40 string $message,
41 string $form_action,
43 ) {
45 $this->checkStringArg('title', $title);
46 $this->checkStringArg('message', $message);
47 $this->checkStringArg('form_action', $form_action);
48 $this->title = $title;
49 $this->message = $message;
50 $this->form_action = $form_action;
51 }
52
56 public function getMessage(): string
57 {
58 return $this->message;
59 }
60
64 public function getTitle(): string
65 {
66 return $this->title;
67 }
68
72 public function withFormAction(string $form_action): M\Interruptive
73 {
74 $clone = clone $this;
75 $clone->form_action = $form_action;
76 return $clone;
77 }
78
82 public function withAffectedItems(array $items): M\Interruptive
83 {
84 $types = array(M\InterruptiveItem\InterruptiveItem::class);
85 $this->checkArgListElements('items', $items, $types);
86 $clone = clone $this;
87 $clone->items = $items;
88 return $clone;
89 }
90
94 public function getActionButtonLabel(): ?string
95 {
97 }
98
99
103 public function withActionButtonLabel(string $action_label): M\Interruptive
104 {
105 $clone = clone $this;
106 $clone->action_button_label = $action_label;
107 return $clone;
108 }
109
113 public function getCancelButtonLabel(): ?string
114 {
116 }
117
121 public function withCancelButtonLabel(string $cancel_label): M\Interruptive
122 {
123 $clone = clone $this;
124 $clone->cancel_button_label = $cancel_label;
125 return $clone;
126 }
127
131 public function getAffectedItems(): array
132 {
133 return $this->items;
134 }
135
136 public function getFormAction(): string
137 {
138 return $this->form_action;
139 }
140}
__construct(string $title, string $message, string $form_action, SignalGeneratorInterface $signal_generator)
SignalGeneratorInterface $signal_generator
Definition: Modal.php:42
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Factory.php:21