3 declare(strict_types=1);
21 require_once(__DIR__ .
'/ModalBase.php');
35 $interruptive = $this->
getModalFactory()->interruptive(
'myTitle',
'myMessage',
'myFormAction');
36 $this->assertEquals(
'myTitle', $interruptive->getTitle());
41 $interruptive = $this->
getModalFactory()->interruptive(
'myTitle',
'myMessage',
'myFormAction');
42 $this->assertEquals(
'myMessage', $interruptive->getMessage());
47 $interruptive = $this->
getModalFactory()->interruptive(
'myTitle',
'myMessage',
'myFormAction');
48 $this->assertEquals(
'myFormAction', $interruptive->getFormAction());
53 $interruptive = $this->
getModalFactory()->interruptive(
'myTitle',
'myMessage',
'myFormAction');
55 $interruptive = $interruptive->withAffectedItems($items);
56 $this->assertEquals($items, $interruptive->getAffectedItems());
61 $interruptive = $this->
getModalFactory()->interruptive(
'myTitle',
'myMessage',
'myFormAction');
62 $interruptive2 = $interruptive->withFormAction(
'myFormAction2');
63 $this->assertEquals(
'myFormAction', $interruptive->getFormAction());
64 $this->assertEquals(
'myFormAction2', $interruptive2->getFormAction());
69 $interruptive = $this->
getModalFactory()->interruptive(
'myTitle',
'myMessage',
'myFormAction');
71 $interruptive2 = $interruptive->withAffectedItems($items);
72 $this->assertEquals(0, count($interruptive->getAffectedItems()));
73 $this->assertEquals($items, $interruptive2->getAffectedItems());
78 $interruptive = $this->
getModalFactory()->interruptive(
'Title',
'Message',
'myAction.php');
81 $this->assertEquals($expected, $actual);
92 <div
class=
"modal fade il-modal-interruptive" tabindex=
"-1" role=
"dialog" id=
"id_1">
93 <div
class=
"modal-dialog" role=
"document">
94 <
form action=
"myAction.php" method=
"POST">
95 <div
class=
"modal-content">
96 <div
class=
"modal-header"><button type=
"button" class=
"close" data-dismiss=
"modal" aria-label=
"cancel">
97 <span aria-hidden=
"true">×</span></button><span
class=
"modal-title">
Title</span>
99 <div
class=
"modal-body">
100 <div
class=
"alert alert-warning il-modal-interruptive-message" role=
"alert">Message</div>
102 <div
class=
"modal-footer">
103 <input type=
"submit" class=
"btn btn-primary" value=
"delete" name=
"cmd[delete]">
104 <button
class=
"btn btn-default" data-dismiss=
"modal">cancel</button>
117 $action_label =
'actionlabel';
118 $cancel_label =
'cancellabel';
119 $interruptive = $this->
getModalFactory()->interruptive(
'Title',
'Message',
'someaction')
120 ->withActionButtonLabel($action_label)
121 ->withCancelButtonLabel($cancel_label);
125 $interruptive->getActionButtonLabel()
129 $interruptive->getCancelButtonLabel()
136 public function getId():
string 141 public function getTitle():
string 146 public function getDescription():
string 148 return 'description';
151 public function getIcon(): C\Image\Image
153 return new I\Component\Image\Image(
C\Image\Image::STANDARD,
'',
'');
getDefaultRenderer(JavaScriptBinding $js_binding=null, array $with_stub_renderings=[])
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
test_with_affected_items()
test_get_affected_items()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
brutallyTrimHTML(string $html)
A more radical version of normalizeHTML.
Base class for modal tests.
form( $class_path, string $cmd)