ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\MediaPool\Settings\SettingsGUI Class Reference
+ Collaboration diagram for ILIAS\MediaPool\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\MediaPool\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\MediaPool\Settings\SettingsGUI::edit ( )
protected

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

54 : void
55 {
56 $mt = $this->gui->ui()->mainTemplate();
57 $form = $this->getEditForm();
58 $mt->setContent($form->render());
59 }

References ILIAS\MediaPool\Settings\SettingsGUI\getEditForm().

+ Here is the call graph for this function:

◆ executeCommand()

ILIAS\MediaPool\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\MediaPool\Settings\SettingsGUI::getEditForm ( )
protected

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

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 )
88 ->addAdditionalFeatures(
89 $this->obj_id,
90 [
92 ]
93 );
94
95 return $form;
96 }
global $lng
Definition: privfeed.php:31

References $lng, and ilObjectServiceSettingsGUI\CUSTOM_METADATA.

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

+ Here is the caller graph for this function:

◆ save()

ILIAS\MediaPool\Settings\SettingsGUI::save ( )
protected

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

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.

References $lng, ilBlockSetting\_write(), ilObjectServiceSettingsGUI\CUSTOM_METADATA, and ILIAS\MediaPool\Settings\SettingsGUI\getEditForm().

+ Here is the call graph for this function:

Field Documentation

◆ $global_settings

ilSetting ILIAS\MediaPool\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: