3 declare(strict_types=1);
52 $this->obj_service = $obj_service;
53 $this->post_wrapper = $post_wrapper;
61 $this->
lng->loadLanguageModule(
'content');
62 $this->
lng->loadLanguageModule(
'obj');
68 $cmd = $this->
ctrl->getCmd(
'settings');
73 case self::CMD_CANCEL:
74 $content = $this->$cmd();
76 case self::CMD_OLD_INTRO:
77 case self::CMD_OLD_EXTRO:
82 throw new ilException(
"ilObjLearningSequenceSettingsGUI: Command not supported: $cmd");
85 $this->tpl->setContent($content);
91 $this->tpl->setOnScreenMessage(
"info", $this->
lng->txt(
"lso_intropages_deprecationhint"));
96 return $form->getHTML();
101 $this->
ctrl->redirectByClass(ilObjLearningSequenceGUI::class);
109 $this->
lng->txt(
"lso_settings_old_intro"),
110 $this->
ctrl->getLinkTarget($this, self::CMD_OLD_INTRO)
114 $this->
lng->txt(
"lso_settings_old_extro"),
115 $this->
ctrl->getLinkTarget($this, self::CMD_OLD_EXTRO)
122 $this->
lng->txt(
'back'),
123 $this->
ctrl->getLinkTarget($this, self::CMD_EDIT)
128 if ($cmd === self::CMD_OLD_INTRO) {
132 $out[] =
'<img src="' .
$img .
'"/>';
135 if ($cmd === self::CMD_OLD_EXTRO) {
139 $out[] =
'<img src="' .
$img .
'"/>';
143 return implode(
'<hr>',
$out);
150 $activation = $this->activation;
153 $form->setFormAction($this->
ctrl->getFormAction($this, self::CMD_SAVE));
154 $form->setTitle($this->
lng->txt(
'lso_edit'));
157 $title->setRequired(
true);
161 $section_avail->setTitle(
$txt(
'lso_settings_availability'));
163 $online->setInfo($this->
lng->txt(
'lso_activation_online_info'));
165 $duration->setShowTime(
true);
166 if ($activation->getActivationStart() !== null) {
169 $activation->getActivationStart()->format(
'Y-m-d H:i:s'),
174 if ($activation->getActivationEnd() !== null) {
177 $activation->getActivationEnd()->format(
'Y-m-d H:i:s'),
184 $section_misc->setTitle(
$txt(
'obj_features'));
186 $show_members_gallery->setInfo(
$txt(
'lso_show_members_info'));
188 $form->addItem($title);
189 $form->addItem($desc);
191 $form->addItem($section_avail);
192 $form->addItem($online);
193 $form->addItem($duration);
194 $form->addItem($section_misc);
195 $form->addItem($show_members_gallery);
197 $form->addCommandButton(self::CMD_SAVE,
$txt(
"save"));
198 $form->addCommandButton(self::CMD_CANCEL,
$txt(
"cancel"));
206 $activation = $this->activation;
208 self::PROP_TITLE => $this->obj_title,
209 self::PROP_DESC => $this->obj_description,
210 self::PROP_ONLINE => $activation->getIsOnline(),
211 self::PROP_GALLERY =>
$settings->getMembersGallery()
221 $section_appearance->setTitle(
$txt(
'cont_presentation'));
222 $form->
addItem($section_appearance);
223 $form_service = $this->obj_service->commonSettings()->legacyForm($form, $this->obj);
224 $form_service->addTitleIconVisibility();
225 $form_service->addTopActionsVisibility();
226 $form_service->addIcon();
227 $form_service->addTileImage();
234 if (!$form->checkInput()) {
235 $form->setValuesByPost();
236 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"msg_form_save_error"));
237 return $form->getHTML();
242 $lso->setTitle($this->post_wrapper->retrieve(self::PROP_TITLE, $this->refinery->kindlyTo()->string()));
243 $lso->setDescription($this->post_wrapper->retrieve(self::PROP_DESC, $this->refinery->kindlyTo()->string()));
246 ->withMembersGallery(
247 $this->post_wrapper->retrieve(
249 $this->refinery->byTrying([
250 $this->refinery->kindlyTo()->bool(),
256 $inpt = $form->getItemByPostVar(self::PROP_AVAIL_PERIOD);
257 $start = $inpt->getStart();
258 $end = $inpt->getEnd();
259 $activation = $this->activation
261 $this->post_wrapper->retrieve(
263 $this->refinery->byTrying([
264 $this->refinery->kindlyTo()->bool(),
271 $activation = $activation
272 ->withActivationStart(DateTime::createFromFormat(
'Y-m-d H:i:s', (
string) $start->get(
IL_CAL_DATETIME)));
274 $activation = $activation->withActivationStart();
277 $activation = $activation
278 ->withActivationEnd(DateTime::createFromFormat(
'Y-m-d H:i:s', (
string) $end->get(
IL_CAL_DATETIME)));
280 $activation = $activation->withActivationEnd();
283 $form_service = $this->obj_service->commonSettings()->legacyForm($form, $this->obj);
284 $form_service->saveTitleIconVisibility();
285 $form_service->saveTopActionsVisibility();
286 $form_service->saveIcon();
287 $form_service->saveTileImage();
290 $lso->updateActivation($activation);
293 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
"msg_obj_modified"),
true);
294 $this->
ctrl->redirect($this);
fillForm(ilPropertyFormGUI $form)
Class ChatMainBarProvider .
__construct(ilObjLearningSequence $obj, ilCtrl $ctrl, ilLanguage $lng, ilGlobalTemplateInterface $tpl, ilObjectService $obj_service, ArrayBasedRequestWrapper $post_wrapper, ILIAS\Refinery\Factory $refinery, ilToolbarGUI $toolbar)
This class represents a text area property in a property form.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
getLongDescription()
get object long description (stored in object_description)
addCommonFieldsToForm(ilPropertyFormGUI $form)
addLegacypagesToToolbar()
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
showLegacyPage(string $cmd)
Refinery Factory $refinery