28 protected \ILIAS\LearningModule\InternalDomainService
$domain;
29 protected \ILIAS\LearningModule\InternalGUIService
$gui;
43 $this->
user = $DIC->user();
44 $this->
ctrl = $DIC->ctrl();
45 $this->
lng = $DIC->language();
46 $this->
tabs = $DIC->tabs();
47 $this->log =
$DIC[
"ilLog"];
48 $this->tpl =
$DIC->ui()->mainTemplate();
50 $this->tree = $a_tree;
51 $this->gui =
$DIC->learningModule()->internal()->gui();
52 $this->domain =
$DIC->learningModule()->internal()->domain();
58 $this->obj = $a_st_object;
68 $next_class = $this->
ctrl->getNextClass($this);
69 $cmd = $this->
ctrl->getCmd();
71 switch ($next_class) {
72 case 'ilobjectmetadatagui':
76 $md_gui =
new ilObjectMetaDataGUI($this->content_object, $this->obj->getType(), $this->obj->getId());
77 $md_gui->addMDObserver($this->obj,
'MDUpdateListener',
'General');
78 $md_gui->addMDObserver($this->obj,
'MDUpdateListener',
'Educational');
79 $this->
ctrl->forwardCommand($md_gui);
82 case "ilconditionhandlergui":
83 $ilTabs = $this->tabs;
86 $this->initConditionHandlerInterface();
87 $this->
ctrl->forwardCommand($this->condHI);
88 $ilTabs->setTabActive(
'preconditions');
91 case strtolower(EditSubObjectsGUI::class):
93 $this->
tabs->activateTab(
"sub_pages");
94 if ($this->request->getSubType() ===
"pg") {
95 $this->addSubTabs(
"sub_pages");
96 $table_title = $this->
lng->txt(
"cont_pages");
98 $this->addSubTabs(
"sub_chapters");
99 $table_title = $this->
lng->txt(
"cont_subchapters");
101 $gui = $this->gui->editing()->editSubObjectsGUI(
102 $this->request->getSubType(),
103 $this->content_object,
106 $this->
ctrl->forwardCommand($gui);
110 if ($cmd ==
'listConditions') {
112 $this->initConditionHandlerInterface();
113 $this->condHI->executeCommand();
114 } elseif (($cmd ==
"create") && ($this->requested_new_type ==
"pg")) {
117 $pg_gui->executeCommand();
127 if ($this->requested_obj_id != 0) {
140 $this->
ctrl->redirectByClass(EditSubObjectsGUI::class,
"editPages");
147 $this->condHI->setBackButtons(array());
148 $this->condHI->setAutomaticValidation(
false);
149 $this->condHI->setTargetType(
"st");
150 $this->condHI->setTargetRefId($this->content_object->getRefId());
151 $this->condHI->setTargetId($this->obj->getId());
152 $this->condHI->setTargetTitle($this->obj->getTitle());
161 if ($this->requested_obj_id != 0) {
162 if ($this->requested_new_type ==
"pg") {
163 $this->
ctrl->redirect($this,
"view");
165 $this->
ctrl->redirect($this,
"subchap");
172 $ilTabs = $this->tabs;
176 $this->
ctrl->setParameterByClass(static::class,
"sub_type",
"pg");
179 $lng->txt(
"cont_content"),
180 $this->ctrl->getLinkTargetByClass(EditSubObjectsGUI::class)
186 $lng->txt(
"preconditions"),
187 $this->ctrl->getLinkTarget($this,
'listConditions')
191 $mdgui =
new ilObjectMetaDataGUI($this->content_object, $this->obj->getType(), $this->obj->getId());
192 $mdtab = $mdgui->getTab();
196 $lng->txt(
"meta_data"),
202 $this->tpl->setTitle(
203 $this->
lng->txt($this->obj->getType()) .
": " . $this->obj->getTitle()
207 $ilTabs->addNonTabbedLink(
209 $lng->txt(
"cont_presentation_view"),
210 ILIAS_HTTP_PATH .
"/goto.php?target=st_" . $this->obj->getId()
216 $ilTabs = $this->tabs;
220 $this->
ctrl->setParameterByClass(static::class,
"sub_type",
"pg");
223 $lng->txt(
"cont_pages"),
224 $this->ctrl->getLinkTargetByClass(EditSubObjectsGUI::class)
228 $this->
ctrl->setParameterByClass(static::class,
"sub_type",
"st");
231 $lng->txt(
"cont_subchapters"),
232 $this->ctrl->getLinkTargetByClass(EditSubObjectsGUI::class)
234 $ilTabs->activateSubTab($active);
242 int $a_target_ref_id = 0
245 $main_tpl =
$DIC->ui()->mainTemplate();
248 $ilAccess =
$DIC->access();
249 $ctrl =
$DIC->ctrl();
258 if (in_array($a_target_ref_id, $ref_ids)) {
259 $ref_ids = array_merge(array($a_target_ref_id), $ref_ids);
263 foreach ($ref_ids as
$ref_id) {
265 if ($ilAccess->checkAccess(
"read",
"",
$ref_id)) {
266 $ctrl->setParameterByClass(
"ilLMPresentationGUI",
"obj_id", $a_target);
267 $ctrl->setParameterByClass(
"ilLMPresentationGUI",
"ref_id",
$ref_id);
268 $ctrl->redirectByClass(
"ilLMPresentationGUI",
"");
273 $main_tpl->setOnScreenMessage(
'failure', sprintf(
274 $lng->txt(
"msg_no_perm_read_item"),
294 $ilCtrl = $this->ctrl;
297 $ids = $this->request->getIds();
298 if (count($ids) == 0) {
299 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
"no_checkbox"),
true);
300 $ilCtrl->redirect($this,
"showHierarchy");
303 $this->initSetPageLayoutForm();
305 $tpl->setContent($this->
form->getHTML());
314 $ilCtrl = $this->ctrl;
318 $ids = $this->request->getIds();
319 foreach ($ids as
$id) {
322 $this->
form->addItem($hi);
325 $lng->txt(
"cont_layout"),
327 $this->content_object->getLayout()
330 $this->
form->addItem($layout);
332 $this->
form->addCommandButton(
"savePageLayout",
$lng->txt(
"save"));
333 $this->
form->addCommandButton(
"showHierarchy",
$lng->txt(
"cancel"));
335 $this->
form->setTitle(
$lng->txt(
"cont_set_layout"));
336 $this->
form->setFormAction($ilCtrl->getFormAction($this));
345 $ilCtrl = $this->ctrl;
347 $ids = $this->request->getIds();
348 $layout = $this->request->getLayout();
349 foreach ($ids as
$id) {
353 $this->content_object
356 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"msg_obj_modified"),
true);
357 $ilCtrl->redirect($this,
"showHierarchy");
362 $ilCtrl = $this->ctrl;
364 $ilCtrl->setParameter($this,
"transl",
"-");
365 $ilCtrl->redirect($this,
"showHierarchy");
370 $ilCtrl = $this->ctrl;
372 $ilCtrl->setParameter($this,
"transl", $this->requested_totransl);
373 $ilCtrl->redirect($this,
"showHierarchy");
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
class ilConditionHandlerGUI
Base class for ilStructureObjects and ilPageObjects (see ILIAS DTD)
static writeLayout(int $a_obj_id, string $a_layout, ?ilObjLearningModule $a_lm=null)
Write layout setting.
static _lookupContObjID(int $a_id)
get learning module id for lm object
User Interface for Learning Module Page Objects Editing.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Component logger with individual log levels by component id.
static getLayoutOption(string $a_txt, string $a_var, string $a_def_option="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupTitle(int $obj_id)
@ilCtrl_Calls ilStructureObjectGUI: ilConditionHandlerGUI, ilObjectMetaDataGUI @ilCtrl_Calls ilStruct...
initSetPageLayoutForm()
Init set page layout form.
static _goto(string $a_target, int $a_target_ref_id=0)
initConditionHandlerInterface()
create()
structure / page object creation form
savePageLayout()
Save page layout.
ILIAS LearningModule InternalDomainService $domain
cancel()
cancel creation of new page or chapter
__construct(ilObjLearningModule $a_content_obj, ilLMTree $a_tree)
ilConditionHandlerGUI $condHI
setStructureObject(ilStructureObject $a_st_object)
setPageLayout()
Set layout for multipl pages.
ILIAS LearningModule InternalGUIService $gui
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
form( $class_path, string $cmd, string $submit_caption="")