3 declare(strict_types=1);
57 $this->ctrl = $il_ctrl;
58 $this->lng = $il_language;
59 $this->tpl = $il_template;
60 $this->object_service = $object_service;
61 $this->obj_service = $obj_service;
63 $this->lng->loadLanguageModule(
'content');
64 $this->lng->loadLanguageModule(
'obj');
69 $cmd = $this->ctrl->getCmd(
'settings');
74 case self::CMD_CANCEL:
75 $content = $this->$cmd();
78 throw new ilException(
"ilObjLearningSequenceSettingsGUI: " .
79 "Command not supported: $cmd");
82 $this->tpl->setContent($content);
90 return $form->getHTML();
95 $this->ctrl->returnToParent($this);
117 $txt =
function ($id) {
118 return $this->lng->txt($id);
120 $settings = $this->settings;
121 $activation = $this->activation;
122 $obj_id = $settings->getObjId();
125 $form->setFormAction($this->ctrl->getFormAction($this, self::CMD_SAVE));
126 $form->setTitle($this->lng->txt(
'lso_edit'));
129 $title->setRequired(
true);
133 $section_avail->setTitle(
$txt(
'lso_settings_availability'));
135 $online->setInfo($this->lng->txt(
'lso_activation_online_info'));
137 $duration->setShowTime(
true);
138 if ($activation->getActivationStart() !== null) {
141 (
string) $activation->getActivationStart()->format(
'Y-m-d H:i:s'),
146 if ($activation->getActivationEnd() !== null) {
149 (
string) $activation->getActivationEnd()->format(
'Y-m-d H:i:s'),
156 $section_misc->setTitle(
$txt(
'lso_settings_misc'));
158 $show_members_gallery->setInfo(
$txt(
'lso_show_members_info'));
166 $abstract_img->setImage($settings->getAbstractImage());
174 $extro_img->setImage($settings->getExtroImage());
177 $section_intro->setTitle(
$txt(
'lso_settings_intro'));
179 $section_extro->setTitle(
$txt(
'lso_settings_extro'));
182 $section_misc->setTitle(
$txt(
'obj_features'));
184 $show_members_gallery->setInfo(
$txt(
'lso_show_members_info'));
186 $form->addItem($title);
187 $form->addItem($desc);
189 $form->addItem($section_avail);
190 $form->addItem($online);
191 $form->addItem($duration);
193 $form->addItem($section_intro);
194 $form->addItem($abstract);
195 $form->addItem($abstract_img,
true);
197 $form->addItem($section_extro);
198 $form->addItem($extro);
199 $form->addItem($extro_img,
true);
201 $form->addItem($section_misc);
202 $form->addItem($show_members_gallery);
204 $form->addCommandButton(self::CMD_SAVE,
$txt(
"save"));
205 $form->addCommandButton(self::CMD_CANCEL,
$txt(
"cancel"));
212 $settings = $this->settings;
213 $activation = $this->activation;
215 self::PROP_TITLE => $this->obj_title,
216 self::PROP_DESC => $this->obj_description,
217 self::PROP_ABSTRACT => $settings->getAbstract(),
218 self::PROP_EXTRO => $settings->getExtro(),
219 self::PROP_ABSTRACT_IMAGE => $settings->getAbstractImage(),
220 self::PROP_EXTRO_IMAGE => $settings->getExtroImage(),
221 self::PROP_ONLINE => $activation->getIsOnline(),
222 self::PROP_GALLERY => $settings->getMembersGallery()
230 $txt =
function ($id) {
231 return $this->lng->txt($id);
234 $section_appearance->setTitle(
$txt(
'cont_presentation'));
235 $form->
addItem($section_appearance);
236 $form_service = $this->obj_service->commonSettings()->legacyForm($form, $this->obj);
237 $form = $form_service->addTitleIconVisibility();
238 $form = $form_service->addTopActionsVisibility();
239 $form = $form_service->addIcon();
240 $form = $form_service->addTileImage();
248 if (!$form->checkInput()) {
249 $form->setValuesByPost();
251 return $form->getHTML();
257 $lso->setTitle($post[self::PROP_TITLE]);
258 $lso->setDescription($post[self::PROP_DESC]);
261 ->withAbstract($post[self::PROP_ABSTRACT])
262 ->withExtro($post[self::PROP_EXTRO])
263 ->withMembersGallery((
bool) $post[self::PROP_GALLERY])
266 $inpt = $form->getItemByPostVar(self::PROP_AVAIL_PERIOD);
267 $start = $inpt->getStart();
268 $end = $inpt->getEnd();
269 $activation = $this->activation
270 ->withIsOnline((
bool) $post[self::PROP_ONLINE]);
273 $activation = $activation
274 ->withActivationStart(
275 \DateTime::createFromFormat(
281 $activation = $activation->withActivationStart();
284 $activation = $activation
286 \DateTime::createFromFormat(
292 $activation = $activation->withActivationEnd();
295 $inpt = $form->getItemByPostVar(self::PROP_ABSTRACT_IMAGE);
296 if ($inpt->getDeletionFlag()) {
300 if (
$img[
'size'] > 0) {
305 $inpt = $form->getItemByPostVar(self::PROP_EXTRO_IMAGE);
306 if ($inpt->getDeletionFlag()) {
310 if (
$img[
'size'] > 0) {
315 $form_service = $this->obj_service->commonSettings()->legacyForm($form, $this->obj);
316 $form_service->saveTitleIconVisibility();
317 $form_service->saveTopActionsVisibility();
318 $form_service->saveIcon();
319 $form_service->saveTileImage();
321 $lso->updateSettings($settings);
322 $lso->updateActivation($activation);
325 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
326 $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)
removePlugin($a_plugin)
Remove RTE plugin.
Class ilObjLearningSequenceSettingsGUI.
setRteTags($a_rtetags)
Set Valid RTE Tags.
const PROP_ABSTRACT_IMAGE
initImgInput(ilImageFileInputGUI $inpt)
const ILIAS_IMG_MANAGER_PLUGIN
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, ilGlobalTemplateInterface $il_template, ilObjectService $obj_service)