ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
FormContent.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use Generator;
32
34{
35 public function __construct(
36 protected Actions $actions,
37 protected FormFactory $form_factory
38 ) {
39 }
40
44 public function content(
45 PathInterface $base_path,
46 ElementInterface $element,
48 ): Generator {
49 $delete_modal = $this->actions->getModal()->delete(
50 $base_path,
51 $element,
52 true
53 );
54 if ($delete_modal) {
55 $button = $this->actions->getButton()->delete(
56 $delete_modal->getFlexibleSignal(),
57 false,
58 true
59 );
60 yield ContentType::MODAL => $delete_modal;
61 yield ContentType::TOOLBAR => $button;
62 }
63 $form = $this->form_factory->getUpdateForm(
64 $base_path,
65 $element
66 );
67 if ($request) {
68 $form = $request->applyRequestToForm($form);
69 }
70 yield ContentType::MAIN => $form;
71 }
72}
__construct(protected Actions $actions, protected FormFactory $form_factory)
Definition: FormContent.php:35
content(PathInterface $base_path, ElementInterface $element, ?RequestForFormInterface $request)
Definition: FormContent.php:44
return true
This describes commonalities between standard and primary buttons.
Definition: Button.php:34
This describes a standard form.
Definition: Standard.php:30