3 declare(strict_types=1);
56 $this->ctrl = $il_ctrl;
57 $this->lng = $il_language;
58 $this->tpl = $il_template;
59 $this->object_service = $object_service;
60 $this->obj_service = $obj_service;
62 $this->lng->loadLanguageModule(
'content');
63 $this->lng->loadLanguageModule(
'obj');
68 $cmd = $this->ctrl->getCmd(
'settings');
73 case self::CMD_CANCEL:
74 $content = $this->$cmd();
77 throw new ilException(
"ilObjLearningSequenceSettingsGUI: " .
78 "Command not supported: $cmd");
81 $this->tpl->setContent($content);
89 return $form->getHTML();
94 $this->ctrl->returnToParent($this);
117 return $this->lng->txt(
$id);
119 $settings = $this->settings;
120 $activation = $this->activation;
121 $obj_id = $settings->getObjId();
124 $form->setFormAction($this->ctrl->getFormAction($this, self::CMD_SAVE));
125 $form->setTitle($this->lng->txt(
'lso_edit'));
128 $title->setRequired(
true);
132 $section_avail->setTitle(
$txt(
'lso_settings_availability'));
134 $online->setInfo($this->lng->txt(
'lso_activation_online_info'));
136 $duration->setShowTime(
true);
137 if ($activation->getActivationStart() !== null) {
140 (
string) $activation->getActivationStart()->format(
'Y-m-d H:i:s'),
145 if ($activation->getActivationEnd() !== null) {
148 (
string) $activation->getActivationEnd()->format(
'Y-m-d H:i:s'),
155 $section_misc->setTitle(
$txt(
'lso_settings_misc'));
157 $show_members_gallery->setInfo(
$txt(
'lso_show_members_info'));
165 $abstract_img->setImage($settings->getAbstractImage());
173 $extro_img->setImage($settings->getExtroImage());
176 $section_intro->setTitle(
$txt(
'lso_settings_intro'));
178 $section_extro->setTitle(
$txt(
'lso_settings_extro'));
181 $section_misc->setTitle(
$txt(
'obj_features'));
183 $show_members_gallery->setInfo(
$txt(
'lso_show_members_info'));
186 $form->addItem($desc);
188 $form->addItem($section_avail);
189 $form->addItem($online);
190 $form->addItem($duration);
192 $form->addItem($section_intro);
193 $form->addItem($abstract);
194 $form->addItem($abstract_img,
true);
196 $form->addItem($section_extro);
197 $form->addItem($extro);
198 $form->addItem($extro_img,
true);
200 $form->addItem($section_misc);
201 $form->addItem($show_members_gallery);
203 $form->addCommandButton(self::CMD_SAVE,
$txt(
"save"));
204 $form->addCommandButton(self::CMD_CANCEL,
$txt(
"cancel"));
211 $settings = $this->settings;
212 $activation = $this->activation;
214 self::PROP_TITLE => $this->obj_title,
215 self::PROP_DESC => $this->obj_description,
216 self::PROP_ABSTRACT => $settings->getAbstract(),
217 self::PROP_EXTRO => $settings->getExtro(),
218 self::PROP_ABSTRACT_IMAGE => $settings->getAbstractImage(),
219 self::PROP_EXTRO_IMAGE => $settings->getExtroImage(),
220 self::PROP_ONLINE => $activation->getIsOnline(),
221 self::PROP_GALLERY => $settings->getMembersGallery()
230 return $this->lng->txt(
$id);
233 $section_appearance->setTitle(
$txt(
'cont_presentation'));
234 $form->
addItem($section_appearance);
235 $form_service = $this->obj_service->commonSettings()->legacyForm($form, $this->obj);
236 $form = $form_service->addTitleIconVisibility();
237 $form = $form_service->addTopActionsVisibility();
238 $form = $form_service->addIcon();
239 $form = $form_service->addTileImage();
247 if (!
$form->checkInput()) {
248 $form->setValuesByPost();
250 return $form->getHTML();
256 $lso->setTitle(
$post[self::PROP_TITLE]);
257 $lso->setDescription(
$post[self::PROP_DESC]);
260 ->withAbstract(
$post[self::PROP_ABSTRACT])
261 ->withExtro(
$post[self::PROP_EXTRO])
262 ->withMembersGallery((
bool)
$post[self::PROP_GALLERY])
265 $inpt =
$form->getItemByPostVar(self::PROP_AVAIL_PERIOD);
266 $start = $inpt->getStart();
267 $end = $inpt->getEnd();
268 $activation = $this->activation
269 ->withIsOnline((
bool)
$post[self::PROP_ONLINE]);
272 $activation = $activation
273 ->withActivationStart(
274 \DateTime::createFromFormat(
280 $activation = $activation->withActivationStart();
283 $activation = $activation
285 \DateTime::createFromFormat(
291 $activation = $activation->withActivationEnd();
294 $inpt =
$form->getItemByPostVar(self::PROP_ABSTRACT_IMAGE);
295 if ($inpt->getDeletionFlag()) {
299 if (
$img[
'size'] > 0) {
304 $inpt =
$form->getItemByPostVar(self::PROP_EXTRO_IMAGE);
305 if ($inpt->getDeletionFlag()) {
309 if (
$img[
'size'] > 0) {
314 $form_service = $this->obj_service->commonSettings()->legacyForm(
$form, $this->obj);
315 $form_service->saveTitleIconVisibility();
316 $form_service->saveTopActionsVisibility();
317 $form_service->saveIcon();
318 $form_service->saveTileImage();
320 $lso->updateSettings($settings);
321 $lso->updateActivation($activation);
324 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
325 $this->ctrl->redirect($this);
This class provides processing control methods.
fillForm(\ilPropertyFormGUI $form)
Class ilObjLearningSequence.
setUseRte($a_usert, $version='')
Set Use Rich Text Editing.
addCommonFieldsToForm(\ilPropertyFormGUI $form)
if(!array_key_exists('StateId', $_REQUEST)) $id
removePlugin($a_plugin)
Remove RTE plugin.
Class ilObjLearningSequenceSettingsGUI.
setRteTags($a_rtetags)
Set Valid RTE Tags.
const PROP_ABSTRACT_IMAGE
initImgInput(ilImageFileInputGUI $inpt)
if(isset($_POST['submit'])) $form
const ILIAS_IMG_MANAGER_PLUGIN
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
getTitle()
get object title public
getDescription()
get object description
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
This class represents a text area property in a property form.
initRTEInput(ilTextAreaInputGUI $inpt)
__construct(ilObjLearningSequence $obj, ilCtrl $il_ctrl, ilLanguage $il_language, ilTemplate $il_template, ilObjectService $obj_service)