ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
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, protected bool $in_repository, protected int $ref_id=0)
 
 executeCommand ()
 

Protected Member Functions

 edit ()
 
 getEditForm ()
 
 save ()
 

Protected Attributes

ILIAS Notes DomainService $notes
 
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,
protected bool  $in_repository,
protected int  $ref_id = 0 
)

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

40  {
41  $this->notes = $domain->notes();
42  }

Member Function Documentation

◆ edit()

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

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

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

58  : void
59  {
60  $mt = $this->gui->ui()->mainTemplate();
61  $form = $this->getEditForm();
62  $mt->setContent($form->render());
63  }
+ Here is the call graph for this function:

◆ executeCommand()

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

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

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

◆ getEditForm()

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

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

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

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

65  : FormAdapterGUI
66  {
67  $settings = $this->domain->portfolioSettings()->getById($this->obj_id);
68  $lng = $this->domain->lng();
69 
70  $lng->loadLanguageModule("rep");
71 
72  $form = $this->gui
73  ->form(self::class, "save")
74  ->section("general", $lng->txt("prtf_edit_portfolio"));
75  if ($this->in_repository) {
76  $form = $form
77  ->addStdTitleAndDescription($this->obj_id, "prtf");
78  } else {
79  $form = $form
80  ->addStdTitle($this->obj_id, "prtf");
81  }
82  $form = $form
83  ->section("avail", $lng->txt("rep_activation_availability"))
84  ->addOnline($this->obj_id, "prtf");
85  if ($this->in_repository) {
86  $form = $form->addStdAvailability($this->ref_id);
87  }
88  $form = $form
89  ->section("presentation", $lng->txt("obj_presentation"))
90  ->checkbox(
91  "ppic",
92  $lng->txt("prtf_profile_picture"),
93  "",
94  $settings->getShowPersonalPicture()
95  );
96  if ($this->in_repository) {
97  $form = $form
98  ->addStdTile($this->obj_id, "prtf");
99  }
100  if ($this->in_repository) {
101  $form = $form
102  ->addAdditionalFeatures(
103  $this->obj_id,
104  [
106  ]
107  );
108  }
109  $form = $form
110  ->checkbox(
111  "comments",
112  $lng->txt("prtf_public_comments"),
113  "",
114  $this->notes->commentsActive($this->obj_id)
115  );
116 
117  return $form;
118  }
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 120 of file class.SettingsGUI.php.

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

120  : void
121  {
122  $mt = $this->gui->ui()->mainTemplate();
123  $form = $this->getEditForm();
124  $ctrl = $this->gui->ctrl();
125  $lng = $this->domain->lng();
126 
127  $old_settings = $this->domain->portfolioSettings()->getById($this->obj_id);
128 
129  if ($form->isValid()) {
130  if ($this->in_repository) {
131  $form->saveStdTitleAndDescription($this->obj_id, "prtf");
132  $form->saveStdTile($this->obj_id, "mep");
133  $form->saveAdditionalFeatures(
134  $this->obj_id,
135  [
137  ]
138  );
139  } else {
140  $form->saveStdTitle($this->obj_id, "prtf");
141  }
142  $form->saveOnline($this->obj_id, "mep");
143 
144  $this->notes->activateComments(
145  $this->obj_id,
146  $form->getData("comments")
147  );
148 
149  $settings = $this->data->settings(
150  $this->obj_id,
151  (bool) $form->getData("ppic")
152  );
153  $this->domain->portfolioSettings()->update($settings);
154 
155  if ($this->in_repository) {
156  $form->saveStdAvailability($this->ref_id);
157  }
158 
159  $mt->setOnScreenMessage("success", $lng->txt("msg_obj_modified"), true);
160  $ctrl->redirectByClass(self::class, "edit");
161  } else {
162  $mt = $this->gui->ui()->mainTemplate();
163  $mt->setContent($form->render());
164  }
165  }
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 31 of file class.SettingsGUI.php.

◆ $notes

ILIAS Notes DomainService ILIAS\MetaData\OERHarvester\Settings\Settings\SettingsGUI::$notes
protected

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


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