ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilStructureObjectGUI Class Reference

User Interface for Structure Objects Editing. More...

+ Inheritance diagram for ilStructureObjectGUI:
+ Collaboration diagram for ilStructureObjectGUI:

Public Member Functions

 __construct (ilObjLearningModule $a_content_obj, ilLMTree $a_tree)
 
 setStructureObject (ilStructureObject $a_st_object)
 
 getType ()
 
 executeCommand ()
 
 create ()
 
 edit ()
 
 view ()
 
 showHierarchy ()
 
 cutItems (string $a_return="view")
 Copy items to clipboard, then cut them from the current tree. More...
 
 copyItems (string $a_return="view")
 Copy items to clipboard. More...
 
 saveAllTitles ()
 Save all titles of chapters/pages. More...
 
 subchap ()
 display subchapters of structure object More...
 
 save ()
 
 putInTree (?int $target=null)
 put chapter into tree More...
 
 cutPage ()
 
 copyPage ()
 
 pastePage ()
 
 cutChapter ()
 
 copyChapter ()
 copy a single chapter (selection) More...
 
 pasteChapter ()
 
 activatePages ()
 
 initConditionHandlerInterface ()
 
 cancel ()
 cancel creation of new page or chapter More...
 
 setTabs ()
 
 insertChapter (bool $a_as_sub=false)
 Insert (multiple) chapters at node. More...
 
 insertSubchapter ()
 Insert (multiple) subchapters at node. More...
 
 insertChapterClip (bool $a_as_sub=false, string $a_return="view")
 Insert Chapter from clipboard. More...
 
 insertSubchapterClip ()
 
 insertPage ()
 
 insertPageClip ()
 
 proceedDragDrop ()
 
 setPageLayout ()
 Set layout for multipl pages. More...
 
 initSetPageLayoutForm ()
 Init set page layout form. More...
 
 savePageLayout ()
 Save page layout. More...
 
 editMasterLanguage ()
 
 switchToLanguage ()
 
 insertTemplate ()
 Displays GUI to select template for page. More...
 
 initInsertTemplateForm ()
 
 insertPageFromTemplate ()
 Insert (multiple) pages templates at node. More...
 
- Public Member Functions inherited from ilLMObjectGUI
 __construct (ilObjLearningModule $a_content_obj)
 constructor More...
 
 setActions (?array $a_actions=null)
 
 getTargetFrame (string $a_cmd, string $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 create ()
 structure / page object creation form More...
 
 getCreateForm ()
 
 putInTree (?int $target=0)
 put this object into content object tree More...
 
 delete ()
 Confirm deletion screen (delete page or structure objects) More...
 
 setTabs ()
 
 cancelDelete ()
 cancel deletion of page/structure objects More...
 
 confirmedDelete ()
 page and structure object deletion More...
 
 showActions (array $a_actions)
 show possible action (form buttons) More...
 
 checkTree ()
 check the content object tree More...
 

Static Public Member Functions

static _goto (string $a_target, int $a_target_ref_id=0)
 

Data Fields

ilLMTree $tree
 
- Data Fields inherited from ilLMObjectGUI
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilLMObject $obj
 
ilCtrl $ctrl
 
ilObjLearningModule $content_object
 
array $actions
 

Protected Attributes

ilPropertyFormGUI $form
 
ilConditionHandlerGUI $condHI
 
ilObjUser $user
 
ilTabsGUI $tabs
 
ilLogger $log
 
- Protected Attributes inherited from ilLMObjectGUI
int $requested_ref_id
 
ILIAS DI UIServices $ui
 
int $requested_obj_id
 
string $requested_totransl = ""
 
string $requested_transl = ""
 
string $requested_target
 
string $requested_new_type
 
array $target_frame
 
EditingGUIRequest $request
 

Detailed Description

User Interface for Structure Objects Editing.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de ilStructureObjectGUI: ilConditionHandlerGUI, ilObjectMetaDataGUI

Definition at line 27 of file class.ilStructureObjectGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilStructureObjectGUI::__construct ( ilObjLearningModule  $a_content_obj,
ilLMTree  $a_tree 
)

Definition at line 36 of file class.ilStructureObjectGUI.php.

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\tabs(), and ILIAS\Repository\user().

39  {
40  global $DIC;
41 
42  $this->user = $DIC->user();
43  $this->ctrl = $DIC->ctrl();
44  $this->lng = $DIC->language();
45  $this->tabs = $DIC->tabs();
46  $this->log = $DIC["ilLog"];
47  $this->tpl = $DIC->ui()->mainTemplate();
48  parent::__construct($a_content_obj);
49  $this->tree = $a_tree;
50  }
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilStructureObjectGUI::_goto ( string  $a_target,
int  $a_target_ref_id = 0 
)
static
Exceptions
ilPermissionException

Definition at line 559 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, $DIC, ilLMObjectGUI\$lng, $ref_id, ilObject\_getAllReferences(), ilObjectGUI\_gotoRepositoryRoot(), ilLMObject\_lookupContObjID(), ilObject\_lookupTitle(), ilCtrl\redirectByClass(), ROOT_FOLDER_ID, ilCtrl\setParameterByClass(), and ilLanguage\txt().

Referenced by ILIAS\StaticURL\Handler\LegacyGotoHandler\handle().

562  : void {
563  global $DIC;
564  $main_tpl = $DIC->ui()->mainTemplate();
565 
566  $lng = $DIC->language();
567  $ilAccess = $DIC->access();
568  $ctrl = $DIC->ctrl();
569 
570  // determine learning object
571  $lm_id = ilLMObject::_lookupContObjID($a_target);
572 
573  // get all references
574  $ref_ids = ilObject::_getAllReferences($lm_id);
575 
576  // always try passed ref id first
577  if (in_array($a_target_ref_id, $ref_ids)) {
578  $ref_ids = array_merge(array($a_target_ref_id), $ref_ids);
579  }
580 
581  // check read permissions
582  foreach ($ref_ids as $ref_id) {
583  // Permission check
584  if ($ilAccess->checkAccess("read", "", $ref_id)) {
585  $ctrl->setParameterByClass("ilLMPresentationGUI", "obj_id", $a_target);
586  $ctrl->setParameterByClass("ilLMPresentationGUI", "ref_id", $ref_id);
587  $ctrl->redirectByClass("ilLMPresentationGUI", "");
588  }
589  }
590 
591  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
592  $main_tpl->setOnScreenMessage('failure', sprintf(
593  $lng->txt("msg_no_perm_read_item"),
594  ilObject::_lookupTitle($lm_id)
595  ), true);
597  }
598 
599  throw new ilPermissionException($lng->txt("msg_no_perm_read_lm"));
600  }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
const ROOT_FOLDER_ID
Definition: constants.php:32
static _getAllReferences(int $id)
get all reference ids for object ID
setParameterByClass(string $a_class, string $a_parameter, $a_value)
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ref_id
Definition: ltiauth.php:67
static _lookupTitle(int $obj_id)
static _lookupContObjID(int $a_id)
get learning module id for lm object
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ activatePages()

