ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ILIAS\Notes\Export\ExportHelperGUI Class Reference

Helper UI class for notes/comments handling in (HTML) exports. More...

+ Collaboration diagram for ILIAS\Notes\Export\ExportHelperGUI:

Public Member Functions

 __construct ()
 
 getCommentIncludeModalDialog (string $title, string $message, string $export_cmd, string $export_with_comments_cmd, bool $js=false)
 

Protected Attributes

ilLanguage $lng
 
ILIAS DI UIServices $ui
 

Detailed Description

Helper UI class for notes/comments handling in (HTML) exports.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 25 of file class.ExportHelperGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Notes\Export\ExportHelperGUI::__construct ( )

Definition at line 30 of file class.ExportHelperGUI.php.

References $DIC, ILIAS\Repository\lng(), and ILIAS\Repository\ui().

31  {
32  global $DIC;
33  $this->lng = $DIC->language();
34  $this->ui = $DIC->ui();
35  }
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

Member Function Documentation

◆ getCommentIncludeModalDialog()

ILIAS\Notes\Export\ExportHelperGUI::getCommentIncludeModalDialog ( string  $title,
string  $message,
string  $export_cmd,
string  $export_with_comments_cmd,
bool  $js = false 
)

Definition at line 37 of file class.ExportHelperGUI.php.

References $id, ILIAS\Notes\Export\ExportHelperGUI\$ui, ILIAS\Repository\lng(), and ILIAS\UI\Implementation\Component\withAdditionalOnLoadCode().

43  : \ILIAS\UI\Component\Modal\RoundTrip {
44  $ui = $this->ui;
45  $factory = $ui->factory();
46 
47  $mess = $factory->messageBox()->confirmation($message);
48  $modal = $factory->modal()->roundtrip($title, [$mess]);
49 
50  $b1 = $factory->button()
51  ->standard($this->lng->txt("no"), "#")
52  ->withAdditionalOnLoadCode(static function ($id) use ($export_cmd, $js): string {
53  $cmd_js = ($js)
54  ? $export_cmd
55  : "window.location.href='$export_cmd'";
56  return "document.querySelector('#$id').addEventListener('click', (e) => {
57  const el = document.getElementById('$id');
58  el.closest('.modal-content').querySelector('button.close').click();
59  $cmd_js
60  });";
61  });
62  $b2 = $factory->button()
63  ->standard($this->lng->txt("yes"), "#")
64  ->withAdditionalOnLoadCode(static function ($id) use ($export_with_comments_cmd, $js): string {
65  $cmd_js = ($js)
66  ? $export_with_comments_cmd
67  : "window.location.href='$export_with_comments_cmd'";
68  return "document.querySelector('#$id').addEventListener('click', (e) => {
69  const el = document.getElementById('$id');
70  el.closest('.modal-content').querySelector('button.close').click();
71  $cmd_js
72  });";
73  });
74 
75  $modal = $modal->withActionButtons([$b1, $b2]);
76 
77  return $modal;
78  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$message
Definition: xapiexit.php:31
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ILIAS\Notes\Export\ExportHelperGUI::$lng
protected

Definition at line 27 of file class.ExportHelperGUI.php.

◆ $ui

ILIAS DI UIServices ILIAS\Notes\Export\ExportHelperGUI::$ui
protected

The documentation for this class was generated from the following file: