ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsGUI Class Reference
+ Collaboration diagram for ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsGUI:

Public Member Functions

 __construct (protected InternalDataService $data, protected InternalDomainService $domain, protected InternalGUIService $gui, protected int $obj_id)
 
 executeCommand ()
 

Protected Member Functions

 edit ()
 
 getEditForm ()
 
 save ()
 

Protected Attributes

ilSetting $global_settings
 

Detailed Description

Definition at line 28 of file class.SettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsGUI::__construct ( protected InternalDataService  $data,
protected InternalDomainService  $domain,
protected InternalGUIService  $gui,
protected int  $obj_id 
)

Definition at line 32 of file class.SettingsGUI.php.

37  {
38  }

Member Function Documentation

◆ edit()

ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsGUI::edit ( )
protected

Definition at line 54 of file class.SettingsGUI.php.

References ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsGUI\getEditForm().

54  : void
55  {
56  $mt = $this->gui->ui()->mainTemplate();
57  $form = $this->getEditForm();
58  $mt->setContent($form->render());
59  }
+ Here is the call graph for this function:

◆ executeCommand()

ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsGUI::executeCommand ( )

Definition at line 40 of file class.SettingsGUI.php.

40  : void
41  {
42  $ctrl = $this->gui->ctrl();
43  $next_class = $ctrl->getNextClass($this);
44  $cmd = $ctrl->getCmd("edit");
45 
46  switch ($next_class) {
47  default:
48  if (in_array($cmd, ["edit", "save"])) {
49  $this->$cmd();
50  }
51  }
52  }

◆ getEditForm()

ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsGUI::getEditForm ( )
protected

Definition at line 61 of file class.SettingsGUI.php.

References $lng, ILIAS\Repository\Form\addAdditionalFeatures(), ILIAS\Repository\Form\addOnline(), ILIAS\Repository\Form\addStdTile(), ILIAS\Repository\Form\addStdTitleAndDescription(), and ilObjectServiceSettingsGUI\CUSTOM_METADATA.

Referenced by ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsGUI\edit(), and ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsGUI\save().

61  : FormAdapterGUI
62  {
63  $settings = $this->domain->mediapoolSettings()->getById($this->obj_id);
64  $lng = $this->domain->lng();
65 
66  $form = $this->gui
67  ->form(self::class, "save")
68  ->section("general", $lng->txt("mep_edit"))
69  ->addStdTitleAndDescription($this->obj_id, "mep")
70  ->section("avail", $lng->txt("rep_activation_availability"))
71  ->addOnline($this->obj_id, "mep")
72  ->section("presentation", $lng->txt("obj_presentation"))
73  ->addStdTile($this->obj_id, "mep")
74  ->number(
75  "default_width",
76  $lng->txt("mep_default_width"),
77  "",
78  $settings->getDefaultWidth(),
79  0
80  )
81  ->number(
82  "default_height",
83  $lng->txt("mep_default_height"),
84  $lng->txt("mep_default_width_height_info"),
85  $settings->getDefaultHeight(),
86  0
87  )
89  $this->obj_id,
90  [
92  ]
93  );
94 
95  return $form;
96  }
addAdditionalFeatures(int $obj_id, array $services)
addStdTitleAndDescription(int $obj_id, string $type)
addStdTile(int $obj_id, string $type)
global $lng
Definition: privfeed.php:31
addOnline(int $obj_id, string $type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsGUI::save ( )
protected

Definition at line 98 of file class.SettingsGUI.php.

References $lng, ilBlockSetting\_write(), ilObjectServiceSettingsGUI\CUSTOM_METADATA, ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsGUI\getEditForm(), and ILIAS\Repository\int().

98  : void
99  {
100  $mt = $this->gui->ui()->mainTemplate();
101  $form = $this->getEditForm();
102  $ctrl = $this->gui->ctrl();
103  $lng = $this->domain->lng();
104 
105  $old_settings = $this->domain->mediapoolSettings()->getById($this->obj_id);
106 
107  if ($form->isValid()) {
108 
109  $form->saveStdTitleAndDescription($this->obj_id, "mep");
110  $form->saveStdTile($this->obj_id, "mep");
111  $form->saveOnline($this->obj_id, "mep");
112  $form->saveAdditionalFeatures(
113  $this->obj_id,
114  [
116  ]
117  );
118 
119 
120  $settings = $this->data->settings(
121  $this->obj_id,
122  (int) $form->getData("default_width"),
123  (int) $form->getData("default_height"),
124  $old_settings->getForTranslation()
125  );
126  $this->domain->mediapoolSettings()->update($settings);
127 
128  $news_set = new \ilSetting("news");
129  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
130 
131  if ($enable_internal_rss) {
133  "news",
134  "public_feed",
135  (string) $form->getData("extra_feed"),
136  0,
137  $this->obj_id
138  );
139 
141  "news",
142  "keep_rss_min",
143  (string) $form->getData("keep_rss_min"),
144  0,
145  $this->obj_id
146  );
147  }
148 
149  $mt->setOnScreenMessage("success", $lng->txt("msg_obj_modified"), true);
150  $ctrl->redirectByClass(self::class, "edit");
151  } else {
152  $mt = $this->gui->ui()->mainTemplate();
153  $mt->setContent($form->render());
154  }
155  }
static _write(string $a_type, string $a_setting, string $a_value, int $a_user=0, int $a_block_id=0)
Write setting to database.
global $lng
Definition: privfeed.php:31
+ Here is the call graph for this function:

Field Documentation

◆ $global_settings

ilSetting ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsGUI::$global_settings
protected

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


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