ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilStructureObjectGUI Class Reference

Class ilStructureObjectGUI. More...

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

Public Member Functions

 __construct (&$a_content_obj, &$a_tree)
 Constructor public. More...
 
 setStructureObject (&$a_st_object)
 set structure object More...
 
 getType ()
 this function is called by condition handler gui interface More...
 
 executeCommand ()
 execute command More...
 
 create ()
 create new page or chapter in chapter More...
 
 edit ()
 
 view ()
 
 showHierarchy ()
 Show subhiearchy of pages and subchapters. More...
 
 cutItems ($a_return="view")
 Copy items to clipboard, then cut them from the current tree. More...
 
 copyItems ($a_return="view")
 Copy items to clipboard. More...
 
 saveAllTitles ()
 Save all titles of chapters/pages. More...
 
 subchap ()
 
 add_cell ($val, $link="")
 output a cell in object list More...
 
 save ()
 save new chapter More...
 
 putInTree ()
 put chapter into tree More...
 
 cutPage ()
 cut page More...
 
 copyPage ()
 copy page More...
 
 pastePage ()
 paste page More...
 
 cutChapter ()
 Cut chapter(s) More...
 
 copyChapter ()
 copy a single chapter (selection) More...
 
 pasteChapter ()
 paste chapter More...
 
 activatePages ()
 activates or deactivates pages More...
 
 initConditionHandlerInterface ()
 
 cancel ()
 cancel creation of new page or chapter More...
 
 setTabs ()
 output tabs More...
 
 insertChapter ($a_as_sub=false)
 Insert (multiple) chapters at node. More...
 
 insertSubchapter ()
 Insert (multiple) subchapters at node. More...
 
 insertChapterClip ($a_as_sub=false, $a_return="view")
 Insert Chapter from clipboard. More...
 
 insertSubchapterClip ()
 Insert Chapter from clipboard. More...
 
 insertPage ()
 Insert (multiple) pages at node. More...
 
 insertPageClip ()
 Insert pages from clipboard. More...
 
 proceedDragDrop ()
 Perform drag and drop action. More...
 
 setPageLayout ()
 Set layout for multipl pages. More...
 
 initSetPageLayoutForm ()
 Init set page layout form. More...
 
 savePageLayout ()
 Save page layout. More...
 
 editMasterLanguage ()
 Edit master language. More...
 
 switchToLanguage ()
 Switch to language. More...
 
 insertTemplate ()
 Displays GUI to select template for page. More...
 
 initInsertTemplateForm ()
 Init insert template form. More...
 
 insertPageFromTemplate ()
 Insert (multiple) pages templates at node. More...
 
- Public Member Functions inherited from ilLMObjectGUI
 __construct (&$a_content_obj)
 constructor More...
 
 setActions ($a_actions="")
 build action array More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 create ()
 structure / page object creation form More...
 
 putInTree ()
 put this object into content object tree More...
 
 delete ()
 Confirm deletion screen (delete page or structure objects) More...
 
 cancelDelete ()
 cancel deletion of page/structure objects More...
 
 confirmedDelete ()
 page and structure object deletion More...
 
 add_cell ($val, $link="")
 output a cell in object list More...
 
 showActions ($a_actions)
 show possible action (form buttons) More...
 
 checkTree ()
 check the content object tree More...
 

Static Public Member Functions

static _goto ($a_target, $a_target_ref_id="")
 redirect script More...
 

Data Fields

 $obj
 
 $tree
 
- Data Fields inherited from ilLMObjectGUI
 $tpl
 
 $lng
 
 $obj
 
 $ctrl
 
 $content_object
 
 $actions
 

Protected Attributes

 $user
 
 $error
 
 $tabs
 
 $log
 
- Protected Attributes inherited from ilLMObjectGUI
 $ui
 

Detailed Description

Class ilStructureObjectGUI.

User Interface for Structure Objects Editing

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilStructureObjectGUI: ilConditionHandlerGUI, ilObjectMetaDataGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilStructureObjectGUI::__construct ( $a_content_obj,
$a_tree 
)

Constructor public.

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

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and user().

47  {
48  global $DIC;
49 
50  $this->tree = $DIC->repositoryTree();
51  $this->user = $DIC->user();
52  $this->ctrl = $DIC->ctrl();
53  $this->lng = $DIC->language();
54  $this->error = $DIC["ilErr"];
55  $this->tabs = $DIC->tabs();
56  $this->log = $DIC["ilLog"];
57  $this->tpl = $DIC["tpl"];
58  parent::__construct($a_content_obj);
59  $this->tree = $a_tree;
60  }
user()
Definition: user.php:4
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilStructureObjectGUI::_goto (   $a_target,
  $a_target_ref_id = "" 
)
static

redirect script

Parameters
string$a_target

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

References $_GET, $DIC, $ilErr, ilLMObjectGUI\$lng, ilObject\_getAllReferences(), ilObjectGUI\_gotoRepositoryRoot(), ilLMObject\_lookupContObjID(), ilObject\_lookupTitle(), exit, and ilUtil\sendFailure().

655  {
656  global $DIC;
657 
658  $rbacsystem = $DIC->rbac()->system();
659  $ilErr = $DIC["ilErr"];
660  $lng = $DIC->language();
661  $ilAccess = $DIC->access();
662 
663  // determine learning object
664  $lm_id = ilLMObject::_lookupContObjID($a_target);
665 
666  // get all references
667  $ref_ids = ilObject::_getAllReferences($lm_id);
668 
669  // always try passed ref id first
670  if (in_array($a_target_ref_id, $ref_ids)) {
671  $ref_ids = array_merge(array($a_target_ref_id), $ref_ids);
672  }
673 
674  // check read permissions
675  foreach ($ref_ids as $ref_id) {
676  // Permission check
677  if ($ilAccess->checkAccess("read", "", $ref_id)) {
678  // don't redirect anymore, just set parameters
679  // (goto.php includes "ilias.php")
680  $_GET["baseClass"] = "ilLMPresentationGUI";
681  $_GET["obj_id"] = $a_target;
682  $_GET["ref_id"] = $ref_id;
683  include_once("ilias.php");
684  exit;
685  ;
686  }
687  }
688 
689  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
690  ilUtil::sendFailure(sprintf(
691  $lng->txt("msg_no_perm_read_item"),
692  ilObject::_lookupTitle($lm_id)
693  ), true);
695  }
696 
697  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
698  }
exit
Definition: login.php:29
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
static _getAllReferences($a_id)
get all reference ids of object
$ilErr
Definition: raiseError.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ activatePages()