ilStructureObjectGUI::activatePages ( )

Definition at line 427 of file class.ilStructureObjectGUI.php.

References $id, ilLMObjectGUI\$lng, $path, ilPageObject\_lookupActive(), ilLMObject\_lookupType(), ilPageObject\_writeActive(), ILIAS\Repository\ctrl(), and ilLanguage\txt().

427  : void
428  {
429  $lng = $this->lng;
430 
431  $ids = $this->request->getIds();
432  if (count($ids) > 0) {
433  $act_items = array();
434  // get all "top" ids, i.e. remove ids, that have a selected parent
435  foreach ($ids as $id) {
436  $path = $this->tree->getPathId($id);
437  $take = true;
438  foreach ($path as $path_id) {
439  if ($path_id != $id && in_array($path_id, $ids)) {
440  $take = false;
441  }
442  }
443  if ($take) {
444  $act_items[] = $id;
445  }
446  }
447 
448 
449  foreach ($act_items as $id) {
450  $childs = $this->tree->getChilds($id);
451  foreach ($childs as $child) {
452  if (ilLMObject::_lookupType($child["child"]) == "pg") {
454  $child["child"],
455  $this->content_object->getType()
456  );
458  $child["child"],
459  $this->content_object->getType(),
460  !$act
461  );
462  }
463  }
464  if (ilLMObject::_lookupType($id) == "pg") {
466  $id,
467  $this->content_object->getType()
468  );
470  $id,
471  $this->content_object->getType(),
472  !$act
473  );
474  }
475  }
476  } else {
477  $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
478  }
479 
480  $this->ctrl->redirect($this, "view");
481  }
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
$path
Definition: ltiservices.php:32
static _writeActive(int $a_id, string $a_parent_type, bool $a_active)
write activation status
static _lookupType(int $a_obj_id, int $a_lm_id=0)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ cancel()

ilStructureObjectGUI::cancel ( )

cancel creation of new page or chapter

Definition at line 498 of file class.ilStructureObjectGUI.php.

References ILIAS\Repository\ctrl().

498  : void
499  {
500  if ($this->requested_obj_id != 0) {
501  if ($this->requested_new_type == "pg") {
502  $this->ctrl->redirect($this, "view");
503  } else {
504  $this->ctrl->redirect($this, "subchap");
505  }
506  }
507  }
+ Here is the call graph for this function:

◆ copyChapter()

ilStructureObjectGUI::copyChapter ( )

copy a single chapter (selection)

Definition at line 417 of file class.ilStructureObjectGUI.php.

References copyItems().

417  : void
418  {
419  $this->copyItems("subchap");
420  }
copyItems(string $a_return="view")
Copy items to clipboard.
+ Here is the call graph for this function:

◆ copyItems()

ilStructureObjectGUI::copyItems ( string  $a_return = "view")

Copy items to clipboard.

Definition at line 200 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, ilLMObjectGUI\$lng, ilLMObject\clipboardCopy(), ilEditClipboard\setAction(), ilLanguage\txt(), and ilLMObject\uniqueTypesCheck().

Referenced by copyChapter(), and copyPage().

202  : void {
203  $ilCtrl = $this->ctrl;
204  $lng = $this->lng;
205 
206  $items = $this->request->getIds();
207  if (count($items) == 0) {
208  $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
209  $ilCtrl->redirect($this, "showHierarchy");
210  }
211 
212  $todel = array(); // delete IDs < 0 (needed for non-js editing)
213  foreach ($items as $k => $item) {
214  if ($item < 0) {
215  $todel[] = $k;
216  }
217  }
218  foreach ($todel as $k) {
219  unset($items[$k]);
220  }
221 
222  if (!ilLMObject::uniqueTypesCheck($items)) {
223  $this->tpl->setOnScreenMessage('failure', $lng->txt("cont_choose_pages_or_chapters_only"), true);
224  $ilCtrl->redirect($this, "showHierarchy");
225  }
226 
227  ilLMObject::clipboardCopy($this->content_object->getId(), $items);
229 
230  $this->tpl->setOnScreenMessage('info', $lng->txt("cont_selected_items_have_been_copied"), true);
231  $ilCtrl->redirect($this, $a_return);
232  }
static setAction(string $a_action)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static uniqueTypesCheck(array $a_items)
Check for unique types (all pages or all chapters)
static clipboardCopy(int $a_cont_obj_id, array $a_ids)
Copy a set of chapters/pages into the clipboard.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyPage()

ilStructureObjectGUI::copyPage ( )

Definition at line 393 of file class.ilStructureObjectGUI.php.

References copyItems().

393  : void
394  {
395  $this->copyItems();
396  }
copyItems(string $a_return="view")
Copy items to clipboard.
+ Here is the call graph for this function:

◆ create()

ilStructureObjectGUI::create ( )

Definition at line 104 of file class.ilStructureObjectGUI.php.

References setTabs().

104  : void
105  {
106  if ($this->requested_obj_id != 0) {
107  $this->setTabs();
108  }
109  parent::create();
110  }
+ Here is the call graph for this function:

◆ cutChapter()

ilStructureObjectGUI::cutChapter ( )

Definition at line 409 of file class.ilStructureObjectGUI.php.

References cutItems().

409  : void
410  {
411  $this->cutItems("subchap");
412  }
cutItems(string $a_return="view")
Copy items to clipboard, then cut them from the current tree.
+ Here is the call graph for this function:

◆ cutItems()

ilStructureObjectGUI::cutItems ( string  $a_return = "view")

Copy items to clipboard, then cut them from the current tree.

Definition at line 163 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, ilLMObjectGUI\$lng, ilLMObject\clipboardCut(), ilEditClipboard\setAction(), ilLanguage\txt(), and ilLMObject\uniqueTypesCheck().

