19 declare(strict_types=1);
47 protected ILIAS\
UI\Renderer $ui_renderer
53 $cmd = $this->
ctrl->getCmd();
56 case self::CMD_CANCEL:
57 $this->
ctrl->redirect($this, self::CMD_MANAGE_CONTENT);
59 case self::CMD_MANAGE_CONTENT:
61 case self::CMD_DELETE:
62 case self::CMD_CONFIRM_DELETE:
66 throw new ilException(
"ilObjLearningSequenceContentGUI: Command not supported: $cmd");
73 $this->parent_gui->showPossibleSubObjects();
75 $data = $this->parent_gui->getObject()->getLSItems();
83 $alert_icon = $this->ui_renderer->render(
84 $this->ui_factory->symbol()->icon()
91 self::CMD_MANAGE_CONTENT,
97 $this->ls_item_online_status,
101 $table->setData($ls_items);
102 $table->addMultiCommand(self::CMD_CONFIRM_DELETE, $this->
lng->txt(
"delete"));
104 $table->addCommandButton(self::CMD_SAVE, $this->
lng->txt(
"save"));
106 $this->tpl->setContent($table->getHtml());
114 $this->parent_gui->deleteObject();
117 protected function delete():
void 119 $ref_ids = $this->post_wrapper->retrieve(
124 $this->parent_gui->getObject()->deletePostConditionsForSubObjects($ref_ids);
126 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
'entries_deleted'),
true);
127 $this->
ctrl->redirect($this, self::CMD_MANAGE_CONTENT);
135 return $this->parent_gui->getObject()->getPossiblePostConditionsForType($type);
141 return implode(
'_', [$field_name, (
string) $ref_id]);
144 protected function save(): void
146 $data = $this->parent_gui->getObject()->getLSItems();
150 foreach (
$data as $lsitem) {
156 $condition_type = $this->post_wrapper->retrieve($condition_type,
$r->kindlyTo()->string());
157 $online = $this->post_wrapper->retrieve($online,
$r->byTrying([
$r->kindlyTo()->bool(),
$r->always(
false)]));
158 $order = $this->post_wrapper->retrieve(
161 $r->kindlyTo()->string(),
162 $r->custom()->transformation(fn($v) => ltrim($v,
'0')),
163 $r->kindlyTo()->int()
167 $condition = $lsitem->getPostCondition()
168 ->withConditionOperator($condition_type);
170 ->withOnline($online)
171 ->withOrderNumber($order)
172 ->withPostCondition($condition);
175 $this->parent_gui->getObject()->storeLSItems(
$updated);
176 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
'entries_updated'),
true);
177 $this->
ctrl->redirect($this, self::CMD_MANAGE_CONTENT);
Class ChatMainBarProvider .
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
getFieldName(string $field_name, int $ref_id)
confirmDelete()
Handle the confirmDelete command.
getPossiblePostConditionsForType(string $type)
renderTable(array $ls_items)
Class ilObjLearningSequenceGUI ilObjLearningSequenceGUI: ilRepositoryGUI ilObjLearningSequenceGUI: ...
__construct(protected ilObjLearningSequenceGUI $parent_gui, protected ilCtrl $ctrl, protected ilGlobalTemplateInterface $tpl, protected ilLanguage $lng, protected ilAccess $access, protected ilConfirmationGUI $confirmation_gui, protected LSItemOnlineStatus $ls_item_online_status, protected ArrayBasedRequestWrapper $post_wrapper, protected Factory $refinery, protected ILIAS\UI\Factory $ui_factory, protected ILIAS\UI\Renderer $ui_renderer)
const FIELD_POSTCONDITION_TYPE
Refinery Factory $refinery