ilStructureObjectGUI::activatePages ( )

activates or deactivates pages

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

References $_POST, ilLMObjectGUI\$lng, ilPageObject\_lookupActive(), ilLMObject\_lookupType(), ilPageObject\_writeActive(), and ilUtil\sendFailure().

513  {
514  $lng = $this->lng;
515 
516  if (is_array($_POST["id"])) {
517  $act_items = array();
518  // get all "top" ids, i.e. remove ids, that have a selected parent
519  foreach ($_POST["id"] as $id) {
520  $path = $this->tree->getPathId($id);
521  $take = true;
522  foreach ($path as $path_id) {
523  if ($path_id != $id && in_array($path_id, $_POST["id"])) {
524  $take = false;
525  }
526  }
527  if ($take) {
528  $act_items[] = $id;
529  }
530  }
531 
532 
533  foreach ($act_items as $id) {
534  $childs = $this->tree->getChilds($id);
535  foreach ($childs as $child) {
536  if (ilLMObject::_lookupType($child["child"]) == "pg") {
538  $child["child"],
539  $this->content_object->getType()
540  );
542  $child["child"],
543  $this->content_object->getType(),
544  !$act
545  );
546  }
547  }
548  if (ilLMObject::_lookupType($id) == "pg") {
550  $id,
551  $this->content_object->getType()
552  );
554  $id,
555  $this->content_object->getType(),
556  !$act
557  );
558  }
559  }
560  } else {
561  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
562  }
563 
564  $this->ctrl->redirect($this, "view");
565  }
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
static _writeActive($a_id, $a_parent_type, $a_active, $a_reset_scheduled_activation=true, $a_lang="-")
write activation status
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ add_cell()

ilStructureObjectGUI::add_cell (   $val,
  $link = "" 
)

output a cell in object list

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

381  {
382  if (!empty($link)) {
383  $this->tpl->setCurrentBlock("begin_link");
384  $this->tpl->setVariable("LINK_TARGET", $link);
385  $this->tpl->parseCurrentBlock();
386  $this->tpl->touchBlock("end_link");
387  }
388 
389  $this->tpl->setCurrentBlock("text");
390  $this->tpl->setVariable("TEXT_CONTENT", $val);
391  $this->tpl->parseCurrentBlock();
392  $this->tpl->setCurrentBlock("table_cell");
393  $this->tpl->parseCurrentBlock();
394  }

◆ cancel()

ilStructureObjectGUI::cancel ( )

cancel creation of new page or chapter

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

References $_GET.

587  {
588  if ($_GET["obj_id"] != 0) {
589  if ($_GET["new_type"] == "pg") {
590  $this->ctrl->redirect($this, "view");
591  } else {
592  $this->ctrl->redirect($this, "subchap");
593  }
594  }
595  }
$_GET["client_id"]

◆ copyChapter()

ilStructureObjectGUI::copyChapter ( )

copy a single chapter (selection)

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

References copyItems().

495  {
496  $this->copyItems("subchap");
497  }
copyItems($a_return="view")
Copy items to clipboard.
+ Here is the call graph for this function:

◆ copyItems()

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

Copy items to clipboard.

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

References $_POST, ilLMObjectGUI\$ctrl, $ilCtrl, ilLMObjectGUI\$lng, ilLMObject\clipboardCopy(), ilUtil\sendFailure(), ilUtil\sendInfo(), ilEditClipboard\setAction(), ilUtil\stripSlashesArray(), and ilLMObject\uniqueTypesCheck().

Referenced by copyChapter(), and copyPage().

239  {
241  $lng = $this->lng;
242 
243  $items = ilUtil::stripSlashesArray($_POST["id"]);
244  if (!is_array($items)) {
245  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
246  $ilCtrl->redirect($this, "showHierarchy");
247  }
248 
249  $todel = array(); // delete IDs < 0 (needed for non-js editing)
250  foreach ($items as $k => $item) {
251  if ($item < 0) {
252  $todel[] = $k;
253  }
254  }
255  foreach ($todel as $k) {
256  unset($items[$k]);
257  }
258 
259  if (!ilLMObject::uniqueTypesCheck($items)) {
260  ilUtil::sendFailure($lng->txt("cont_choose_pages_or_chapters_only"), true);
261  $ilCtrl->redirect($this, "showHierarchy");
262  }
263 
264  ilLMObject::clipboardCopy($this->content_object->getId(), $items);
266 
267  ilUtil::sendInfo($lng->txt("cont_selected_items_have_been_copied"), true);
268  $ilCtrl->redirect($this, $a_return);
269  }
static uniqueTypesCheck($a_items)
Check for unique types (all pages or all chapters)
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static clipboardCopy($a_cont_obj_id, $a_ids)
Copy a set of chapters/pages into the clipboard.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
static setAction($a_action)
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copyPage()

ilStructureObjectGUI::copyPage ( )

copy page

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

References copyItems().

463  {
464  $this->copyItems();
465  }
copyItems($a_return="view")
Copy items to clipboard.
+ Here is the call graph for this function:

◆ create()

ilStructureObjectGUI::create ( )

create new page or chapter in chapter

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

References $_GET, and setTabs().

131  {
132  if ($_GET["obj_id"] != "") {
133  $this->setTabs();
134  }
135  parent::create();
136  }
$_GET["client_id"]
+ Here is the call graph for this function:

◆ cutChapter()

ilStructureObjectGUI::cutChapter ( )

Cut chapter(s)

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

References cutItems().