Referenced by cutChapter(), and cutPage().

165  : void {
166  $ilCtrl = $this->ctrl;
167  $lng = $this->lng;
168 
169  $items = $this->request->getIds();
170  if (count($items) == 0) {
171  $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
172  $ilCtrl->redirect($this, "showHierarchy");
173  }
174 
175  $todel = array(); // delete IDs < 0 (needed for non-js editing)
176  foreach ($items as $k => $item) {
177  if ($item < 0) {
178  $todel[] = $k;
179  }
180  }
181  foreach ($todel as $k) {
182  unset($items[$k]);
183  }
184 
185  if (!ilLMObject::uniqueTypesCheck($items)) {
186  $this->tpl->setOnScreenMessage('failure', $lng->txt("cont_choose_pages_or_chapters_only"), true);
187  $ilCtrl->redirect($this, "showHierarchy");
188  }
189 
190  ilLMObject::clipboardCut($this->content_object->getId(), $items);
192  $this->tpl->setOnScreenMessage('info', $lng->txt("cont_selected_items_have_been_cut"), true);
193 
194  $ilCtrl->redirect($this, $a_return);
195  }
static setAction(string $a_action)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static uniqueTypesCheck(array $a_items)
Check for unique types (all pages or all chapters)
static clipboardCut(int $a_cont_obj_id, array $a_ids)
Copy a set of chapters/pages into the clipboard.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cutPage()

ilStructureObjectGUI::cutPage ( )

Definition at line 388 of file class.ilStructureObjectGUI.php.

References cutItems().

388  : void
389  {
390  $this->cutItems();
391  }
cutItems(string $a_return="view")
Copy items to clipboard, then cut them from the current tree.
+ Here is the call graph for this function:

◆ edit()

ilStructureObjectGUI::edit ( )

Definition at line 112 of file class.ilStructureObjectGUI.php.

References view().

112  : void
113  {
114  $this->view();
115  }
+ Here is the call graph for this function:

◆ editMasterLanguage()

ilStructureObjectGUI::editMasterLanguage ( )

Definition at line 893 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, and ilCtrl\setParameter().

893  : void
894  {
895  $ilCtrl = $this->ctrl;
896 
897  $ilCtrl->setParameter($this, "transl", "-");
898  $ilCtrl->redirect($this, "showHierarchy");
899  }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ executeCommand()

ilStructureObjectGUI::executeCommand ( )

Definition at line 63 of file class.ilStructureObjectGUI.php.

References $tabs, ilObjectMetaDataGUI\addMDObserver(), ILIAS\Repository\ctrl(), initConditionHandlerInterface(), and setTabs().

