ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
FormContent.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
27 use ILIAS\MetaData\Editor\Full\Services\Services as FullEditorServices;
30 
32 {
33  protected FullEditorServices $services;
34 
35  public function __construct(
36  FullEditorServices $services
37  ) {
38  $this->services = $services;
39  }
40 
44  public function content(
45  PathInterface $base_path,
46  ElementInterface $element,
47  ?RequestForFormInterface $request
48  ): \Generator {
49  $delete_modal = $this->services->actions()->getModal()->delete(
50  $base_path,
51  $element,
52  true
53  );
54  if ($delete_modal) {
55  $button = $this->services->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->services->formFactory()->getUpdateForm(
64  $base_path,
65  $element
66  );
67  if ($request) {
68  $form = $request->applyRequestToForm($form);
69  }
70  yield ContentType::MAIN => $form;
71  }
72 }
content(PathInterface $base_path, ElementInterface $element, ?RequestForFormInterface $request)
Definition: FormContent.php:44
__construct(FullEditorServices $services)
Definition: FormContent.php:35