487  {
488  $this->cutItems("subchap");
489  }
cutItems($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 (   $a_return = "view")

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

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

References $_POST, ilLMObjectGUI\$ctrl, $ilCtrl, ilLMObjectGUI\$lng, ilLMObject\clipboardCut(), ilUtil\sendFailure(), ilUtil\sendInfo(), ilEditClipboard\setAction(), ilUtil\stripSlashesArray(), and ilLMObject\uniqueTypesCheck().

Referenced by cutChapter(), and cutPage().

202  {
204  $lng = $this->lng;
205 
206  $items = ilUtil::stripSlashesArray($_POST["id"]);
207  if (!is_array($items)) {
208  ilUtil::sendFailure($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  ilUtil::sendFailure($lng->txt("cont_choose_pages_or_chapters_only"), true);
224  $ilCtrl->redirect($this, "showHierarchy");
225  }
226 
227  ilLMObject::clipboardCut($this->content_object->getId(), $items);
229  //ilUtil::sendInfo($this->lng->txt("msg_cut_clipboard"), true);
230  ilUtil::sendInfo($lng->txt("cont_selected_items_have_been_cut"), true);
231 
232  $ilCtrl->redirect($this, $a_return);
233  }
static uniqueTypesCheck($a_items)
Check for unique types (all pages or all chapters)
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static clipboardCut($a_cont_obj_id, $a_ids)
Copy a set of chapters/pages into the clipboard.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
static setAction($a_action)
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cutPage()

ilStructureObjectGUI::cutPage ( )

cut page

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

References cutItems().

455  {
456  $this->cutItems();
457  }
cutItems($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 138 of file class.ilStructureObjectGUI.php.

References view().

139  {
140  $this->view();
141  }
+ Here is the call graph for this function:

◆ editMasterLanguage()

ilStructureObjectGUI::editMasterLanguage ( )

Edit master language.

Parameters

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

References ilLMObjectGUI\$ctrl, and $ilCtrl.

1005  {
1006  $ilCtrl = $this->ctrl;
1007 
1008  $ilCtrl->setParameter($this, "transl", "");
1009  $ilCtrl->redirect($this, "showHierarchy");
1010  }
global $ilCtrl
Definition: ilias.php:18

◆ executeCommand()

ilStructureObjectGUI::executeCommand ( )

execute command

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

References $_POST, $tabs, ilObjectMetaDataGUI\addMDObserver(), initConditionHandlerInterface(), and setTabs().

85  {
86  //echo "<br>:cmd:".$this->ctrl->getCmd().":cmdClass:".$this->ctrl->getCmdClass().":";
87  $next_class = $this->ctrl->getNextClass($this);
88  $cmd = $this->ctrl->getCmd();
89 
90  switch ($next_class) {
91  case 'ilobjectmetadatagui':
92 
93  $this->setTabs();
94 
95  $md_gui = new ilObjectMetaDataGUI($this->content_object, $this->obj->getType(), $this->obj->getId());
96  $md_gui->addMDObserver($this->obj, 'MDUpdateListener', 'General');
97  $md_gui->addMDObserver($this->obj, 'MDUpdateListener', 'Educational'); // #9510
98  $this->ctrl->forwardCommand($md_gui);
99  break;
100 
101  case "ilconditionhandlergui":
102  $ilTabs = $this->tabs;
103 
104  $this->setTabs();
106  $this->ctrl->forwardCommand($this->condHI);
107  $ilTabs->setTabActive('preconditions');
108  break;
109 
110  default:
111  if ($cmd == 'listConditions') {
112  $this->setTabs();
114  $this->condHI->executeCommand();
115  } elseif (($cmd == "create") && ($_POST["new_type"] == "pg")) {
116  $this->setTabs();
117  $pg_gui = new ilLMPageObjectGUI($this->content_object);
118  $pg_gui->executeCommand();
119  } else {
120  $this->$cmd();
121  }
122  break;
123  }
124  }
Class ilObjectMetaDataGUI.
addMDObserver($a_class, $a_method, $a_section)
Class ilLMPageObjectGUI.
$_POST["username"]
+ Here is the call graph for this function:

◆ getType()

ilStructureObjectGUI::getType ( )

this function is called by condition handler gui interface

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

77  {
78  return "st";
79  }

◆ initConditionHandlerInterface()

ilStructureObjectGUI::initConditionHandlerInterface ( )

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

Referenced by executeCommand().

572  {
573  $this->condHI = new ilConditionHandlerGUI($this);
574  $this->condHI->setBackButtons(array());
575  $this->condHI->setAutomaticValidation(false);
576  $this->condHI->setTargetType("st");
577  $this->condHI->setTargetRefId($this->content_object->getRefId());
578  $this->condHI->setTargetId($this->obj->getId());
579  $this->condHI->setTargetTitle($this->obj->getTitle());
580  }
class ilConditionHandlerGUI
+ Here is the caller graph for this function:

◆ initInsertTemplateForm()

ilStructureObjectGUI::initInsertTemplateForm ( )

Init insert template form.

Returns

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

References ilLMObjectGUI\$ctrl, Vendor\Package\$f, ilLMObjectGUI\$lng, ilLMObjectGUI\$ui, and ilPageLayout\MODULE_LM.

Referenced by insertPageFromTemplate(), and insertTemplate().

1054  {
1055  $ui = $this->ui;
1056  $f = $ui->factory();
1057  $ctrl = $this->ctrl;
1058  $lng = $this->lng;
1059 
1060  $fields["title"] = $f->input()->field()->text($lng->txt("title"), "");
1061  $ts = ilPageLayoutGUI::getTemplateSelection(ilPageLayout::MODULE_LM);
1062  if (!is_null($ts)) {
1063  $fields["layout_id"] = $ts;
1064  }
1065 
1066  // section
1067  $section1 = $f->input()->field()->section($fields, $lng->txt("cont_insert_pagelayout"));
1068 
1069  $form_action = $ctrl->getLinkTarget($this, "insertPageFromTemplate");
1070  return $f->input()->container()->form()->standard($form_action, ["sec" => $section1]);
1071  }
+ Here is the caller graph for this function:

◆ initSetPageLayoutForm()

ilStructureObjectGUI::initSetPageLayoutForm ( )

Init set page layout form.

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

References $_POST, ilLMObjectGUI\$ctrl, $ilCtrl, ilLMObjectGUI\$lng, and ilObjContentObjectGUI\getLayoutOption().

Referenced by setPageLayout().

950  {
951  $lng = $this->lng;
953 
954  $this->form = new ilPropertyFormGUI();
955 
956  if (is_array($_POST["id"])) {
957  foreach ($_POST["id"] as $id) {
958  $hi = new ilHiddenInputGUI("id[]");
959  $hi->setValue($id);
960  $this->form->addItem($hi);
961  }
962  }
964  $lng->txt("cont_layout"),
965  "layout",
966  $this->content_object->getLayout()
967  );
968 
969  $this->form->addItem($layout);
970 
971  $this->form->addCommandButton("savePageLayout", $lng->txt("save"));
972  $this->form->addCommandButton("showHierarchy", $lng->txt("cancel"));
973 
974  $this->form->setTitle($lng->txt("cont_set_layout"));
975  $this->form->setFormAction($ilCtrl->getFormAction($this));
976  }
This class represents a property form user interface.
static getLayoutOption($a_txt, $a_var, $a_def_option="")
Get layout option.
global $ilCtrl
Definition: ilias.php:18
This class represents a hidden form property in a property form.
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertChapter()

ilStructureObjectGUI::insertChapter (   $a_as_sub = false)

Insert (multiple) chapters at node.

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

References ilLMObjectGUI\$ctrl, $i, $ilCtrl, ilLMObjectGUI\$lng, ilHierarchyFormGUI\getPostFirstChild(), ilHierarchyFormGUI\getPostMulti(), ilHierarchyFormGUI\getPostNodeId(), IL_FIRST_NODE, and ilLMObject\putInTree().

Referenced by insertSubchapter().

704  {
706  $lng = $this->lng;
707 
708 
711 
712  if ($a_as_sub) { // as subchapter
713  if (!ilChapterHierarchyFormGUI::getPostFirstChild()) { // insert under parent
714  $parent_id = $node_id;
715  $target = "";
716  } else { // we shouldnt end up here
717  $ilCtrl->redirect($this, "showHierarchy");
718  return;
719  }
720  } else { // as chapter
721  if (!ilChapterHierarchyFormGUI::getPostFirstChild()) { // insert after node id
722  $parent_id = $this->tree->getParentId($node_id);
723  $target = $node_id;
724  } else { // insert as first child
725  $parent_id = $node_id;
726  $target = IL_FIRST_NODE;
727  }
728  }
729  for ($i = 1; $i <= $num; $i++) {
730  $chap = new ilStructureObject($this->content_object);
731  $chap->setType("st");
732  $chap->setTitle($lng->txt("cont_new_chap"));
733  $chap->setLMId($this->content_object->getId());
734  $chap->create();
735  ilLMObject::putInTree($chap, $parent_id, $target);
736  }
737 
738  $ilCtrl->redirect($this, "view");
739  }
static getPostMulti()
Get multi number of _POST input.
static getPostNodeId()
Get node ID of _POST input.
global $ilCtrl
Definition: ilias.php:18
static getPostFirstChild()
Should node be inserted as first child of target node (true) or as successor (false) ...
const IL_FIRST_NODE
Definition: class.ilTree.php:5
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
put this object into content object tree
Class ilStructreObject.
$i
Definition: metadata.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertChapterClip()

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

Insert Chapter from clipboard.

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

References ilLMObjectGUI\$ctrl, $ilCtrl, $ilLog, $ilUser, $log, $user, ilEditClipboard\clear(), ilEditClipboard\getAction(), ilHierarchyFormGUI\getPostFirstChild(), ilHierarchyFormGUI\getPostNodeId(), IL_FIRST_NODE, ilLMObject\pasteTree(), and ilLMObject\updateInternalLinks().

Referenced by insertSubchapterClip(), and pasteChapter().

755  {
758  $ilLog = $this->log;
759 
760  $ilLog->write("Insert Chapter From Clipboard");
761 
762 
765 
766  if ($a_as_sub) { // as subchapter
767  if (!$first_child) { // insert under parent
768  $parent_id = $node_id;
769  $target = "";
770  } else { // we shouldnt end up here
771  $ilCtrl->redirect($this, "showHierarchy");
772  return;
773  }
774  } else { // as chapter
775  if (!$first_child) { // insert after node id
776  $parent_id = $this->tree->getParentId($node_id);
777  $target = $node_id;
778  } else { // insert as first child
779  $parent_id = $node_id;
780  $target = IL_FIRST_NODE;
781 
782  // do not move a chapter in front of a page
783  $childs = $this->tree->getChildsByType($parent_id, "pg");
784  if (count($childs) != 0) {
785  $target = $childs[count($childs) - 1]["obj_id"];
786  }
787  }
788  }
789 
790  // copy and paste
791  $chapters = $ilUser->getClipboardObjects("st", true);
792  $copied_nodes = array();
793 
794  foreach ($chapters as $chap) {
795  $ilLog->write("Call pasteTree, Target LM: " . $this->content_object->getId() . ", Chapter ID: " . $chap["id"]
796  . ", Parent ID: " . $parent_id . ", Target: " . $target);
797  $cid = ilLMObject::pasteTree(
798  $this->content_object,
799  $chap["id"],
800  $parent_id,
801  $target,
802  $chap["insert_time"],
803  $copied_nodes,
804  (ilEditClipboard::getAction() == "copy")
805  );
806  $target = $cid;
807  }
808  ilLMObject::updateInternalLinks($copied_nodes);
809 
810  if (ilEditClipboard::getAction() == "cut") {
811  $ilUser->clipboardDeleteObjectsOfType("pg");
812  $ilUser->clipboardDeleteObjectsOfType("st");
814  }
815 
816  $this->content_object->checkTree();
817  $ilCtrl->redirect($this, $a_return);
818  }
static updateInternalLinks($a_copied_nodes, $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
static getPostNodeId()
Get node ID of _POST input.
global $ilCtrl
Definition: ilias.php:18
static getPostFirstChild()
Should node be inserted as first child of target node (true) or as successor (false) ...
const IL_FIRST_NODE
Definition: class.ilTree.php:5
$ilUser
Definition: imgupload.php:18
static pasteTree( $a_target_lm, $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false, $a_source_lm=null)
Paste item (tree) from clipboard to current lm.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertPage()

ilStructureObjectGUI::insertPage ( )

Insert (multiple) pages at node.

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

References ilLMObjectGUI\$ctrl, $i, $ilCtrl, ilLMObjectGUI\$lng, ilHierarchyFormGUI\getPostFirstChild(), ilHierarchyFormGUI\getPostMulti(), ilHierarchyFormGUI\getPostNodeId(), IL_FIRST_NODE, and ilLMObject\putInTree().

832  {
834  $lng = $this->lng;
835 
836 
839 
840  if (!ilChapterHierarchyFormGUI::getPostFirstChild()) { // insert after node id
841  $parent_id = $this->tree->getParentId($node_id);
842  $target = $node_id;
843  } else { // insert as first child
844  $parent_id = $node_id;
845  $target = IL_FIRST_NODE;
846  }
847 
848  for ($i = 1; $i <= $num; $i++) {
849  $page = new ilLMPageObject($this->content_object);
850  $page->setType("pg");
851  $page->setTitle($lng->txt("cont_new_page"));
852  $page->setLMId($this->content_object->getId());
853  $page->create();
854  ilLMObject::putInTree($page, $parent_id, $target);
855  }
856 
857  $ilCtrl->redirect($this, "showHierarchy");
858  }
static getPostMulti()
Get multi number of _POST input.
static getPostNodeId()
Get node ID of _POST input.
global $ilCtrl
Definition: ilias.php:18
static getPostFirstChild()
Should node be inserted as first child of target node (true) or as successor (false) ...
Class ilLMPageObject.
const IL_FIRST_NODE
Definition: class.ilTree.php:5
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
put this object into content object tree
$i
Definition: metadata.php:24
+ Here is the call graph for this function:

◆ insertPageClip()

ilStructureObjectGUI::insertPageClip ( )

Insert pages from clipboard.

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

References ilLMObjectGUI\$ctrl, $ilCtrl, $ilUser, $user, ilEditClipboard\clear(), ilEditClipboard\getAction(), ilHierarchyFormGUI\getPostFirstChild(), ilHierarchyFormGUI\getPostNodeId(), IL_FIRST_NODE, ilLMObject\pasteTree(), and ilLMObject\updateInternalLinks().

Referenced by pastePage().

864  {
867 
870 
871  if (!$first_child) { // insert after node id
872  $parent_id = $this->tree->getParentId($node_id);
873  $target = $node_id;
874  } else { // insert as first child
875  $parent_id = $node_id;
876  $target = IL_FIRST_NODE;
877  }
878 
879  // cut and paste
880  $pages = $ilUser->getClipboardObjects("pg");
881  $copied_nodes = array();
882  foreach ($pages as $pg) {
883  $cid = ilLMObject::pasteTree(
884  $this->content_object,
885  $pg["id"],
886  $parent_id,
887  $target,
888  $pg["insert_time"],
889  $copied_nodes,
890  (ilEditClipboard::getAction() == "copy")
891  );
892  $target = $cid;
893  }
894  ilLMObject::updateInternalLinks($copied_nodes);
895 
896  if (ilEditClipboard::getAction() == "cut") {
897  $ilUser->clipboardDeleteObjectsOfType("pg");
898  $ilUser->clipboardDeleteObjectsOfType("st");
900  }
901 
902  $ilCtrl->redirect($this, "view");
903  }
static updateInternalLinks($a_copied_nodes, $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
static getPostNodeId()
Get node ID of _POST input.
global $ilCtrl
Definition: ilias.php:18
static getPostFirstChild()
Should node be inserted as first child of target node (true) or as successor (false) ...
const IL_FIRST_NODE
Definition: class.ilTree.php:5
$ilUser
Definition: imgupload.php:18
static pasteTree( $a_target_lm, $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false, $a_source_lm=null)
Paste item (tree) from clipboard to current lm.
+ 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 1076 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, $data, $DIC, $ilCtrl, initInsertTemplateForm(), and ilLMPageObject\insertPagesFromTemplate().

1077  {
1078  global $DIC;
1079 
1080  $ilCtrl = $this->ctrl;
1081 
1082  $form = $this->initInsertTemplateForm();
1083  $form = $form->withRequest($DIC->http()->request());
1084  $data = $form->getData();
1085  $layout_id = $data["sec"]["layout_id"];
1086  $node_id = $_REQUEST["node_id"];
1088  $this->content_object->getId(),
1089  (int) $_REQUEST["multi"],
1090  $node_id,
1091  $_REQUEST["first_child"],
1092  $layout_id,
1093  $data["sec"]["title"]
1094  );
1095 
1096  $ilCtrl->setParameter($this, "highlight", $page_ids);
1097  $ilCtrl->redirect($this, "showHierarchy", "node_" . $node_id);
1098  }
static insertPagesFromTemplate($lm_id, $num, $node_id, $first_child, $layout_id, $title="")
Insert (multiple) pages templates at node.
$data
Definition: storeScorm.php:23
global $ilCtrl
Definition: ilias.php:18
$DIC
Definition: xapitoken.php:46
initInsertTemplateForm()
Init insert template form.
+ Here is the call graph for this function:

◆ insertSubchapter()

ilStructureObjectGUI::insertSubchapter ( )

Insert (multiple) subchapters at node.

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

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

745  {
747 
748  $this->insertChapter(true);
749  }
global $ilCtrl
Definition: ilias.php:18
insertChapter($a_as_sub=false)
Insert (multiple) chapters at node.
+ Here is the call graph for this function:

◆ insertSubchapterClip()

ilStructureObjectGUI::insertSubchapterClip ( )

Insert Chapter from clipboard.

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

References insertChapterClip().

824  {
825  $this->insertChapterClip(true);
826  }
insertChapterClip($a_as_sub=false, $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 1029 of file class.ilStructureObjectGUI.php.

References ilLMObjectGUI\$ctrl, ilLMObjectGUI\$lng, $tabs, ilLMObjectGUI\$ui, ilLMPageObjectGUI\getLayoutCssFix(), ilHierarchyFormGUI\getPostFirstChild(), ilHierarchyFormGUI\getPostMulti(), ilHierarchyFormGUI\getPostNodeId(), initInsertTemplateForm(), and setTabs().

1030  {
1031  $ctrl = $this->ctrl;
1032  $ui = $this->ui;
1033  $lng = $this->lng;
1034 
1035  $this->setTabs();
1036  $tabs = $this->tabs;
1037  $tabs->clearTargets();
1038  $tabs->setBackTarget($lng->txt("back"), $ctrl->getLinkTarget($this, "showHierarchy"));
1039 
1040  $ctrl->setParameter($this, "multi", ilChapterHierarchyFormGUI::getPostMulti());
1041  $ctrl->setParameter($this, "node_id", ilChapterHierarchyFormGUI::getPostNodeId());
1042  $ctrl->setParameter($this, "first_child", ilChapterHierarchyFormGUI::getPostFirstChild());
1043  $ctrl->saveParameter($this, "obj_id");
1044  $form = $this->initInsertTemplateForm();
1045  $this->tpl->setContent($ui->renderer()->render($form) . ilLMPageObjectGUI::getLayoutCssFix());
1046  }
static getPostMulti()
Get multi number of _POST input.
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) ...
initInsertTemplateForm()
Init insert template form.
+ Here is the call graph for this function:

◆ pasteChapter()

ilStructureObjectGUI::pasteChapter ( )

paste chapter

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

References $ilUser, $user, and insertChapterClip().

503  {
505 
506  return $this->insertChapterClip(false, "subchap");
507  }
insertChapterClip($a_as_sub=false, $a_return="view")
Insert Chapter from clipboard.
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ pastePage()

ilStructureObjectGUI::pastePage ( )

paste page

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

References $error, $ilErr, $ilUser, $user, and insertPageClip().

471  {
474 
475  if (!$ilUser->clipboardHasObjectsOfType("pg")) {
476  $ilErr->raiseError($this->lng->txt("no_page_in_clipboard"), $ilErr->MESSAGE);
477  }
478 
479  return $this->insertPageClip();
480  }
$ilErr
Definition: raiseError.php:18
$ilUser
Definition: imgupload.php:18
insertPageClip()
Insert pages from clipboard.
+ Here is the call graph for this function:

◆ proceedDragDrop()

ilStructureObjectGUI::proceedDragDrop ( )

Perform drag and drop action.

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

References $_POST, ilLMObjectGUI\$ctrl, and $ilCtrl.

910  {
912 
913  //echo "-".$_POST["il_hform_source_id"]."-".$_POST["il_hform_target_id"]."-".$_POST["il_hform_fc"]."-";
914  $this->content_object->executeDragDrop(
915  $_POST["il_hform_source_id"],
916  $_POST["il_hform_target_id"],
917  $_POST["il_hform_fc"],
918  $_POST["il_hform_as_subitem"]
919  );
920  $ilCtrl->redirect($this, "showHierarchy");
921  }
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ putInTree()

ilStructureObjectGUI::putInTree ( )

put chapter into tree

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

References $_GET, $tree, IL_FIRST_NODE, and IL_LAST_NODE.

Referenced by save().

424  {
425  //echo "st:putInTree";
426  // chapters should be behind pages in the tree
427  // so if target is first node, the target is substituted with
428  // the last child of type pg
429  if ($_GET["target"] == IL_FIRST_NODE) {
430  $tree = new ilTree($this->content_object->getId());
431  $tree->setTableNames('lm_tree', 'lm_data');
432  $tree->setTreeTablePK("lm_id");
433 
434  // determine parent node id
435  $parent_id = (!empty($_GET["obj_id"]))
436  ? $_GET["obj_id"]
437  : $tree->getRootId();
438  // determine last child of type pg
439  $childs = $tree->getChildsByType($parent_id, "pg");
440  if (count($childs) != 0) {
441  $_GET["target"] = $childs[count($childs) - 1]["obj_id"];
442  }
443  }
444  if (empty($_GET["target"])) {
445  $_GET["target"] = IL_LAST_NODE;
446  }
447 
448  parent::putInTree();
449  }
$_GET["client_id"]
const IL_FIRST_NODE
Definition: class.ilTree.php:5
const IL_LAST_NODE
Definition: class.ilTree.php:4
+ Here is the caller graph for this function:

◆ save()

ilStructureObjectGUI::save ( )

save new chapter

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

References $_GET, $_POST, ilLMObjectGUI\checkTree(), putInTree(), and ilUtil\stripSlashes().

401  {
402  $this->obj = new ilStructureObject($this->content_object);
403 
404  $this->obj->setType("st");
405  $this->obj->setTitle(ilUtil::stripSlashes($_POST["Fobject"]["title"]));
406  $this->obj->setDescription(ilUtil::stripSlashes($_POST["Fobject"]["desc"]));
407  $this->obj->setLMId($this->content_object->getId());
408  $this->obj->create();
409 
410  $this->putInTree();
411 
412  // check the tree
413  $this->checkTree();
414 
415  if (!empty($_GET["obj_id"])) {
416  $this->ctrl->redirect($this, "subchap");
417  }
418  }
$_GET["client_id"]
checkTree()
check the content object tree
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Class ilStructreObject.
putInTree()
put chapter into tree
$_POST["username"]
+ Here is the call graph for this function:

◆ saveAllTitles()

ilStructureObjectGUI::saveAllTitles ( )

Save all titles of chapters/pages.

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

References $_GET, $_POST, ilLMObjectGUI\$ctrl, $ilCtrl, ilLMObject\saveTitles(), and ilUtil\stripSlashesArray().

275  {
277 
278  ilLMObject::saveTitles($this->content_object, ilUtil::stripSlashesArray($_POST["title"]), $_GET["transl"]);
279 
280  ilUtil::sendSuccess($this->lng->txt("lm_save_titles"), true);
281  $ilCtrl->redirect($this, "showHierarchy");
282  }
$_GET["client_id"]
static saveTitles($a_lm, $a_titles, $a_lang="-")
Save titles for lm objects.
global $ilCtrl
Definition: ilias.php:18
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
$_POST["username"]
+ Here is the call graph for this function:

◆ savePageLayout()

ilStructureObjectGUI::savePageLayout ( )

Save page layout.

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

References $_POST, ilLMObjectGUI\$ctrl, $ilCtrl, ilLMObjectGUI\$lng, ilUtil\stripSlashes(), and ilLMObject\writeLayout().

982  {
983  $lng = $this->lng;
985 
986  foreach ($_POST["id"] as $id) {
987  $id = ilUtil::stripSlashes($id);
990  ilUtil::stripSlashes($_POST["layout"]),
991  $this->content_object
992  );
993  }
994  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
995  $ilCtrl->redirect($this, "showHierarchy");
996  }
static writeLayout($a_obj_id, $a_layout, $a_lm=null)
Write layout setting.
global $ilCtrl
Definition: ilias.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ setPageLayout()

ilStructureObjectGUI::setPageLayout ( )

Set layout for multipl pages.

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

References $_POST, ilLMObjectGUI\$ctrl, $ilCtrl, ilLMObjectGUI\$lng, ilLMObjectGUI\$tpl, initSetPageLayoutForm(), and ilUtil\sendFailure().

931  {
932  $tpl = $this->tpl;
934  $lng = $this->lng;
935 
936  if (!is_array($_POST["id"])) {
937  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
938  $ilCtrl->redirect($this, "showHierarchy");
939  }
940 
941  $this->initSetPageLayoutForm();
942 
943  $tpl->setContent($this->form->getHTML());
944  }
initSetPageLayoutForm()
Init set page layout form.
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ setStructureObject()

ilStructureObjectGUI::setStructureObject ( $a_st_object)

set structure object

Parameters
object$a_st_objectstructure object

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

68  {
69  $this->obj = $a_st_object;
70  }

◆ setTabs()

ilStructureObjectGUI::setTabs ( )

output tabs

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

References $ilUser, ilLMObjectGUI\$lng, $tabs, $user, ilUtil\getImagePath(), ilObjectMetaDataGUI\getTab(), and ILIAS_HTTP_PATH.

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

602  {
603  $ilTabs = $this->tabs;
605  $lng = $this->lng;
606 
607  // subelements
608  $ilTabs->addTarget(
609  "cont_pages_and_subchapters",
610  $this->ctrl->getLinkTarget($this, 'showHierarchy'),
611  array("view", "showHierarchy"),
612  get_class($this)
613  );
614 
615  // preconditions
616  $ilTabs->addTarget(
617  "preconditions",
618  $this->ctrl->getLinkTarget($this, 'listConditions'),
619  "listConditions",
620  get_class($this)
621  );
622 
623  // metadata
624  $mdgui = new ilObjectMetaDataGUI($this->content_object, $this->obj->getType(), $this->obj->getId());
625  $mdtab = $mdgui->getTab();
626  if ($mdtab) {
627  $ilTabs->addTarget(
628  "meta_data",
629  $mdtab,
630  "",
631  "ilmdeditorgui"
632  );
633  }
634 
635  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_st.svg"));
636  $this->tpl->setTitle(
637  $this->lng->txt($this->obj->getType()) . ": " . $this->obj->getTitle()
638  );
639 
640  // presentation view
641  $ilTabs->addNonTabbedLink(
642  "pres_mode",
643  $lng->txt("cont_presentation_view"),
644  ILIAS_HTTP_PATH . "/goto.php?target=st_" . $this->obj->getId(),
645  "_top"
646  );
647  }
Class ilObjectMetaDataGUI.
getTab($a_base_class=null)
Get tab link if available.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showHierarchy()

ilStructureObjectGUI::showHierarchy ( )

Show subhiearchy of pages and subchapters.

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

References $_GET, ilLMObjectGUI\$ctrl, $ilCtrl, ilLMObjectGUI\$lng, ilUtil\getImagePath(), ilObjContentObjectGUI\getMultiLangHeader(), ilFormGUI\setFormAction(), and setTabs().

Referenced by view().

161  {
162  $lng = $this->lng;
164 
165  $this->setTabs();
166 
167  $ilCtrl->setParameter($this, "backcmd", "showHierarchy");
168 
169  $form_gui = new ilChapterHierarchyFormGUI($this->content_object->getType(), $_GET["transl"]);
170  $form_gui->setFormAction($ilCtrl->getFormAction($this));
171  $form_gui->setTitle($this->obj->getTitle());
172  $form_gui->setIcon(ilUtil::getImagePath("icon_st.svg"));
173  $form_gui->setTree($this->tree);
174  $form_gui->setCurrentTopNodeId($this->obj->getId());
175  $form_gui->addMultiCommand($lng->txt("delete"), "delete");
176  $form_gui->addMultiCommand($lng->txt("cut"), "cutItems");
177  $form_gui->addMultiCommand($lng->txt("copy"), "copyItems");
178  $form_gui->addMultiCommand($lng->txt("cont_de_activate"), "activatePages");
179  if ($this->content_object->getLayoutPerPage()) {
180  $form_gui->addMultiCommand($lng->txt("cont_set_layout"), "setPageLayout");
181  }
182  $form_gui->setDragIcon(ilUtil::getImagePath("icon_pg.svg"));
183  $form_gui->addCommand($lng->txt("cont_save_all_titles"), "saveAllTitles");
184  $form_gui->addHelpItem($lng->txt("cont_chapters_after_pages"));
185  $up_gui = "ilobjlearningmodulegui";
186  $ilCtrl->setParameterByClass($up_gui, "active_node", $this->obj->getId());
187  $ilCtrl->setParameterByClass($up_gui, "active_node", "");
188 
189  $ctpl = new ilTemplate("tpl.chap_and_pages.html", true, true, "Modules/LearningModule");
190  $ctpl->setVariable("HIERARCHY_FORM", $form_gui->getHTML());
191  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
192 
193  $ml_head = ilObjContentObjectGUI::getMultiLangHeader($this->content_object->getId(), $this);
194 
195  $this->tpl->setContent($ml_head . $ctpl->get());
196  }
$_GET["client_id"]
setFormAction($a_formaction)
Set FormAction.
global $ilCtrl
Definition: ilias.php:18
static getMultiLangHeader($a_lm_id, $a_gui_class, $a_mode="")
Get multi lang header.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
This class represents a hierarchical form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ subchap()

ilStructureObjectGUI::subchap ( )

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

References $_GET, ilLMObjectGUI\$ctrl, $ilCtrl, $ilUser, ilLMObjectGUI\$lng, $tree, $user, ilStructureObject\_getPresentationTitle(), ilLMObject\CHAPTER_TITLE, ilUtil\formSelect(), ilUtil\getImagePath(), IL_FIRST_NODE, setTabs(), ilLMObjectGUI\showActions(), and ilUtil\switchColor().

288  {
289  $tree = $this->tree;
291  $lng = $this->lng;
293 
294  $this->setTabs();
295 
296  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.structure_edit.html", "Modules/LearningModule");
297  $num = 0;
298 
299  $this->tpl->setCurrentBlock("form");
300  $this->ctrl->setParameter($this, "backcmd", "subchap");
301  $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
302  $this->tpl->setVariable("HEADER_TEXT", $this->lng->txt("cont_subchapters"));
303  $this->tpl->setVariable("CHECKBOX_TOP", IL_FIRST_NODE);
304 
305  $cnt = 0;
306  $childs = $this->tree->getChilds($this->obj->getId());
307  foreach ($childs as $child) {
308  if ($child["type"] != "st") {
309  continue;
310  }
311  $this->tpl->setCurrentBlock("table_row");
312  // color changing
313  $css_row = ilUtil::switchColor($cnt++, "tblrow1", "tblrow2");
314 
315  // checkbox
316  $this->tpl->setVariable("CHECKBOX_ID", $child["obj_id"]);
317  $this->tpl->setVariable("CSS_ROW", $css_row);
318  $this->tpl->setVariable("IMG_OBJ", ilUtil::getImagePath("icon_st.svg"));
319 
320  // type
321  $this->ctrl->setParameterByClass("ilStructureObjectGUI", "obj_id", $child["obj_id"]);
322  $link = $this->ctrl->getLinkTargetByClass("ilStructureObjectGUI", "view");
323  $this->tpl->setVariable("LINK_TARGET", $link);
324 
325  // title
326  $this->tpl->setVariable(
327  "TEXT_CONTENT",
329  $child["obj_id"],
331  $this->content_object->isActiveNumbering()
332  )
333  );
334 
335  $this->tpl->parseCurrentBlock();
336  }
337  if ($cnt == 0) {
338  $this->tpl->setCurrentBlock("notfound");
339  $this->tpl->setVariable("NUM_COLS", 3);
340  $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
341  $this->tpl->parseCurrentBlock();
342  }
343  //else
344  //{
345  // SHOW VALID ACTIONS
346  $this->tpl->setVariable("NUM_COLS", 3);
347  $acts = array("delete" => "delete", "cutChapter" => "cut",
348  "copyChapter" => "copyChapter");
349  if ($ilUser->clipboardHasObjectsOfType("st")) {
350  $acts["pasteChapter"] = "pasteChapter";
351  }
352  $this->showActions($acts);
353  //}
354 
355  // SHOW POSSIBLE SUB OBJECTS
356  $this->tpl->setVariable("NUM_COLS", 3);
357  //$this->showPossibleSubObjects("st");
358  $subobj = array("st");
359  $opts = ilUtil::formSelect(12, "new_type", $subobj);
360  //$this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg"));
361  $this->tpl->setCurrentBlock("add_object");
362  $this->tpl->setVariable("SELECT_OBJTYPE", $opts);
363  //$this->tpl->setVariable("FORMACTION_OBJ_ADD", "adm_object.php?cmd=create&ref_id=".$_GET["ref_id"]);
364  $this->tpl->setVariable("BTN_NAME", "create");
365  $this->tpl->setVariable("TXT_ADD", $this->lng->txt("insert"));
366  $this->tpl->parseCurrentBlock();
367 
368  //$this->tpl->setVariable("NUM_COLS", 2);
369  //$this->showPossibleSubObjects("st");
370 
371  $this->tpl->setCurrentBlock("form");
372  $this->tpl->parseCurrentBlock();
373 
374  $ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
375  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
const IL_FIRST_NODE
Definition: class.ilTree.php:5
static _getPresentationTitle( $a_st_id, $a_mode=self::CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-", $a_include_short=false)
get presentation title
$ilUser
Definition: imgupload.php:18
showActions($a_actions)
show possible action (form buttons)
static formSelect( $selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
+ Here is the call graph for this function:

◆ switchToLanguage()

ilStructureObjectGUI::switchToLanguage ( )

Switch to language.

Parameters

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

References $_GET, ilLMObjectGUI\$ctrl, and $ilCtrl.

1019  {
1020  $ilCtrl = $this->ctrl;
1021 
1022  $ilCtrl->setParameter($this, "transl", $_GET["totransl"]);
1023  $ilCtrl->redirect($this, "showHierarchy");
1024  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18

◆ view()

ilStructureObjectGUI::view ( )

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

References ilLMObjectGUI\$ctrl, $ilCtrl, $ilUser, ilLMObjectGUI\$lng, $tree, $user, and showHierarchy().

Referenced by edit().

147  {
148  $tree = $this->tree;
151  $lng = $this->lng;
152 
153  $this->showHierarchy();
154  }
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
showHierarchy()
Show subhiearchy of pages and subchapters.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $error

ilStructureObjectGUI::$error
protected

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

Referenced by pastePage().

◆ $log

ilStructureObjectGUI::$log
protected

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

Referenced by insertChapterClip().

◆ $obj

ilStructureObjectGUI::$obj

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

◆ $tabs

ilStructureObjectGUI::$tabs
protected

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

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

◆ $tree

ilStructureObjectGUI::$tree

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

Referenced by putInTree(), subchap(), and view().

◆ $user

ilStructureObjectGUI::$user
protected

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