63  : void
64  {
65  $next_class = $this->ctrl->getNextClass($this);
66  $cmd = $this->ctrl->getCmd();
67 
68  switch ($next_class) {
69  case 'ilobjectmetadatagui':
70 
71  $this->setTabs();
72 
73  $md_gui = new ilObjectMetaDataGUI($this->content_object, $this->obj->getType(), $this->obj->getId());
74  $md_gui->addMDObserver($this->obj, 'MDUpdateListener', 'General');
75  $md_gui->addMDObserver($this->obj, 'MDUpdateListener', 'Educational'); // #9510
76  $this->ctrl->forwardCommand($md_gui);
77  break;
78 
79  case "ilconditionhandlergui":
80  $ilTabs = $this->tabs;
81 
82  $this->setTabs();
84  $this->ctrl->forwardCommand($this->condHI);
85  $ilTabs->setTabActive('preconditions');
86  break;
87 
88  default:
89  if ($cmd == 'listConditions') {
90  $this->setTabs();
92  $this->condHI->executeCommand();
93  } elseif (($cmd == "create") && ($this->requested_new_type == "pg")) {
94  $this->setTabs();
95  $pg_gui = new ilLMPageObjectGUI($this->content_object);
96  $pg_gui->executeCommand();
97  } else {
98  $this->$cmd();
99  }
100  break;
101  }
102  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addMDObserver(object $class, string $method, string $section)
User Interface for Learning Module Page Objects Editing.
+ Here is the call graph for this function:

◆ getType()

ilStructureObjectGUI::getType ( )

Definition at line 58 of file class.ilStructureObjectGUI.php.

58  : string
59  {
60  return "st";
61  }

◆ initConditionHandlerInterface()

ilStructureObjectGUI::initConditionHandlerInterface ( )

Definition at line 483 of file class.ilStructureObjectGUI.php.

Referenced by executeCommand().

483  : void
484  {
485  $this->condHI = new ilConditionHandlerGUI();
486  $this->condHI->setBackButtons(array());
487  $this->condHI->setAutomaticValidation(false);
488  $this->condHI->setTargetType("st");
489  $this->condHI->setTargetRefId($this->content_object->getRefId());
490  $this->condHI->setTargetId($this->obj->getId());
491  $this->condHI->setTargetTitle($this->obj->getTitle());
492  }
class ilConditionHandlerGUI
+ Here is the caller graph for this function:

◆ initInsertTemplateForm()

ilStructureObjectGUI::initInsertTemplateForm ( )

Definition at line 931 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, Vendor\Package\$f, ilLMObjectGUI\$lng, ilLMObjectGUI\$ui, ilCtrl\getLinkTarget(), ilPageLayout\MODULE_LM, and ilLanguage\txt().

Referenced by insertPageFromTemplate(), and insertTemplate().

931  : Form\Standard
932  {
933  $ui = $this->ui;
934  $f = $ui->factory();
935  $ctrl = $this->ctrl;
936  $lng = $this->lng;
937 
938  $fields["title"] = $f->input()->field()->text($lng->txt("title"), "");
939  $ts = ilPageLayoutGUI::getTemplateSelection(ilPageLayout::MODULE_LM);
940  if (!is_null($ts)) {
941  $fields["layout_id"] = $ts;
942  }
943 
944  // section
945  $section1 = $f->input()->field()->section($fields, $lng->txt("cont_insert_pagelayout"));
946 
947  $form_action = $ctrl->getLinkTarget($this, "insertPageFromTemplate");
948  return $f->input()->container()->form()->standard($form_action, ["sec" => $section1]);
949  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
ILIAS DI UIServices $ui
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSetPageLayoutForm()

ilStructureObjectGUI::initSetPageLayoutForm ( )

Init set page layout form.

Definition at line 844 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, $id, ilLMObjectGUI\$lng, ILIAS\Repository\form(), ilObjContentObjectGUI\getLayoutOption(), and ilLanguage\txt().

Referenced by setPageLayout().

844  : void
845  {
846  $lng = $this->lng;
847  $ilCtrl = $this->ctrl;
848 
849  $this->form = new ilPropertyFormGUI();
850 
851  $ids = $this->request->getIds();
852  foreach ($ids as $id) {
853  $hi = new ilHiddenInputGUI("id[]");
854  $hi->setValue($id);
855  $this->form->addItem($hi);
856  }
858  $lng->txt("cont_layout"),
859  "layout",
860  $this->content_object->getLayout()
861  );
862 
863  $this->form->addItem($layout);
864 
865  $this->form->addCommandButton("savePageLayout", $lng->txt("save"));
866  $this->form->addCommandButton("showHierarchy", $lng->txt("cancel"));
867 
868  $this->form->setTitle($lng->txt("cont_set_layout"));
869  $this->form->setFormAction($ilCtrl->getFormAction($this));
870  }
static getLayoutOption(string $a_txt, string $a_var, string $a_def_option="")
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
form( $class_path, string $cmd, string $submit_caption="")
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertChapter()

ilStructureObjectGUI::insertChapter ( bool  $a_as_sub = false)

Insert (multiple) chapters at node.

Definition at line 605 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, ilLMObjectGUI\$lng, ilHierarchyFormGUI\getPostFirstChild(), ilHierarchyFormGUI\getPostMulti(), ilHierarchyFormGUI\getPostNodeId(), ilTree\POS_FIRST_NODE, ilLMObject\putInTree(), and ilLanguage\txt().

Referenced by insertSubchapter().

607  : void {
608  $ilCtrl = $this->ctrl;
609  $lng = $this->lng;
610 
613 
614  if ($a_as_sub) { // as subchapter
615  if (!ilChapterHierarchyFormGUI::getPostFirstChild()) { // insert under parent
616  $parent_id = $node_id;
617  $target = "";
618  } else { // we shouldnt end up here
619  $ilCtrl->redirect($this, "showHierarchy");
620  return;
621  }
622  } else { // as chapter
623  if (!ilChapterHierarchyFormGUI::getPostFirstChild()) { // insert after node id
624  $parent_id = $this->tree->getParentId($node_id);
625  $target = $node_id;
626  } else { // insert as first child
627  $parent_id = $node_id;
628  $target = ilTree::POS_FIRST_NODE;
629  }
630  }
631  for ($i = 1; $i <= $num; $i++) {
632  $chap = new ilStructureObject($this->content_object);
633  $chap->setType("st");
634  $chap->setTitle($lng->txt("cont_new_chap"));
635  $chap->setLMId($this->content_object->getId());
636  $chap->create();
637  ilLMObject::putInTree($chap, (int) $parent_id, (int) $target);
638  }
639 
640  $ilCtrl->redirect($this, "view");
641  }
static getPostMulti()
Get multi number of _POST input.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getPostNodeId()
Get node ID of _POST input.
static putInTree(ilLMObject $a_obj, int $a_parent_id=0, int $a_target_node_id=0)
put this object into content object tree
static getPostFirstChild()
Should node be inserted as first child of target node (true) or as successor (false) ...
const POS_FIRST_NODE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertChapterClip()

ilStructureObjectGUI::insertChapterClip ( bool  $a_as_sub = false,
string  $a_return = "view" 
)

Insert Chapter from clipboard.

Definition at line 654 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, $log, $user, ilEditClipboard\clear(), ilEditClipboard\getAction(), ilHierarchyFormGUI\getPostFirstChild(), ilHierarchyFormGUI\getPostNodeId(), ilTree\POS_FIRST_NODE, ilLMObject\updateInternalLinks(), and ilLogger\write().

Referenced by insertSubchapterClip(), and pasteChapter().

657  : void {
658  $ilUser = $this->user;
659  $ilCtrl = $this->ctrl;
660  $ilLog = $this->log;
661 
662  $ilLog->write("Insert Chapter From Clipboard");
663 
664 
667 
668  if ($a_as_sub) { // as subchapter
669  if (!$first_child) { // insert under parent
670  $parent_id = $node_id;
671  $target = "";
672  } else { // we shouldnt end up here
673  $ilCtrl->redirect($this, "showHierarchy");
674  return;
675  }
676  } else { // as chapter
677  if (!$first_child) { // insert after node id
678  $parent_id = $this->tree->getParentId($node_id);
679  $target = $node_id;
680  } else { // insert as first child
681  $parent_id = $node_id;
682  $target = ilTree::POS_FIRST_NODE;
683 
684  // do not move a chapter in front of a page
685  $childs = $this->tree->getChildsByType($parent_id, "pg");
686  if (count($childs) != 0) {
687  $target = $childs[count($childs) - 1]["obj_id"];
688  }
689  }
690  }
691 
692  // copy and paste
693  $chapters = $ilUser->getClipboardObjects("st", true);
694  $copied_nodes = array();
695 
696  foreach ($chapters as $chap) {
697  $ilLog->write("Call pasteTree, Target LM: " . $this->content_object->getId() . ", Chapter ID: " . $chap["id"]
698  . ", Parent ID: " . $parent_id . ", Target: " . $target);
699  $cid = ilLMObject::pasteTree(
700  $this->content_object,
701  $chap["id"],
702  $parent_id,
703  (int) $target,
704  (string) ($chap["insert_time"] ?? ""),
705  $copied_nodes,
706  (ilEditClipboard::getAction() == "copy")
707  );
708  $target = $cid;
709  }
710  ilLMObject::updateInternalLinks($copied_nodes);
711 
712  if (ilEditClipboard::getAction() == "cut") {
713  $ilUser->clipboardDeleteObjectsOfType("pg");
714  $ilUser->clipboardDeleteObjectsOfType("st");
716  }
717 
718  $this->content_object->checkTree();
719  $ilCtrl->redirect($this, $a_return);
720  }
static updateInternalLinks(array $a_copied_nodes, string $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
write(string $message, $level=ilLogLevel::INFO, array $context=[])
write log message
static getPostNodeId()
Get node ID of _POST input.
static getPostFirstChild()
Should node be inserted as first child of target node (true) or as successor (false) ...
const POS_FIRST_NODE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertPage()

ilStructureObjectGUI::insertPage ( )

Definition at line 727 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, ilLMObjectGUI\$lng, ilHierarchyFormGUI\getPostFirstChild(), ilHierarchyFormGUI\getPostMulti(), ilHierarchyFormGUI\getPostNodeId(), ILIAS\Repository\lng(), ilTree\POS_FIRST_NODE, ilLMObject\putInTree(), and ilLanguage\txt().

727  : void
728  {
729  $ilCtrl = $this->ctrl;
730  $lng = $this->lng;
731 
734 
735  if (!ilChapterHierarchyFormGUI::getPostFirstChild()) { // insert after node id
736  $parent_id = $this->tree->getParentId($node_id);
737  $target = $node_id;
738  } else { // insert as first child
739  $parent_id = $node_id;
740  $target = ilTree::POS_FIRST_NODE;
741  }
742 
743  for ($i = 1; $i <= $num; $i++) {
744  $page = new ilLMPageObject($this->content_object);
745  $page->setType("pg");
746  $page->setTitle($lng->txt("cont_new_page"));
747  $page->setLMId($this->content_object->getId());
748  $page->create();
749  ilLMObject::putInTree($page, $parent_id, $target);
750  }
751 
752  if ($num == 1) {
753  $this->tpl->setOnScreenMessage("success", $this->lng->txt("lm_page_added"), true);
754  } else {
755  $this->tpl->setOnScreenMessage("success", $this->lng->txt("lm_pages_added"), true);
756  }
757 
758  $ilCtrl->redirect($this, "showHierarchy");
759  }
static getPostMulti()
Get multi number of _POST input.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getPostNodeId()
Get node ID of _POST input.
static putInTree(ilLMObject $a_obj, int $a_parent_id=0, int $a_target_node_id=0)
put this object into content object tree
static getPostFirstChild()
Should node be inserted as first child of target node (true) or as successor (false) ...
const POS_FIRST_NODE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ insertPageClip()

ilStructureObjectGUI::insertPageClip ( )

Definition at line 761 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, $user, ilEditClipboard\clear(), ilEditClipboard\getAction(), ilHierarchyFormGUI\getPostFirstChild(), ilHierarchyFormGUI\getPostNodeId(), ilTree\POS_FIRST_NODE, and ilLMObject\updateInternalLinks().

Referenced by pastePage().

761  : void
762  {
763  $ilCtrl = $this->ctrl;
764  $ilUser = $this->user;
765 
768 
769  if (!$first_child) { // insert after node id
770  $parent_id = $this->tree->getParentId($node_id);
771  $target = $node_id;
772  } else { // insert as first child
773  $parent_id = $node_id;
774  $target = ilTree::POS_FIRST_NODE;
775  }
776 
777  // cut and paste
778  $pages = $ilUser->getClipboardObjects("pg");
779  $copied_nodes = array();
780  foreach ($pages as $pg) {
781  $cid = ilLMObject::pasteTree(
782  $this->content_object,
783  $pg["id"],
784  $parent_id,
785  $target,
786  (string) ($pg["insert_time"] ?? ""),
787  $copied_nodes,
788  (ilEditClipboard::getAction() == "copy")
789  );
790  $target = $cid;
791  }
792  ilLMObject::updateInternalLinks($copied_nodes);
793 
794  if (ilEditClipboard::getAction() == "cut") {
795  $ilUser->clipboardDeleteObjectsOfType("pg");
796  $ilUser->clipboardDeleteObjectsOfType("st");
798  }
799 
800  $ilCtrl->redirect($this, "view");
801  }
static updateInternalLinks(array $a_copied_nodes, string $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
static getPostNodeId()
Get node ID of _POST input.
static getPostFirstChild()
Should node be inserted as first child of target node (true) or as successor (false) ...
const POS_FIRST_NODE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertPageFromTemplate()

ilStructureObjectGUI::insertPageFromTemplate ( )

Insert (multiple) pages templates at node.

Definition at line 954 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, $data, $DIC, initInsertTemplateForm(), ilLMPageObject\insertPagesFromTemplate(), and ILIAS\Repository\lng().

954  : void
955  {
956  global $DIC;
957 
958  $ilCtrl = $this->ctrl;
959 
960  $form = $this->initInsertTemplateForm();
961  $form = $form->withRequest($DIC->http()->request());
962  $data = $form->getData();
963  $layout_id = $data["sec"]["layout_id"];
964  $node_id = $this->request->getNodeId();
966  $this->content_object->getId(),
967  $this->request->getMulti(),
968  $node_id,
969  $this->request->getFirstChild(),
970  $layout_id,
971  $data["sec"]["title"]
972  );
973 
974  if ($this->request->getMulti() <= 1) {
975  $this->tpl->setOnScreenMessage("success", $this->lng->txt("lm_page_added"), true);
976  } else {
977  $this->tpl->setOnScreenMessage("success", $this->lng->txt("lm_pages_added"), true);
978  }
979 
980  //$ilCtrl->setParameter($this, "highlight", $page_ids);
981  $ilCtrl->redirect($this, "showHierarchy", "node_" . $node_id);
982  }
global $DIC
Definition: feed.php:28
static insertPagesFromTemplate(int $lm_id, int $num, int $node_id, bool $first_child, int $layout_id, string $title="")
Insert (multiple) pages templates at node.
+ Here is the call graph for this function:

◆ insertSubchapter()

ilStructureObjectGUI::insertSubchapter ( )

Insert (multiple) subchapters at node.

Definition at line 646 of file class.ilStructureObjectGUI.php.

References insertChapter().

646  : void
647  {
648  $this->insertChapter(true);
649  }
insertChapter(bool $a_as_sub=false)
Insert (multiple) chapters at node.
+ Here is the call graph for this function:

◆ insertSubchapterClip()

ilStructureObjectGUI::insertSubchapterClip ( )

Definition at line 722 of file class.ilStructureObjectGUI.php.

References insertChapterClip().

722  : void
723  {
724  $this->insertChapterClip(true);
725  }
insertChapterClip(bool $a_as_sub=false, string $a_return="view")
Insert Chapter from clipboard.
+ Here is the call graph for this function:

◆ insertTemplate()

ilStructureObjectGUI::insertTemplate ( )

Displays GUI to select template for page.

Definition at line 912 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, ilLMObjectGUI\$lng, $tabs, ilLMObjectGUI\$ui, ilTabsGUI\clearTargets(), ilLMPageObjectGUI\getLayoutCssFix(), ilCtrl\getLinkTarget(), ilHierarchyFormGUI\getPostFirstChild(), ilHierarchyFormGUI\getPostMulti(), ilHierarchyFormGUI\getPostNodeId(), initInsertTemplateForm(), ilCtrl\saveParameter(), ilTabsGUI\setBackTarget(), ilCtrl\setParameter(), setTabs(), and ilLanguage\txt().

912  : void
913  {
914  $ctrl = $this->ctrl;
915  $ui = $this->ui;
916  $lng = $this->lng;
917 
918  $this->setTabs();
919  $tabs = $this->tabs;
920  $tabs->clearTargets();
921  $tabs->setBackTarget($lng->txt("back"), $ctrl->getLinkTarget($this, "showHierarchy"));
922 
925  $ctrl->setParameter($this, "first_child", (int) ilChapterHierarchyFormGUI::getPostFirstChild());
926  $ctrl->saveParameter($this, "obj_id");
927  $form = $this->initInsertTemplateForm();
928  $this->tpl->setContent($ui->renderer()->render($form) . ilLMPageObjectGUI::getLayoutCssFix());
929  }
static getPostMulti()
Get multi number of _POST input.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getPostNodeId()
Get node ID of _POST input.
static getLayoutCssFix()
Get layout css fix (workaround for broken radio options)
static getPostFirstChild()
Should node be inserted as first child of target node (true) or as successor (false) ...
setBackTarget(string $a_title, string $a_target, string $a_frame="")
clearTargets()
clear all targets
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
saveParameter(object $a_gui_obj, $a_parameter)
ILIAS DI UIServices $ui
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ pasteChapter()

ilStructureObjectGUI::pasteChapter ( )

Definition at line 422 of file class.ilStructureObjectGUI.php.

References insertChapterClip().

422  : void
423  {
424  $this->insertChapterClip(false, "subchap");
425  }
insertChapterClip(bool $a_as_sub=false, string $a_return="view")
Insert Chapter from clipboard.
+ Here is the call graph for this function:

◆ pastePage()

ilStructureObjectGUI::pastePage ( )

Definition at line 398 of file class.ilStructureObjectGUI.php.

References $user, insertPageClip(), and ILIAS\Repository\lng().

398  : void
399  {
400  $ilUser = $this->user;
401 
402  if (!$ilUser->clipboardHasObjectsOfType("pg")) {
403  throw new ilLMException($this->lng->txt("no_page_in_clipboard"));
404  }
405 
406  $this->insertPageClip();
407  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ proceedDragDrop()

ilStructureObjectGUI::proceedDragDrop ( )

Definition at line 803 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, XapiProxy\$req, and ilLMObjectGUI\$request.

803  : void
804  {
805  $ilCtrl = $this->ctrl;
806 
808  $this->content_object->executeDragDrop(
809  $req->getHFormPar("source_id"),
810  $req->getHFormPar("target_id"),
811  $req->getHFormPar("fc"),
812  $req->getHFormPar("as_subitem")
813  );
814  $ilCtrl->redirect($this, "showHierarchy");
815  }
EditingGUIRequest $request
catch(\Exception $e) $req
Definition: xapiproxy.php:93

◆ putInTree()

ilStructureObjectGUI::putInTree ( ?int  $target = null)

put chapter into tree

Definition at line 358 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$requested_target, ilTree\getChildsByType(), ilTree\getRootId(), ilTree\POS_FIRST_NODE, ilTree\POS_LAST_NODE, ilTree\setTableNames(), and ilTree\setTreeTablePK().

Referenced by save().

360  : void {
361  $target = $this->requested_target;
362  //echo "st:putInTree";
363  // chapters should be behind pages in the tree
364  // so if target is first node, the target is substituted with
365  // the last child of type pg
366  if ($target == ilTree::POS_FIRST_NODE) {
367  $tree = new ilTree($this->content_object->getId());
368  $tree->setTableNames('lm_tree', 'lm_data');
369  $tree->setTreeTablePK("lm_id");
370 
371  // determine parent node id
372  $parent_id = ($this->requested_obj_id > 0)
373  ? $this->requested_obj_id
374  : $tree->getRootId();
375  // determine last child of type pg
376  $childs = $tree->getChildsByType($parent_id, "pg");
377  if (count($childs) != 0) {
378  $target = $childs[count($childs) - 1]["obj_id"];
379  }
380  }
381  if ($target == "") {
382  $target = ilTree::POS_LAST_NODE;
383  }
384 
385  parent::putInTree($target);
386  }
setTreeTablePK(string $a_column_name)
set column containing primary key in tree table
const POS_FIRST_NODE
getChildsByType(int $a_node_id, string $a_type)
get child nodes of given node by object type
setTableNames(string $a_table_tree, string $a_table_obj_data, string $a_table_obj_reference="")
set table names The primary key of the table containing your object_data must be &#39;obj_id&#39; You may use...
const POS_LAST_NODE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilStructureObjectGUI::save ( )

Definition at line 332 of file class.ilStructureObjectGUI.php.

References ilPropertyFormGUI\checkInput(), ilLMObjectGUI\checkTree(), ILIAS\Repository\ctrl(), ilLMObjectGUI\getCreateForm(), ilPropertyFormGUI\getInput(), and putInTree().

332  : void
333  {
334  $form = $this->getCreateForm();
335 
336  if ($form->checkInput()) {
337  $this->obj = new ilStructureObject($this->content_object);
338  $this->obj->setType("st");
339  $this->obj->setTitle($form->getInput("title"));
340  $this->obj->setDescription($form->getInput("desc"));
341  $this->obj->setLMId($this->content_object->getId());
342  $this->obj->create();
343 
344  $this->putInTree();
345 
346  // check the tree
347  $this->checkTree();
348  }
349 
350  if ($this->requested_obj_id > 0) {
351  $this->ctrl->redirect($this, "subchap");
352  }
353  }
checkTree()
check the content object tree
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
putInTree(?int $target=null)
put chapter into tree
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ saveAllTitles()

ilStructureObjectGUI::saveAllTitles ( )

Save all titles of chapters/pages.

Definition at line 237 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, ILIAS\Repository\lng(), and ilLMObject\saveTitles().

237  : void
238  {
239  $ilCtrl = $this->ctrl;
240 
241  $titles = $this->request->getTitles();
242  ilLMObject::saveTitles($this->content_object, $titles, $this->requested_transl);
243 
244  $this->tpl->setOnScreenMessage('success', $this->lng->txt("lm_save_titles"), true);
245  $ilCtrl->redirect($this, "showHierarchy");
246  }
static saveTitles(ilObjLearningModule $a_lm, array $a_titles, string $a_lang="-")
Save titles for lm objects.
+ Here is the call graph for this function:

◆ savePageLayout()

ilStructureObjectGUI::savePageLayout ( )

Save page layout.

Definition at line 875 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, $id, ilLMObjectGUI\$lng, ilLanguage\txt(), and ilLMObject\writeLayout().

875  : void
876  {
877  $lng = $this->lng;
878  $ilCtrl = $this->ctrl;
879 
880  $ids = $this->request->getIds();
881  $layout = $this->request->getLayout();
882  foreach ($ids as $id) {
884  $id,
885  $layout,
886  $this->content_object
887  );
888  }
889  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
890  $ilCtrl->redirect($this, "showHierarchy");
891  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static writeLayout(int $a_obj_id, string $a_layout, ?ilObjLearningModule $a_lm=null)
Write layout setting.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ setPageLayout()

ilStructureObjectGUI::setPageLayout ( )

Set layout for multipl pages.

Definition at line 824 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, ilLMObjectGUI\$lng, ilLMObjectGUI\$tpl, ILIAS\Repository\form(), initSetPageLayoutForm(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

824  : void
825  {
826  $tpl = $this->tpl;
827  $ilCtrl = $this->ctrl;
828  $lng = $this->lng;
829 
830  $ids = $this->request->getIds();
831  if (count($ids) == 0) {
832  $this->tpl->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
833  $ilCtrl->redirect($this, "showHierarchy");
834  }
835 
836  $this->initSetPageLayoutForm();
837 
838  $tpl->setContent($this->form->getHTML());
839  }
initSetPageLayoutForm()
Init set page layout form.
ilGlobalTemplateInterface $tpl
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:

◆ setStructureObject()

ilStructureObjectGUI::setStructureObject ( ilStructureObject  $a_st_object)

Definition at line 52 of file class.ilStructureObjectGUI.php.

54  : void {
55  $this->obj = $a_st_object;
56  }

◆ setTabs()

ilStructureObjectGUI::setTabs ( )

Definition at line 509 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$lng, $tabs, ILIAS\Repository\ctrl(), ilUtil\getImagePath(), ilObjectMetaDataGUI\getTab(), ILIAS\Repository\lng(), and ilLanguage\txt().

Referenced by create(), executeCommand(), insertTemplate(), showHierarchy(), and subchap().

509  : void
510  {
511  $ilTabs = $this->tabs;
512  $lng = $this->lng;
513 
514  // subelements
515  $ilTabs->addTarget(
516  "cont_pages_and_subchapters",
517  $this->ctrl->getLinkTarget($this, 'showHierarchy'),
518  array("view", "showHierarchy"),
519  get_class($this)
520  );
521 
522  // preconditions
523  $ilTabs->addTarget(
524  "preconditions",
525  $this->ctrl->getLinkTarget($this, 'listConditions'),
526  "listConditions",
527  get_class($this)
528  );
529 
530  // metadata
531  $mdgui = new ilObjectMetaDataGUI($this->content_object, $this->obj->getType(), $this->obj->getId());
532  $mdtab = $mdgui->getTab();
533  if ($mdtab) {
534  $ilTabs->addTarget(
535  "meta_data",
536  $mdtab,
537  "",
538  "ilmdeditorgui"
539  );
540  }
541 
542  $this->tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_st.svg"));
543  $this->tpl->setTitle(
544  $this->lng->txt($this->obj->getType()) . ": " . $this->obj->getTitle()
545  );
546 
547  // presentation view
548  $ilTabs->addNonTabbedLink(
549  "pres_mode",
550  $lng->txt("cont_presentation_view"),
551  ILIAS_HTTP_PATH . "/goto.php?target=st_" . $this->obj->getId(),
552  "_top"
553  );
554  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
getTab(string $base_class=null)
Get tab link if available.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showHierarchy()

ilStructureObjectGUI::showHierarchy ( )

Definition at line 122 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, ilLMObjectGUI\$lng, ilLMObjectGUI\$requested_transl, ilUtil\getImagePath(), ilObjContentObjectGUI\getMultiLangHeader(), ilFormGUI\setFormAction(), setTabs(), and ilLanguage\txt().

Referenced by view().

122  : void
123  {
124  $lng = $this->lng;
125  $ilCtrl = $this->ctrl;
126 
127  $this->setTabs();
128 
129  $ilCtrl->setParameter($this, "backcmd", "showHierarchy");
130 
131  $form_gui = new ilChapterHierarchyFormGUI($this->content_object->getType(), $this->requested_transl);
132  $form_gui->setFormAction($ilCtrl->getFormAction($this));
133  $form_gui->setTitle($this->obj->getTitle());
134  $form_gui->setIcon(ilUtil::getImagePath("standard/icon_st.svg"));
135  $form_gui->setTree($this->tree);
136  $form_gui->setCurrentTopNodeId($this->obj->getId());
137  $form_gui->addMultiCommand($lng->txt("delete"), "delete");
138  $form_gui->addMultiCommand($lng->txt("cut"), "cutItems");
139  $form_gui->addMultiCommand($lng->txt("copy"), "copyItems");
140  $form_gui->addMultiCommand($lng->txt("cont_de_activate"), "activatePages");
141  if ($this->content_object->getLayoutPerPage()) {
142  $form_gui->addMultiCommand($lng->txt("cont_set_layout"), "setPageLayout");
143  }
144  $form_gui->setDragIcon(ilUtil::getImagePath("standard/icon_pg.svg"));
145  $form_gui->addCommand($lng->txt("cont_save_all_titles"), "saveAllTitles");
146  $form_gui->addHelpItem($lng->txt("cont_chapters_after_pages"));
147  $up_gui = "ilobjlearningmodulegui";
148  $ilCtrl->setParameterByClass($up_gui, "active_node", $this->obj->getId());
149  $ilCtrl->setParameterByClass($up_gui, "active_node", null);
150 
151  $ctpl = new ilTemplate("tpl.chap_and_pages.html", true, true, "Modules/LearningModule");
152  $ctpl->setVariable("HIERARCHY_FORM", $form_gui->getHTML());
153  $ilCtrl->setParameter($this, "obj_id", $this->requested_obj_id);
154 
155  $ml_head = ilObjContentObjectGUI::getMultiLangHeader($this->content_object->getId(), $this);
156  $this->tpl->setContent($ml_head . $ctpl->get());
157  $this->tpl->addOnloadCode("window.setTimeout(() => { il.repository.core.trigger('il-lm-editor-tree'); }, 500);");
158  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setFormAction(string $a_formaction)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getMultiLangHeader(int $a_lm_id, object $a_gui_class, string $a_mode="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ subchap()

ilStructureObjectGUI::subchap ( )

display subchapters of structure object

Definition at line 251 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, $user, ilStructureObject\_getPresentationTitle(), ilLMObject\CHAPTER_TITLE, ILIAS\Repository\ctrl(), ilLegacyFormElementsUtil\formSelect(), ilUtil\getImagePath(), ILIAS\Repository\lng(), ilTree\POS_FIRST_NODE, setTabs(), and ilLMObjectGUI\showActions().

251  : void
252  {
253  $ilCtrl = $this->ctrl;
254  $ilUser = $this->user;
255 
256  $this->setTabs();
257 
258  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.structure_edit.html", "Modules/LearningModule");
259  $num = 0;
260 
261  $this->tpl->setCurrentBlock("form");
262  $this->ctrl->setParameter($this, "backcmd", "subchap");
263  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
264  $this->tpl->setVariable("HEADER_TEXT", $this->lng->txt("cont_subchapters"));
265  $this->tpl->setVariable("CHECKBOX_TOP", ilTree::POS_FIRST_NODE);
266 
267  $cnt = 0;
268  $childs = $this->tree->getChilds($this->obj->getId());
269  foreach ($childs as $child) {
270  if ($child["type"] != "st") {
271  continue;
272  }
273  $this->tpl->setCurrentBlock("table_row");
274 
275  // checkbox
276  $this->tpl->setVariable("CHECKBOX_ID", $child["obj_id"]);
277  $this->tpl->setVariable("IMG_OBJ", ilUtil::getImagePath("standard/icon_st.svg"));
278 
279  // type
280  $this->ctrl->setParameterByClass("ilStructureObjectGUI", "obj_id", $child["obj_id"]);
281  $link = $this->ctrl->getLinkTargetByClass("ilStructureObjectGUI", "view");
282  $this->tpl->setVariable("LINK_TARGET", $link);
283 
284  // title
285  $this->tpl->setVariable(
286  "TEXT_CONTENT",
288  $child["obj_id"],
290  $this->content_object->isActiveNumbering()
291  )
292  );
293 
294  $this->tpl->parseCurrentBlock();
295  $cnt++;
296  }
297 
298  if ($cnt == 0) {
299  $this->tpl->setCurrentBlock("notfound");
300  $this->tpl->setVariable("NUM_COLS", 3);
301  $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
302  $this->tpl->parseCurrentBlock();
303  }
304  //else
305  //{
306  // SHOW VALID ACTIONS
307  $this->tpl->setVariable("NUM_COLS", 3);
308  $acts = array("delete" => "delete", "cutChapter" => "cut",
309  "copyChapter" => "copyChapter");
310  if ($ilUser->clipboardHasObjectsOfType("st")) {
311  $acts["pasteChapter"] = "pasteChapter";
312  }
313  $this->showActions($acts);
314  //}
315 
316  // SHOW POSSIBLE SUB OBJECTS
317  $this->tpl->setVariable("NUM_COLS", 3);
318  $subobj = array("st");
319  $opts = ilLegacyFormElementsUtil::formSelect(12, "new_type", $subobj);
320  $this->tpl->setCurrentBlock("add_object");
321  $this->tpl->setVariable("SELECT_OBJTYPE", $opts);
322  $this->tpl->setVariable("BTN_NAME", "create");
323  $this->tpl->setVariable("TXT_ADD", $this->lng->txt("insert"));
324  $this->tpl->parseCurrentBlock();
325 
326  $this->tpl->setCurrentBlock("form");
327  $this->tpl->parseCurrentBlock();
328 
329  $ilCtrl->setParameter($this, "obj_id", $this->requested_obj_id);
330  }
static _getPresentationTitle(int $a_st_id, string $a_mode=self::CHAPTER_TITLE, bool $a_include_numbers=false, bool $a_time_scheduled_activation=false, bool $a_force_content=false, int $a_lm_id=0, string $a_lang="-", bool $a_include_short=false)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static formSelect( $selected, string $varname, array $options, bool $multiple=false, bool $direct_text=false, int $size=0, string $style_class="", array $attribs=[], bool $disabled=false)
Builds a select form field with options and shows the selected option first.
const POS_FIRST_NODE
showActions(array $a_actions)
show possible action (form buttons)
+ Here is the call graph for this function:

◆ switchToLanguage()

ilStructureObjectGUI::switchToLanguage ( )

Definition at line 901 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, and ilCtrl\setParameter().

901  : void
902  {
903  $ilCtrl = $this->ctrl;
904 
905  $ilCtrl->setParameter($this, "transl", $this->requested_totransl);
906  $ilCtrl->redirect($this, "showHierarchy");
907  }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ view()

ilStructureObjectGUI::view ( )

Definition at line 117 of file class.ilStructureObjectGUI.php.

References showHierarchy().

Referenced by edit().

117  : void
118  {
119  $this->showHierarchy();
120  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $condHI

ilConditionHandlerGUI ilStructureObjectGUI::$condHI
protected

Definition at line 30 of file class.ilStructureObjectGUI.php.

◆ $form

ilPropertyFormGUI ilStructureObjectGUI::$form
protected

Definition at line 29 of file class.ilStructureObjectGUI.php.

◆ $log

ilLogger ilStructureObjectGUI::$log
protected

Definition at line 33 of file class.ilStructureObjectGUI.php.

Referenced by insertChapterClip().

◆ $tabs

ilTabsGUI ilStructureObjectGUI::$tabs
protected

Definition at line 32 of file class.ilStructureObjectGUI.php.

Referenced by executeCommand(), insertTemplate(), and setTabs().

◆ $tree

ilLMTree ilStructureObjectGUI::$tree

Definition at line 34 of file class.ilStructureObjectGUI.php.

◆ $user

ilObjUser ilStructureObjectGUI::$user
protected

The documentation for this class was generated from the following file: