19 declare(strict_types=1);
    31     protected ?\ILIAS\Repository\Form\FormAdapterGUI 
$form = null;
    34     protected \ILIAS\HTTP\Services 
$http;
    35     protected \ilCtrlInterface 
$ctrl;
    36     protected \ILIAS\DI\UIServices 
$ui;
    49         $this->
ui = $DIC->ui();
    50         $this->
ctrl = $DIC->ctrl();
    51         $this->
http = $DIC->http();
    61     protected function _send(
string $output): void
    63         $this->http_util->sendString($output);
    71     public function legacy(
string $content): self
    73         $this->ui_content = [$this->
ui->factory()->legacy($content)];
    85     public function button(
string $text, 
string $url, 
bool $replace_modal = 
true, $onclick = 
""): self
    87         $target = $replace_modal
    91         $button = $this->
ui->factory()->button()->standard(
    97             $button = $button->withOnLoadCode(
function (
$id) use ($url, $onclick) {
    99                     "$('#$id').click(function(event) { $onclick; il.repository.ui.redirect('$url'); return false;});";
   101         } elseif ($onclick !== 
"") {
   102             $button = $button->withOnLoadCode(
function (
$id) use ($url, $onclick) {
   103                 return "$('#$id').click(function(event) { $onclick });";
   106         $this->action_buttons[] = $button;
   112         string $on_form_submit_click = 
""   114         if ($this->
ctrl->isAsynch()) {
   115             $this->
form = $form->asyncModal();
   117             $this->
form = $form->syncModal();
   120         $async = $this->
form->isSentAsync()
   123         if ($on_form_submit_click === 
"") {
   124             $on_form_submit_click = 
"il.repository.ui.submitModalForm(event,$async); return false;";
   126         $button = $this->
ui->factory()->button()->standard(
   127             $this->
form->getSubmitLabel(),
   131                 "$('#$id').click(function(event) {" . $on_form_submit_click . 
"});";
   133         $this->action_buttons[] = $button;
   134         $this->ui_content = null;
   141         if (!is_null($this->
form)) {
   143             $modal = $this->
ui->factory()->modal()->roundtrip(
   146                 $this->
form->getForm()->getInputs(),
   147                 $this->
form->getForm()->getPostURL()
   151             $modal = $this->
ui->factory()->modal()->roundtrip($this->
getTitle(), $this->ui_content);
   153         if (count($this->action_buttons) > 0) {
   154             $modal = $modal->withActionButtons($this->action_buttons);
   156         if ($this->cancel_label !== 
"") {
   157             $modal = $modal->withCancelButtonLabel($this->cancel_label);
   159         $modal = $modal->withAdditionalOnLoadCode(
function (
$id) {
   160             return "il.repository.ui.initModal('$id');";
   171         $this->
_send($this->
ui->renderer()->renderAsync($modal));
   188         $modal = $ui->factory()->modal()->roundtrip(
"", $ui->factory()->legacy(
""));
   189         $url .= 
'&replaceSignal=' . $modal->getReplaceSignal()->getId();
   190         $modal = $modal->withAsyncRenderUrl($url);
   192             $button = $ui->factory()->button()->shy($button_title, 
"#")
   193                          ->withOnClick($modal->getShowSignal());
   195             $button = $ui->factory()->button()->standard($button_title, 
"#")
   196                          ->withOnClick($modal->getShowSignal());
   198         return [
"button" => $button, 
"modal" => $modal, 
"signal" => $modal->getShowSignal()->getId()];
   207             $button = $ui->factory()->button()->shy($button_title, 
"#")
   208                          ->withOnClick($modal->getShowSignal());
   210             $button = $ui->factory()->button()->standard($button_title, 
"#")
   211                          ->withOnClick($modal->getShowSignal());
   213         return [
"button" => $button, 
"modal" => $modal, 
"signal" => $modal->getShowSignal()->getId()];
 This describes commonalities between the different modals. 
 
Interface Observer  Contains several chained tasks and infos about them. 
 
form(\ILIAS\Repository\Form\FormAdapterGUI $form, string $on_form_submit_click="")
 
renderAsyncTriggerButton(string $button_title, string $url, $shy=true)
 
getAsyncTriggerButtonComponents(string $button_title, string $url, $shy=true)
 
withOnLoadCode(Closure $binder)
 
content(array $components)
 
ILIAS Repository Form FormAdapterGUI $form
 
__construct(string $title, string $cancel_label, HTTPUtil $http_util)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
ILIAS HTTP Services $http
 
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins 
 
button(string $text, string $url, bool $replace_modal=true, $onclick="")
 
ILIAS Refinery Factory $refinery
 
getTriggerButtonComponents(string $button_title, $shy=true)