Go to the source code of this file.
◆ show_form_in_modal()
Definition at line 2 of file show_form_in_modal.php.
References $_POST, $DIC, $factory, $form, $id, $out, and $valid.
6 $renderer = $DIC->ui()->renderer();
8 require_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
9 require_once(
'./Services/Form/classes/class.ilTextInputGUI.php');
10 require_once(
'./Services/Form/classes/class.ilCountrySelectInputGUI.php');
14 $form->setId(uniqid(
'form'));
16 $item->setRequired(
true);
17 $form->addItem($item);
19 $item->setRequired(
true);
20 $form->addItem($item);
22 $form->setFormAction($DIC->ctrl()->getFormActionByClass(
'ilsystemstyledocumentationgui'));
24 $item->setValue(
'submit');
25 $form->addItem($item);
28 $form_id =
'form_' .
$form->getId();
29 $submit =
$factory->button()->primary(
'Submit',
'#')
30 ->withOnLoadCode(
function (
$id) use ($form_id) {
31 return "$('#{$id}').click(function() { $('#{$form_id}').submit(); return false; });";
38 if (
$form->checkInput()) {
39 $panel =
$factory->panel()->standard(
'Form validation successful',
$factory->legacy(print_r(
$_POST,
true)));
40 $out = $renderer->render($panel);
42 $form->setValuesByPost();
48 ->withActionButtons([$submit]);
52 $modal = $modal->withOnLoad($modal->getShowSignal());
54 $button1 =
$factory->button()->standard(
'Show Form',
'#')
55 ->withOnClick($modal->getShowSignal());
57 return $renderer->render([$button1, $modal]) .
$out;
if(!array_key_exists('StateId', $_REQUEST)) $id
if(isset($_POST['submit'])) $form
This class represents a text property in a property form.