19 declare(strict_types=1);
36 protected int $obj_id,
43 $ctrl = $this->gui->ctrl();
44 $next_class = $ctrl->getNextClass($this);
45 $cmd = $ctrl->getCmd(
"edit");
47 switch ($next_class) {
49 if (in_array($cmd, [
"edit",
"save"])) {
55 protected function edit(): void
57 $mt = $this->gui->ui()->mainTemplate();
59 $mt->setContent($form->render());
65 $lng = $this->domain->lng();
68 ->form(self::class,
"save")
69 ->section(
"general",
$lng->txt(
"properties"))
71 ->section(
"avail",
$lng->txt(
"rep_activation_availability"))
73 ->addStdAvailability($this->ref_id,
"spl")
74 ->section(
"presentation",
$lng->txt(
"obj_presentation"))
79 protected function save(): void
81 $mt = $this->gui->ui()->mainTemplate();
83 $ctrl = $this->gui->ctrl();
84 $lng = $this->domain->lng();
86 if ($form->isValid()) {
88 $form->saveStdTitleAndDescription($this->obj_id,
"spl");
89 $form->saveStdTile($this->obj_id,
"spl");
90 $form->saveOnline($this->obj_id,
"spl");
91 $form->saveStdAvailability($this->ref_id);
95 $pool = new \ilObjSurveyQuestionPool($this->ref_id);
98 $mt->setOnScreenMessage(
"success",
$lng->txt(
"msg_obj_modified"),
true);
99 $ctrl->redirectByClass(self::class,
"edit");
101 $mt = $this->gui->ui()->mainTemplate();
102 $mt->setContent($form->render());
Survey question pool internal data service.
__construct(protected InternalDataService $data, protected InternalDomainService $domain, protected InternalGUIService $gui, protected int $obj_id, protected int $ref_id)
ilSetting $global_settings