19declare(strict_types=1);
54 protected Psr\Http\Message\ServerRequestInterface
$request;
73 Psr\Http\Message\ServerRequestInterface
$request,
83 $this->
ctrl = $ilCtrl;
108 $next_class = $this->
ctrl->getNextClass();
109 switch ($next_class) {
110 case 'ilstudyprogrammecommonsettingsgui':
111 $this->
tabs->activateSubTab(self::TAB_COMMON_SETTINGS);
112 $this->common_settings_gui->setObject($this->
getObject());
113 $content = $this->
ctrl->forwardCommand($this->common_settings_gui);
116 $cmd = $this->
ctrl->getCmd();
117 if ($cmd ===
"" || $cmd ===
null) {
122 $content = $this->
view();
125 $content = $this->$cmd();
129 "ilObjStudyProgrammeSettingsGUI: Command not supported: $cmd"
134 $this->tpl->setContent($content);
137 protected function view(): string
139 $this->tmp_heading =
"<div class=''>" . $this->
lng->txt(
'prg_async_settings') .
"</div>";
141 return $this->
renderer->render($form);
150 ->buildForm($this->
getObject(), $this->
ctrl->getFormAction($this,
"update"))
151 ->withRequest($this->request);
153 $result = $form->getInputGroup()->getContent();
155 if ($result->isOK()) {
156 $result->value()->update();
157 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
"msg_obj_modified"),
true);
158 $this->
ctrl->redirect($this);
160 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"msg_form_save_error"));
161 return $this->
renderer->render($form);
167 string $submit_action
169 $trans = $prg->getObjectTranslation();
170 $ff = $this->input_factory->field();
171 $sp_types = $this->type_repository->getAllTypesArray();
174 return $this->input_factory->container()->form()->standard(
182 )->withAdditionalTransformation(
183 $this->refinery_factory->custom()->transformation(
184 function ($values) use ($prg) {
185 $object_data = $values[0];
186 $prg->
setTitle($object_data[self::PROP_TITLE]);
190 ->withAssessmentSettings($values[
'prg_assessment'])
191 ->withDeadlineSettings($values[
'prg_deadline'])
192 ->withValidityOfQualificationSettings($values[
'prg_validity_of_qualification'])
193 ->withAutoMailSettings($values[
'automail_settings'])
194 ->withTypeSettings($values[
'prg_type']);
205 InputFieldFactory $ff,
211 $this->getEditSection($ff, $trans),
212 "prg_type" => $settings
214 ->toFormInput($ff, $this->
lng, $this->refinery_factory, $sp_types)
216 "prg_assessment" => $settings
217 ->getAssessmentSettings()
218 ->toFormInput($ff, $this->
lng, $this->refinery_factory)
220 "prg_deadline" => $settings
221 ->getDeadlineSettings()
222 ->toFormInput($ff, $this->
lng, $this->refinery_factory, $this->data_factory)
224 "prg_validity_of_qualification" => $settings
225 ->getValidityOfQualificationSettings()
226 ->toFormInput($ff, $this->
lng, $this->refinery_factory, $this->data_factory)
228 "automail_settings" => $settings
229 ->getAutoMailSettings()
230 ->toFormInput($ff, $this->
lng, $this->refinery_factory)
237 InputFieldFactory $ff,
241 foreach ($this->lom_services->dataHelper()->getAllLanguages() as $language) {
243 $lang = $language->presentableLabel();
249 $ff->text($this->txt(
"title"))
251 ->withRequired(
true),
253 $ff->textarea($this->txt(
"description"))
256 $this->txt(
"prg_edit"),
257 $this->txt(
"language") .
": " .
$lang .
258 ' <a href="' . $this->ctrl->getLinkTargetByClass(TranslationGUI::class,
"") .
259 '">» ' . $this->txt(
"obj_more_translations") .
'</a>'
265 if ($this->
object ===
null) {
268 return $this->object;
271 protected function txt(
string $code): string
273 return $this->
lng->txt($code);
Class handles translation mode for an object.
Class ilCtrl provides processing control methods.
Base class for ILIAS Exception handling.
loadLanguageModule(string $a_module)
Load language module.
@ilCtrl_Calls ilObjStudyProgrammeSettingsGUI: ilStudyProgrammeCommonSettingsGUI
ILIAS HTTP Wrapper RequestWrapper $request_wrapper
ilObjStudyProgramme $object
ilStudyProgrammeCommonSettingsGUI $common_settings_gui
const OPT_NO_VALIDITY_OF_QUALIFICATION
const PROP_VALIDITY_OF_QUALIFICATION
ILIAS UI Component Input Factory $input_factory
const OPT_VALIDITY_OF_QUALIFICATION_DATE
getEditSection(InputFieldFactory $ff, Translations $trans)
const OPT_DEADLINE_PERIOD
buildFormElements(InputFieldFactory $ff, Translations $trans, array $sp_types, ilStudyProgrammeSettings $settings)
buildForm(ilObjStudyProgramme $prg, string $submit_action)
const TAB_COMMON_SETTINGS
__construct(ilGlobalTemplateInterface $tpl, ilCtrl $ilCtrl, ilLanguage $lng, Factory $input_factory, Renderer $renderer, Psr\Http\Message\ServerRequestInterface $request, ILIAS\Refinery\Factory $refinery_factory, ILIAS\Data\Factory $data_factory, ilStudyProgrammeTypeRepository $type_repository, ilStudyProgrammeCommonSettingsGUI $common_settings_gui, ilTabsGUI $tabs, ILIAS\HTTP\Wrapper\RequestWrapper $request_wrapper, LOMServices $lom_services)
LOMServices $lom_services
ILIAS Data Factory $data_factory
ILIAS Refinery Factory $refinery_factory
ilStudyProgrammeTypeRepository $type_repository
const OPT_VALIDITY_OF_QUALIFICATION_PERIOD
ILIAS UI Renderer $renderer
Psr Http Message ServerRequestInterface $request
ilGlobalTemplateInterface $tpl
updateSettings(ilStudyProgrammeSettings $settings)
static getInstanceByRefId($ref_id)
setDescription(string $description)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface RequestWrapper.
An entity that renders components to a string output.
Covers the persistence of sp-type related information.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.