19 declare(strict_types=1);
70 Psr\Http\Message\ServerRequestInterface $request,
76 ILIAS\
HTTP\Wrapper\RequestWrapper $request_wrapper
79 $this->
ctrl = $ilCtrl;
103 $next_class = $this->
ctrl->getNextClass();
104 switch ($next_class) {
105 case 'ilstudyprogrammecommonsettingsgui':
106 $this->
tabs->activateSubTab(self::TAB_COMMON_SETTINGS);
107 $this->common_settings_gui->setObject($this->
getObject());
108 $content = $this->
ctrl->forwardCommand($this->common_settings_gui);
111 $cmd = $this->
ctrl->getCmd();
112 if ($cmd ===
"" || $cmd === null) {
117 $content = $this->
view();
120 $content = $this->$cmd();
124 "ilObjStudyProgrammeSettingsGUI: Command not supported: $cmd" 129 if (!$this->
ctrl->isAsynch()) {
130 $this->tpl->setContent($content);
133 $heading = $this->tmp_heading ?? $this->
lng->txt(
"prg_async_" . $this->
ctrl->getCmd());
134 $output_handler->setHeading($heading);
135 $output_handler->setContent($content);
136 $output_handler->terminate();
140 protected function view(): string
142 $this->tmp_heading =
"<div class=''>" . $this->
lng->txt(
'prg_async_settings') .
"</div>";
144 return $this->renderer->render($form);
153 ->buildForm($this->
getObject(), $this->
ctrl->getFormAction($this,
"update"))
154 ->withRequest($this->request);
156 $result = $form->getInputGroup()->getContent();
161 if ($result->isOK()) {
162 $result->value()->update();
163 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
"msg_obj_modified"),
true);
165 if ($this->
ctrl->isAsynch()) {
169 "message" => $this->
lng->txt(
"msg_obj_modified"))
174 $this->
ctrl->redirect($this);
176 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"msg_form_save_error"));
178 if ($this->
ctrl->isAsynch()) {
182 "errors" => $form->getError())
187 return $this->renderer->render($form);
193 string $submit_action
196 $ff = $this->input_factory->field();
197 $sp_types = $this->type_repository->getAllTypesArray();
200 return $this->input_factory->container()->form()->standard(
208 )->withAdditionalTransformation(
209 $this->refinery_factory->custom()->transformation(
210 function ($values) use ($prg) {
211 $object_data = $values[0];
212 $prg->
setTitle($object_data[self::PROP_TITLE]);
216 ->withAssessmentSettings($values[
'prg_assessment'])
217 ->withDeadlineSettings($values[
'prg_deadline'])
218 ->withValidityOfQualificationSettings($values[
'prg_validity_of_qualification'])
219 ->withAutoMailSettings($values[
'automail_settings'])
220 ->withTypeSettings($values[
'prg_type']);
238 "prg_type" => $settings
240 ->toFormInput($ff, $this->
lng, $this->refinery_factory, $sp_types)
242 "prg_assessment" => $settings
244 ->toFormInput($ff, $this->
lng, $this->refinery_factory)
246 "prg_deadline" => $settings
248 ->toFormInput($ff, $this->
lng, $this->refinery_factory, $this->data_factory)
250 "prg_validity_of_qualification" => $settings
252 ->toFormInput($ff, $this->
lng, $this->refinery_factory, $this->data_factory)
254 "automail_settings" => $settings
256 ->toFormInput($ff, $this->
lng, $this->refinery_factory)
271 $ff->text($this->txt(
"title"))
273 ->withRequired(
true),
275 $ff->textarea($this->
txt(
"description"))
278 $this->
txt(
"prg_edit"),
279 $this->
txt(
"language") .
": " .
$lang .
280 ' <a href="' . $this->
ctrl->getLinkTargetByClass(
"ilobjecttranslationgui",
"") .
281 '">» ' . $this->
txt(
"obj_more_translations") .
'</a>' 287 if ($this->
object === null) {
293 protected function txt(
string $code): string
295 return $this->
lng->txt($code);
ILIAS HTTP Wrapper RequestWrapper $request_wrapper
Class ilAsyncOutputHandler Handles the output for async-requests.
An entity that renders components to a string output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static handleAsyncOutput(string $normal_content, string $async_content=null, bool $apply_to_tpl=true)
Handles async output.
Class ChatMainBarProvider .
const OPT_VALIDITY_OF_QUALIFICATION_PERIOD
const OPT_NO_VALIDITY_OF_QUALIFICATION
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilObjStudyProgramme $object
static getInstanceByRefId($ref_id)
buildForm(ilObjStudyProgramme $prg, string $submit_action)
loadLanguageModule(string $a_module)
Load language module.
const OPT_VALIDITY_OF_QUALIFICATION_DATE
buildFormElements(InputFieldFactory $ff, ilObjectTranslation $trans, array $sp_types, ilStudyProgrammeSettings $settings)
Psr Http Message ServerRequestInterface $request
ilStudyProgrammeTypeRepository $type_repository
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS UI Renderer $renderer
ilStudyProgrammeCommonSettingsGUI $common_settings_gui
ilGlobalTemplateInterface $tpl
static encodeAsyncResponse(array $data=array())
Encode data as json for async output.
getValidityOfQualificationSettings()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const TAB_COMMON_SETTINGS
ILIAS Refinery Factory $refinery_factory
__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)
const OPT_DEADLINE_PERIOD
const PROP_VALIDITY_OF_QUALIFICATION
ILIAS Data Factory $data_factory
ILIAS UI Component Input Factory $input_factory
setDescription(string $description)
ilObjStudyProgrammeSettingsGUI: ilStudyProgrammeCommonSettingsGUI
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
updateSettings(ilStudyProgrammeSettings $settings)
getEditSection(InputFieldFactory $ff, ilObjectTranslation $trans)