ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilObjContentObjectGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once "./Services/Object/classes/class.ilObjectGUI.php";
5 include_once "./Modules/LearningModule/classes/class.ilObjContentObject.php";
6 include_once ("./Modules/LearningModule/classes/class.ilLMPageObjectGUI.php");
7 include_once ("./Modules/LearningModule/classes/class.ilStructureObjectGUI.php");
8 require_once 'Services/LinkChecker/interfaces/interface.ilLinkCheckerGUIRowHandling.php';
9 
22 {
23  var $ctrl;
24 
30  function ilObjContentObjectGUI($a_data,$a_id = 0,$a_call_by_reference = true, $a_prepare_output = false)
31  {
32  global $lng, $ilCtrl;
33 //echo "<br>ilobjcontobjgui-constructor-id-$a_id";
34  $this->ctrl =& $ilCtrl;
35  $lng->loadLanguageModule("content");
36  $lng->loadLanguageModule("obj");
37  parent::ilObjectGUI($a_data,$a_id,$a_call_by_reference,false);
38  }
39 
43  function &executeCommand()
44  {
45  global $ilAccess, $lng, $ilTabs, $ilCtrl, $ilErr;
46 
47  if ($this->ctrl->getRedirectSource() == "ilinternallinkgui")
48  {
49  $this->explorer();
50  return;
51  }
52 
53  if ($this->ctrl->getCmdClass() == "ilinternallinkgui")
54  {
55  $this->ctrl->setReturn($this, "explorer");
56  }
57 
58  // get next class that processes or forwards current command
59  $next_class = $this->ctrl->getNextClass($this);
60 
61  // get current command
62 // $cmd = $this->ctrl->getCmd("", array("downloadExportFile"));
63  if ($_GET["to_props"] == 1)
64  {
65  $cmd = $this->ctrl->getCmd("properties");
66  }
67  else
68  {
69  $cmd = $this->ctrl->getCmd("chapters");
70  }
71 
72 
73 //echo "-$cmd-".$next_class."-";
74  switch($next_class)
75  {
76  case "illearningprogressgui":
77  $this->addHeaderAction();
78  $this->addLocations();
79  include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
80  $this->setTabs("learning_progress");
81 
82  $new_gui =& new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY,$this->object->getRefId());
83  $this->ctrl->forwardCommand($new_gui);
84 
85  break;
86 
87  case 'ilobjectmetadatagui':
88  if(!$ilAccess->checkAccess('write','',$this->object->getRefId()))
89  {
90  $ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);
91  }
92 
93  $this->addHeaderAction();
94  $this->addLocations();
95  $this->setTabs("meta");
96 
97  include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
98  $md_gui = new ilObjectMetaDataGUI($this->object);
99  $md_gui->addMDObserver($this->object, 'MDUpdateListener', 'Educational'); // #9510
100  $md_gui->addMDObserver($this->object, 'MDUpdateListener', 'General');
101  $this->ctrl->forwardCommand($md_gui);
102  break;
103 
104  case "ilobjstylesheetgui":
105  $this->addLocations();
106  include_once ("./Services/Style/classes/class.ilObjStyleSheetGUI.php");
107  $this->ctrl->setReturn($this, "editStyleProperties");
108  $style_gui =& new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
109  $style_gui->omitLocator();
110  if ($cmd == "create" || $_GET["new_type"]=="sty")
111  {
112  $style_gui->setCreationMode(true);
113  }
114  $ret =& $this->ctrl->forwardCommand($style_gui);
115  //$ret =& $style_gui->executeCommand();
116 
117  if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle")
118  {
119  $style_id = $ret;
120  $this->object->setStyleSheetId($style_id);
121  $this->object->update();
122  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
123  }
124  break;
125 
126  case "illmpageobjectgui":
127 
128  $ilTabs->setBackTarget($lng->txt("learning module"),
129  $ilCtrl->getLinkTarget($this, "chapters"));
130  $this->ctrl->saveParameter($this, array("obj_id"));
131  $this->addLocations();
132  $this->ctrl->setReturn($this, "chapters");
133 //echo "!";
134  //$this->lm_obj =& $this->ilias->obj_factory->getInstanceByRefId($this->ref_id);
135 
136  $pg_gui =& new ilLMPageObjectGUI($this->object);
137  if ($_GET["obj_id"] != "")
138  {
139  $obj =& ilLMObjectFactory::getInstance($this->object, $_GET["obj_id"]);
140  $pg_gui->setLMPageObject($obj);
141  }
142  //$ret =& $pg_gui->executeCommand();
143  $ret =& $this->ctrl->forwardCommand($pg_gui);
144  if ($cmd == "save" || $cmd == "cancel")
145  {
146 // $this->ctrl->redirect($this, "pages");
147  }
148  break;
149 
150  case "ilstructureobjectgui":
151  $ilTabs->setBackTarget($lng->txt("learning module"),
152  $ilCtrl->getLinkTarget($this, "chapters"));
153 
154  $this->ctrl->saveParameter($this, array("obj_id"));
155  $this->addLocations();
156  $this->ctrl->setReturn($this, "chapters");
157  $st_gui =& new ilStructureObjectGUI($this->object, $this->object->lm_tree);
158  if ($_GET["obj_id"] != "")
159  {
160  $obj =& ilLMObjectFactory::getInstance($this->object, $_GET["obj_id"]);
161  $st_gui->setStructureObject($obj);
162  }
163  //$ret =& $st_gui->executeCommand();
164  $ret =& $this->ctrl->forwardCommand($st_gui);
165  if ($cmd == "save" || $cmd == "cancel")
166  {
167  if ($_GET["obj_id"] == "")
168  {
169  $this->ctrl->redirect($this, "chapters");
170  }
171  else
172  {
173  $this->ctrl->setCmd("subchap");
174  $this->executeCommand();
175  }
176  }
177  break;
178 
179  case 'ilpermissiongui':
180  if (strtolower($_GET["baseClass"]) == "iladministrationgui")
181  {
182  $this->prepareOutput();
183  }
184  else
185  {
186  $this->addHeaderAction();
187  $this->addLocations(true);
188  $this->setTabs("perm");
189  }
190  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
191  $perm_gui =& new ilPermissionGUI($this);
192  $ret =& $this->ctrl->forwardCommand($perm_gui);
193  break;
194 
195  // infoscreen
196  case 'ilinfoscreengui':
197  $this->addHeaderAction();
198  $this->addLocations(true);
199  $this->setTabs("info");
200  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
201  $info = new ilInfoScreenGUI($this);
202  $info->enablePrivateNotes();
203  $info->enableLearningProgress();
204 
205  $info->enableNews();
206  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
207  {
208  $info->enableNewsEditing();
209  $info->setBlockProperty("news", "settings", true);
210  }
211 
212  // show standard meta data section
213  $info->addMetaDataSections($this->object->getId(), 0,
214  $this->object->getType());
215 
216  $ret =& $this->ctrl->forwardCommand($info);
217  break;
218 
219  case "ilexportgui":
220  $this->addHeaderAction();
221  $this->addLocations(true);
222  $this->setTabs("export");
223  include_once("./Services/Export/classes/class.ilExportGUI.php");
224  $exp_gui = new ilExportGUI($this);
225  // old school -> new school
226  //$exp_gui->addFormat("xml", "", $this, "export");
227  $exp_gui->addFormat("xml");
228  include_once("./Services/Object/classes/class.ilObjectTranslation.php");
229  $ot = ilObjectTranslation::getInstance($this->object->getId());
230  if ($ot->getContentActivated())
231  {
232  $exp_gui->addFormat("xml_master", "XML (".$lng->txt("cont_master_language_only").")", $this, "export");
233 
234  $lng->loadLanguageModule("meta");
235  $langs = $ot->getLanguages();
236  foreach ($langs as $l => $ldata)
237  {
238  $exp_gui->addFormat("html_".$l, "HTML (".$lng->txt("meta_l_".$l).")", $this, "exportHTML");
239  }
240  $exp_gui->addFormat("html_all", "HTML (".$lng->txt("cont_all_languages").")", $this, "exportHTML");
241  }
242  else
243  {
244  $exp_gui->addFormat("html", "", $this, "exportHTML");
245  }
246 
247  $exp_gui->addFormat("scorm", "", $this, "exportSCORM");
248  $exp_gui->addCustomColumn($lng->txt("cont_public_access"),
249  $this, "getPublicAccessColValue");
250  $exp_gui->addCustomMultiCommand($lng->txt("cont_public_access"),
251  $this, "publishExportFile");
252  $ret = $this->ctrl->forwardCommand($exp_gui);
253  break;
254 
255  case 'ilobjecttranslationgui':
256  $this->addHeaderAction();
257  $this->addLocations(true);
258  //$this->checkPermissionBool("write");
259  //$this->prepareOutput();
260  //$this->tabs_gui->setTabActive('export');
261  $this->setTabs("settings");
262  $this->setSubTabs("obj_multilinguality");
263  include_once("./Services/Object/classes/class.ilObjectTranslationGUI.php");
264  $transgui = new ilObjectTranslationGUI($this);
265  $transgui->setTitleDescrOnlyMode(false);
266  $this->ctrl->forwardCommand($transgui);
267  break;
268 
269 
270  case "ilcommonactiondispatchergui":
271  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
273  $this->ctrl->forwardCommand($gui);
274  break;
275 
276  case 'ilobjectcopygui':
277  $this->prepareOutput();
278  include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
279  $cp = new ilObjectCopyGUI($this);
280  $cp->setType('lm');
281  $this->ctrl->forwardCommand($cp);
282  break;
283 
284 /* case "ilpagemultilanggui":
285  $this->addHeaderAction();
286  $this->addLocations(true);
287  $ilCtrl->setReturn($this, "properties");
288  include_once("./Services/COPage/classes/class.ilPageMultiLangGUI.php");
289  $ml_gui = new ilPageMultiLangGUI("lm", $this->object->getId());
290  $this->setTabs("settings");
291  $this->setSubTabs("cont_multilinguality");
292  $ret = $this->ctrl->forwardCommand($ml_gui);
293  break;*/
294 
295  case "illmmultisrtuploadgui":
296  $this->addHeaderAction();
297  $this->addLocations(true);
298  $this->setTabs("content");
299  $this->setContentSubTabs("srt_files");
300  include_once("./Modules/LearningModule/classes/class.ilLMMultiSrtUploadGUI.php");
301  $gui = new ilLMMultiSrtUploadGUI($this->object);
302  $this->ctrl->forwardCommand($gui);
303  break;
304 
305  case "illmimportgui":
306  $this->addHeaderAction();
307  $this->addLocations(true);
308  $this->setTabs("content");
309  $this->setContentSubTabs("import");
310  include_once("./Modules/LearningModule/classes/class.ilLMImportGUI.php");
311  $gui = new ilLMImportGUI($this->object);
312  $this->ctrl->forwardCommand($gui);
313  break;
314 
315  default:
316  $new_type = $_POST["new_type"]
317  ? $_POST["new_type"]
318  : $_GET["new_type"];
319 
320 
321  if ($cmd == "create" &&
322  !in_array($new_type, array("dbk", "lm")))
323  {
324  //$this->addLocations();
325  switch ($new_type)
326  {
327  case "pg":
328  $this->setTabs();
329  $this->ctrl->setCmdClass("ilLMPageObjectGUI");
330  $ret =& $this->executeCommand();
331  break;
332 
333  case "st":
334  $this->setTabs();
335  $this->ctrl->setCmdClass("ilStructureObjectGUI");
336  $ret =& $this->executeCommand();
337  break;
338  }
339  }
340  else
341  {
342  // creation of new dbk/lm in repository
343  if ($this->getCreationMode() == true &&
344  in_array($new_type, array("dbk", "lm")))
345  {
346  $this->prepareOutput();
347  if ($cmd == "") // this may be due to too big upload files
348  {
349  $cmd = "create";
350  }
351  $cmd .= "Object";
352  $ret =& $this->$cmd();
353  }
354  else
355  {
356  $this->addHeaderAction();
357  $this->addLocations();
358  $ret =& $this->$cmd();
359  }
360  }
361  break;
362  }
363  return $ret;
364  }
365 
366  function _forwards()
367  {
368  return array("ilLMPageObjectGUI", "ilStructureObjectGUI","ilObjStyleSheetGUI");
369  }
370 
374  function properties()
375  {
376  global $lng;
377 
378  $lng->loadLanguageModule("style");
379  $this->setTabs("settings");
380  $this->setSubTabs("settings");
381 
382  // lm properties
383  $this->initPropertiesForm();
384  $this->getPropertiesFormValues();
385 
386  if($this->object->getType() == "lm")
387  {
388  // Edit ecs export settings
389  include_once 'Modules/LearningModule/classes/class.ilECSLearningModuleSettings.php';
390  $ecs = new ilECSLearningModuleSettings($this->object);
391  $ecs->addSettingsToForm($this->form, 'lm');
392  }
393 
394  $this->tpl->setContent($this->form->getHTML());
395  }
396 
401  {
402  global $ilCtrl, $lng;
403 
404  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
405  $this->form = new ilPropertyFormGUI();
406 
407  // title
408  $ti = new ilTextInputGUI($lng->txt("title"), "title");
409  //$ti->setMaxLength();
410  //$ti->setSize();
411  //$ti->setInfo($lng->txt(""));
412  $ti->setRequired(true);
413  $this->form->addItem($ti);
414 
415  // description
416  $ta = new ilTextAreaInputGUI($lng->txt("desc"), "description");
417  //$ta->setCols();
418  //$ta->setRows();
419  //$ta->setInfo($lng->txt(""));
420  $this->form->addItem($ta);
421 
422  $lng->loadLanguageModule("rep");
424  $section->setTitle($this->lng->txt('rep_activation_availability'));
425  $this->form->addItem($section);
426 
427  // online
428  $online = new ilCheckboxInputGUI($lng->txt("cont_online"), "cobj_online");
429  $this->form->addItem($online);
430 
431  // presentation
433  $section->setTitle($this->lng->txt('cont_presentation'));
434  $this->form->addItem($section);
435 
436  // default layout
437  $layout = self::getLayoutOption($lng->txt("cont_def_layout"), "lm_layout");
438  $this->form->addItem($layout);
439 
440  // layout per page
441  $lpp = new ilCheckboxInputGUI($lng->txt("cont_layout_per_page"), "layout_per_page");
442  $lpp->setInfo($this->lng->txt("cont_layout_per_page_info"));
443  $this->form->addItem($lpp);
444 
445  // page header
446  $page_header = new ilSelectInputGUI($lng->txt("cont_page_header"), "lm_pg_header");
447  $option = array ("st_title" => $this->lng->txt("cont_st_title"),
448  "pg_title" => $this->lng->txt("cont_pg_title"),
449  "none" => $this->lng->txt("cont_none"));
450  $page_header->setOptions($option);
451  $this->form->addItem($page_header);
452 
453  // chapter numeration
454  $chap_num = new ilCheckboxInputGUI($lng->txt("cont_act_number"), "cobj_act_number");
455  $this->form->addItem($chap_num);
456 
457  // toc mode
458  $toc_mode = new ilSelectInputGUI($lng->txt("cont_toc_mode"), "toc_mode");
459  $option = array ("chapters" => $this->lng->txt("cont_chapters_only"),
460  "pages" => $this->lng->txt("cont_chapters_and_pages"));
461  $toc_mode->setOptions($option);
462  $this->form->addItem($toc_mode);
463 
464  // synchronize frames
465  /*
466  $synch = new ilCheckboxInputGUI($lng->txt("cont_synchronize_frames"), "cobj_clean_frames");
467  $synch->setInfo($this->lng->txt("cont_synchronize_frames_desc"));
468  $this->form->addItem($synch);*/
469 
470  // show progress icons
471  $progr_icons = new ilCheckboxInputGUI($lng->txt("cont_progress_icons"), "progr_icons");
472  $progr_icons->setInfo($this->lng->txt("cont_progress_icons_info"));
473  $this->form->addItem($progr_icons);
474 
475  // self assessment
477  $section->setTitle($this->lng->txt('cont_self_assessment'));
478  $this->form->addItem($section);
479 
480  // tries
481  $radg = new ilRadioGroupInputGUI($lng->txt("cont_tries"), "store_tries");
482  $radg->setValue(0);
483  $op1 = new ilRadioOption($lng->txt("cont_tries_reset_on_visit"), 0,$lng->txt("cont_tries_reset_on_visit_info"));
484  $radg->addOption($op1);
485  $op2 = new ilRadioOption($lng->txt("cont_tries_store"), 1,$lng->txt("cont_tries_store_info"));
486  $radg->addOption($op2);
487  $this->form->addItem($radg);
488 
489  // restrict forward navigation
490  $qfeed = new ilCheckboxInputGUI($lng->txt("cont_restrict_forw_nav"), "restrict_forw_nav");
491  $qfeed->setInfo($this->lng->txt("cont_restrict_forw_nav_info"));
492  $this->form->addItem($qfeed);
493 
494  // notification
495  $not = new ilCheckboxInputGUI($lng->txt("cont_notify_on_blocked_users"), "notification_blocked_users");
496  $not->setInfo($this->lng->txt("cont_notify_on_blocked_users_info"));
497  $qfeed->addSubItem($not);
498 
499  // disable default feedback for questions
500  $qfeed = new ilCheckboxInputGUI($lng->txt("cont_disable_def_feedback"), "disable_def_feedback");
501  $qfeed->setInfo($this->lng->txt("cont_disable_def_feedback_info"));
502  $this->form->addItem($qfeed);
503 
504  // additional features
506  $section->setTitle($this->lng->txt('obj_features'));
507  $this->form->addItem($section);
508 
509  // public notes
510  if (!$this->ilias->getSetting('disable_comments'))
511  {
512  $this->lng->loadLanguageModule("notes");
513  $pub_nodes = new ilCheckboxInputGUI($lng->txt("notes_comments"), "cobj_pub_notes");
514  $pub_nodes->setInfo($this->lng->txt("cont_lm_comments_desc"));
515  $this->form->addItem($pub_nodes);
516  }
517 
518  // history user comments
519  $com = new ilCheckboxInputGUI($lng->txt("enable_hist_user_comments"), "cobj_user_comments");
520  $com->setInfo($this->lng->txt("enable_hist_user_comments_desc"));
521  $this->form->addItem($com);
522 
523  // rating
524  $this->lng->loadLanguageModule('rating');
525  $rate = new ilCheckboxInputGUI($this->lng->txt('rating_activate_rating'), 'rating');
526  $rate->setInfo($this->lng->txt('rating_activate_rating_info'));
527  $this->form->addItem($rate);
528  $ratep = new ilCheckboxInputGUI($this->lng->txt('lm_activate_rating'), 'rating_pages');
529  $this->form->addItem($ratep);
530 
531  $this->form->setTitle($lng->txt("cont_lm_properties"));
532  $this->form->addCommandButton("saveProperties", $lng->txt("save"));
533  $this->form->setFormAction($ilCtrl->getFormAction($this));
534  }
535 
540  {
541  global $ilUser;
542 
543  $values = array();
544 
545  $title = $this->object->getTitle();
546  $description = $this->object->getDescription();
547  include_once("./Services/Object/classes/class.ilObjectTranslation.php");
548  $ot = ilObjectTranslation::getInstance($this->object->getId());
549  if ($ot->getContentActivated())
550  {
551  $title = $ot->getDefaultTitle();
552  $description = $ot->getDefaultDescription();
553  }
554 
555  $values["title"] = $title;
556  $values["description"] = $description;
557  if ($this->object->getOnline())
558  {
559  $values["cobj_online"] = true;
560  }
561  $values["lm_layout"] = $this->object->getLayout();
562  $values["lm_pg_header"] = $this->object->getPageHeader();
563  if ($this->object->isActiveNumbering())
564  {
565  $values["cobj_act_number"] = true;
566  }
567  $values["toc_mode"] = $this->object->getTOCMode();
568  if ($this->object->publicNotes())
569  {
570  $values["cobj_pub_notes"] = true;
571  }
572  if ($this->object->cleanFrames())
573  {
574  $values["cobj_clean_frames"] = true;
575  }
576  if ($this->object->isActiveHistoryUserComments())
577  {
578  $values["cobj_user_comments"] = true;
579  }
580  $values["layout_per_page"] = $this->object->getLayoutPerPage();
581  $values["rating"] = $this->object->hasRating();
582  $values["rating_pages"] = $this->object->hasRatingPages();
583  $values["disable_def_feedback"] = $this->object->getDisableDefaultFeedback();
584  $values["progr_icons"] = $this->object->getProgressIcons();
585  $values["store_tries"] = $this->object->getStoreTries();
586  $values["restrict_forw_nav"] = $this->object->getRestrictForwardNavigation();
587 
588  include_once "./Services/Notification/classes/class.ilNotification.php";
589  $values["notification_blocked_users"] = ilNotification::hasNotification(
590  ilNotification::TYPE_LM_BLOCKED_USERS, $ilUser->getId(),
591  $this->object->getId());
592 
593  $this->form->setValuesByArray($values);
594  }
595 
599  function saveProperties()
600  {
601  global $lng, $ilUser;
602 
603  $valid = false;
604  $this->initPropertiesForm();
605  if ($this->form->checkInput())
606  {
607  include_once("./Services/Object/classes/class.ilObjectTranslation.php");
608  $ot = ilObjectTranslation::getInstance($this->object->getId());
609  if ($ot->getContentActivated())
610  {
611  $ot->setDefaultTitle($_POST['title']);
612  $ot->setDefaultDescription($_POST['description']);
613  $ot->save();
614  }
615 
616  $this->object->setTitle($_POST['title']);
617  $this->object->setDescription($_POST['description']);
618  $this->object->setLayout($_POST["lm_layout"]);
619  $this->object->setPageHeader($_POST["lm_pg_header"]);
620  $this->object->setTOCMode($_POST["toc_mode"]);
621  $this->object->setOnline($_POST["cobj_online"]);
622  $this->object->setActiveNumbering($_POST["cobj_act_number"]);
623  $this->object->setCleanFrames($_POST["cobj_clean_frames"]);
624  if (!$this->ilias->getSetting('disable_comments'))
625  {
626  $this->object->setPublicNotes($_POST["cobj_pub_notes"]);
627  }
628  $this->object->setHistoryUserComments($_POST["cobj_user_comments"]);
629  $this->object->setLayoutPerPage($_POST["layout_per_page"]);
630  $this->object->setRating($_POST["rating"]);
631  $this->object->setRatingPages($_POST["rating_pages"]);
632  $this->object->setDisableDefaultFeedback((int) $_POST["disable_def_feedback"]);
633  $this->object->setProgressIcons((int) $_POST["progr_icons"]);
634 
635  $add_info = "";
636  if ($_POST["restrict_forw_nav"] && !$_POST["store_tries"])
637  {
638  $_POST["store_tries"] = 1;
639  $add_info = "</br>".$lng->txt("cont_automatically_set_store_tries");
640  $add_info = str_replace("$1", $lng->txt("cont_tries_store"), $add_info);
641  $add_info = str_replace("$2", $lng->txt("cont_restrict_forw_nav"), $add_info);
642  }
643 
644  $this->object->setStoreTries((int) $_POST["store_tries"]);
645  $this->object->setRestrictForwardNavigation((int) $_POST["restrict_forw_nav"]);
646  $this->object->updateProperties();
647  $this->object->update();
648 
649  include_once "./Services/Notification/classes/class.ilNotification.php";
651  $ilUser->getId(), $this->object->getId(),
652  (bool)$this->form->getInput("notification_blocked_users"));
653 
654 
655  if($this->object->getType() == 'lm')
656  {
657  // Update ecs export settings
658  include_once 'Modules/LearningModule/classes/class.ilECSLearningModuleSettings.php';
659  $ecs = new ilECSLearningModuleSettings($this->object);
660  if($ecs->handleSettingsUpdate())
661  {
662  $valid = true;
663  }
664  }
665  else
666  {
667  $valid = true;
668  }
669  }
670 
671  if($valid)
672  {
673  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified").$add_info, true);
674  $this->ctrl->redirect($this, "properties");
675  }
676  else
677  {
678  $lng->loadLanguageModule("style");
679  $this->setTabs("settings");
680  $this->setSubTabs("cont_general_properties");
681 
682  $this->form->setValuesByPost();
683  $this->tpl->setContent($this->form->getHTML());
684  }
685  }
686 
691  {
692  global $tpl;
693 
694  $this->initStylePropertiesForm();
695  $tpl->setContent($this->form->getHTML());
696  }
697 
702  {
703  global $ilCtrl, $lng, $ilTabs, $ilSetting;
704 
705  $lng->loadLanguageModule("style");
706  $this->setTabs();
707  $ilTabs->setTabActive("settings");
708  $this->setSubTabs("cont_style");
709 
710  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
711  $this->form = new ilPropertyFormGUI();
712 
713  $fixed_style = $ilSetting->get("fixed_content_style_id");
714  $style_id = $this->object->getStyleSheetId();
715 
716  if ($fixed_style > 0)
717  {
718  $st = new ilNonEditableValueGUI($lng->txt("cont_current_style"));
719  $st->setValue(ilObject::_lookupTitle($fixed_style)." (".
720  $this->lng->txt("global_fixed").")");
721  $this->form->addItem($st);
722  }
723  else
724  {
725  $st_styles = ilObjStyleSheet::_getStandardStyles(true, false,
726  $_GET["ref_id"]);
727 
728  $st_styles[0] = $this->lng->txt("default");
729  ksort($st_styles);
730 
731  if ($style_id > 0)
732  {
733  // individual style
734  if (!ilObjStyleSheet::_lookupStandard($style_id))
735  {
736  $st = new ilNonEditableValueGUI($lng->txt("cont_current_style"));
737  $st->setValue(ilObject::_lookupTitle($style_id));
738  $this->form->addItem($st);
739 
740 //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "edit"));
741 
742  // delete command
743  $this->form->addCommandButton("editStyle",
744  $lng->txt("cont_edit_style"));
745  $this->form->addCommandButton("deleteStyle",
746  $lng->txt("cont_delete_style"));
747 //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "delete"));
748  }
749  }
750 
751  if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id))
752  {
753  $style_sel = ilUtil::formSelect ($style_id, "style_id",
754  $st_styles, false, true);
755  $style_sel = new ilSelectInputGUI($lng->txt("cont_current_style"), "style_id");
756  $style_sel->setOptions($st_styles);
757  $style_sel->setValue($style_id);
758  $this->form->addItem($style_sel);
759 //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "create"));
760  $this->form->addCommandButton("saveStyleSettings",
761  $lng->txt("save"));
762  $this->form->addCommandButton("createStyle",
763  $lng->txt("sty_create_ind_style"));
764  }
765  }
766  $this->form->setTitle($lng->txt("cont_style"));
767  $this->form->setFormAction($ilCtrl->getFormAction($this));
768  }
769 
773  function createStyle()
774  {
775  global $ilCtrl;
776 
777  $ilCtrl->redirectByClass("ilobjstylesheetgui", "create");
778  }
779 
783  function editStyle()
784  {
785  global $ilCtrl;
786 
787  $ilCtrl->redirectByClass("ilobjstylesheetgui", "edit");
788  }
789 
793  function deleteStyle()
794  {
795  global $ilCtrl;
796 
797  $ilCtrl->redirectByClass("ilobjstylesheetgui", "delete");
798  }
799 
803  function saveStyleSettings()
804  {
805  global $ilSetting;
806 
807  if ($ilSetting->get("fixed_content_style_id") <= 0 &&
808  (ilObjStyleSheet::_lookupStandard($this->object->getStyleSheetId())
809  || $this->object->getStyleSheetId() == 0))
810  {
811  $this->object->setStyleSheetId(ilUtil::stripSlashes($_POST["style_id"]));
812  $this->object->update();
813  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
814  }
815  $this->ctrl->redirect($this, "editStyleProperties");
816  }
817 
821  public function initMenuForm()
822  {
823  global $lng, $ilCtrl;
824 
825  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
826  $form = new ilPropertyFormGUI();
827 
828  // enable menu
829  $menu = new ilCheckboxInputGUI($this->lng->txt("cont_active"), "cobj_act_lm_menu");
830  $menu->setChecked($this->object->isActiveLMMenu());
831  $form->addItem($menu);
832 
833  // toc
834  $toc = new ilCheckboxInputGUI($this->lng->txt("cont_toc"), "cobj_act_toc");
835  $toc->setChecked($this->object->isActiveTOC());
836  $form->addItem($toc);
837 
838  // print view
839  $print = new ilCheckboxInputGUI($this->lng->txt("cont_print_view"), "cobj_act_print");
840  $print->setChecked($this->object->isActivePrintView());
841  $form->addItem($print);
842 
843  // prevent glossary appendix
844  $glo = new ilCheckboxInputGUI($this->lng->txt("cont_print_view_pre_glo"), "cobj_act_print_prev_glo");
845  $glo->setChecked($this->object->isActivePreventGlossaryAppendix());
846  $print->addSubItem($glo);
847 
848  // hide header and footer in print view
849  $hhfp = new ilCheckboxInputGUI($this->lng->txt("cont_hide_head_foot_print"), "hide_head_foot_print");
850  $hhfp->setChecked($this->object->getHideHeaderFooterPrint());
851  $print->addSubItem($hhfp);
852 
853  // downloads
854  $no_download_file_available =
855  " ".$lng->txt("cont_no_download_file_available").
856  " <a href='".$ilCtrl->getLinkTargetByClass("ilexportgui", "")."'>".$lng->txt("change")."</a>";
857  $types = array("xml", "html", "scorm");
858  foreach($types as $type)
859  {
860  if ($this->object->getPublicExportFile($type) != "")
861  {
862  if (is_file($this->object->getExportDirectory($type)."/".
863  $this->object->getPublicExportFile($type)))
864  {
865  $no_download_file_available = "";
866  }
867  }
868  }
869  $dl = new ilCheckboxInputGUI($this->lng->txt("cont_downloads"), "cobj_act_downloads");
870  $dl->setInfo($this->lng->txt("cont_downloads_desc").$no_download_file_available);
871  $dl->setChecked($this->object->isActiveDownloads());
872  $form->addItem($dl);
873 
874  // downloads in public area
875  $pdl = new ilCheckboxInputGUI($this->lng->txt("cont_downloads_public_desc"), "cobj_act_downloads_public");
876  $pdl->setChecked($this->object->isActiveDownloadsPublic());
877  $dl->addSubItem($pdl);
878 
879  $form->addCommandButton("saveMenuProperties", $lng->txt("save"));
880 
881  $form->setTitle($lng->txt("cont_lm_menu"));
882  $form->setFormAction($ilCtrl->getFormAction($this));
883 
884  return $form;
885  }
886 
891  {
892  global $lng, $ilTabs, $ilCtrl, $tpl, $ilToolbar;
893 
894  $lng->loadLanguageModule("style");
895  $this->setTabs();
896  $ilTabs->setTabActive("settings");
897  $this->setSubTabs("cont_lm_menu");
898 
899  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
900  $ilToolbar->addFormButton($this->lng->txt("add_menu_entry"), "addMenuEntry");
901  $ilToolbar->setCloseFormTag(false);
902 
903  $form = $this->initMenuForm();
904  $form->setOpenTag(false);
905  $form->setCloseTag(false);
906 
907  $this->__initLMMenuEditor();
908  $entries = $this->lmme_obj->getMenuEntries();
909  include_once("./Modules/LearningModule/classes/class.ilLMMenuItemsTableGUI.php");
910  $table = new ilLMMenuItemsTableGUI($this, "editMenuProperties", $this->lmme_obj);
911  $table->setOpenFormTag(false);
912 
913  $tpl->setContent($form->getHTML()."<br />".$table->getHTML());
914  }
915 
920  {
921  global $ilias;
922 
923  $this->object->setActiveLMMenu((int) $_POST["cobj_act_lm_menu"]);
924  $this->object->setActiveTOC((int) $_POST["cobj_act_toc"]);
925  $this->object->setActivePrintView((int) $_POST["cobj_act_print"]);
926  $this->object->setActivePreventGlossaryAppendix((int) $_POST["cobj_act_print_prev_glo"]);
927  $this->object->setHideHeaderFooterPrint((int) $_POST["hide_head_foot_print"]);
928  $this->object->setActiveDownloads((int) $_POST["cobj_act_downloads"]);
929  $this->object->setActiveDownloadsPublic((int) $_POST["cobj_act_downloads_public"]);
930  $this->object->updateProperties();
931 
932  $this->__initLMMenuEditor();
933 //var_dump($_POST["menu_entries"]); exit;
934  $this->lmme_obj->updateActiveStatus($_POST["menu_entries"]);
935 
936  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
937  $this->ctrl->redirect($this, "editMenuProperties");
938  }
939 
943  function explorer()
944  {
945  global $ilUser, $ilias, $ilCtrl;
946 
947  switch ($this->object->getType())
948  {
949  case "lm":
950  $gui_class = "ilobjlearningmodulegui";
951  break;
952 
953  case "dlb":
954  $gui_class = "ilobjdlbookgui";
955  break;
956  }
957 
958  $ilCtrl->setParameterByClass($gui_class, "active_node", $_GET["active_node"]);
959 
960  $this->tpl = new ilTemplate("tpl.main.html", true, true);
961  // get learning module object
962  //$this->lm_obj =& new ilObjLearningModule($this->ref_id, true);
963 
964  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
965 
966  //$this->tpl = new ilTemplate("tpl.explorer.html", false, false);
967  $this->tpl->addBlockFile("CONTENT", "content", "tpl.explorer.html");
968  $this->tpl->setVariable("IMG_SPACE", ilUtil::getImagePath("spacer.png", false));
969 
970  require_once ("./Modules/LearningModule/classes/class.ilLMEditorExplorer.php");
971  $exp = new ilLMEditorExplorer($this->ctrl->getLinkTarget($this, "view"),
972  $this->object, $gui_class);
973 
974  $exp->setTargetGet("obj_id");
975  $exp->setExpandTarget($this->ctrl->getLinkTarget($this, "explorer"));
976 
977  if ($_GET["lmmovecopy"] == "1")
978  {
979  $this->proceedDragDrop();
980  }
981 
982 
983  if ($_GET["lmexpand"] == "")
984  {
985  $mtree = new ilTree($this->object->getId());
986  $mtree->setTableNames('lm_tree','lm_data');
987  $mtree->setTreeTablePK("lm_id");
988  $expanded = $mtree->readRootId();
989  }
990  else
991  {
992  $expanded = $_GET["lmexpand"];
993  }
994  if ($_GET["active_node"] != "")
995  {
996  $path = $this->lm_tree->getPathId($_GET["active_node"]);
997  $exp->setForceOpenPath($path);
998 
999  $exp->highlightNode($_GET["active_node"]);
1000  }
1001  $exp->setExpand($expanded);
1002 
1003  // build html-output
1004  $exp->setOutput(0);
1005  $output = $exp->getOutput();
1006 
1007  // asynchronous output
1008  if ($ilCtrl->isAsynch())
1009  {
1010  echo $output; exit;
1011  }
1012 
1013  include_once("./Services/COPage/classes/class.ilPageEditorGUI.php");
1014 
1015  /*if (ilPageEditorGUI::_doJSEditing())
1016  {
1017  //$this->tpl->touchBlock("includejavascript");
1018 
1019  $IDS = "";
1020  for ($i=0;$i<count($exp->iconList);$i++)
1021  {
1022  if ($i>0) $IDS .= ",";
1023  $IDS .= "'".$exp->iconList[$i]."'";
1024  }
1025  $this->tpl->setVariable("ICONIDS",$IDS);
1026  //$this->ctrl->setParameter($this, "lmovecopy", 1);
1027  $this->tpl->setVariable("TESTPFAD",$this->ctrl->getLinkTarget($this, "explorer")."&lmmovecopy=1");
1028  //$this->tpl->setVariable("POPUPLINK",$this->ctrl->getLinkTarget($this, "popup")."&ptype=movecopytreenode");
1029  $this->tpl->setVariable("POPUPLINK",$this->ctrl->getLinkTarget($this, "popup")."&ptype=movecopytreenode");
1030  }*/
1031 
1032  $this->tpl->setCurrentBlock("content");
1033  $this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_chap_and_pages"));
1034  $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
1035  $this->tpl->setVariable("EXPLORER",$output);
1036  $this->ctrl->setParameter($this, "lmexpand", $_GET["lmexpand"]);
1037  $this->tpl->setVariable("ACTION", $this->ctrl->getLinkTarget($this, "explorer"));
1038  $this->tpl->parseCurrentBlock();
1039  $this->tpl->show(false);
1040  exit;
1041  }
1042 
1046  function popup()
1047  {
1048  include_once "./Services/COPage/classes/class.ilWysiwygUtil.php";
1049  $popup = new ilWysiwygUtil();
1050  $popup->show($_GET["ptype"]);
1051  exit;
1052  }
1053 
1057  function proceedDragDrop()
1058  {
1059  global $ilCtrl;
1060 
1061  $this->object->executeDragDrop($_POST["il_hform_source_id"], $_POST["il_hform_target_id"],
1062  $_POST["il_hform_fc"], $_POST["il_hform_as_subitem"]);
1063  $ilCtrl->redirect($this, "chapters");
1064  }
1065 
1066  /* protected function initCreationForms($a_new_type)
1067  {
1068  $forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
1069  self::CFORM_IMPORT => $this->initImportForm());
1070 
1071  return $forms;
1072  }*/
1073 
1074  protected function afterSave(ilObject $a_new_object)
1075  {
1076  $a_new_object->notify("new", $_GET["ref_id"], $_GET["parent_non_rbac_id"],
1077  $_GET["ref_id"], $a_new_object->getRefId());
1078  $a_new_object->setCleanFrames(true);
1079  $a_new_object->update();
1080 
1081  // create content object tree
1082  $a_new_object->createLMTree();
1083 
1084  // create a first chapter
1085  $a_new_object->addFirstChapterAndPage();
1086 
1087  // always send a message
1088  ilUtil::sendSuccess($this->lng->txt($this->type."_added"), true);
1089  ilUtil::redirect("ilias.php?ref_id=".$a_new_object->getRefId().
1090  "&baseClass=ilLMEditorGUI");
1091  }
1092 
1096  public function initImportForm()
1097  {
1098  global $lng, $ilCtrl;
1099 
1100  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1101  $form = new ilPropertyFormGUI();
1102 
1103  $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];
1104  $this->ctrl->setParameter($this, "new_type", $new_type);
1105 
1106  $form->setTarget(ilFrameTargetInfo::_getFrame("MainContent"));
1107  $form->setTableWidth("600px");
1108 
1109  // import file
1110  //$fi = new ilFileInputGUI($this->lng->txt("file"), "xmldoc");
1111  $fi = new ilFileInputGUI($this->lng->txt("file"), "importfile");
1112  $fi->setSuffixes(array("zip"));
1113  $fi->setRequired(true);
1114  $fi->setSize(30);
1115  $form->addItem($fi);
1116 
1117  // validation
1118  $cb = new ilCheckboxInputGUI($this->lng->txt("cont_validate_file"), "validate");
1119  $cb->setInfo($this->lng->txt(""));
1120  $form->addItem($cb);
1121 
1122  $form->addCommandButton("importFile", $lng->txt("import"));
1123  $form->addCommandButton("cancel", $lng->txt("cancel"));
1124 
1125  $form->setTitle($this->lng->txt("import_".$new_type));
1126  $form->setFormAction($ilCtrl->getFormAction($this));
1127 
1128  return $form;
1129  }
1130 
1134  function addBibItemObject($a_target = "")
1135  {
1136  include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
1137  $bib_gui =& new ilBibItemGUI();
1138  $bib_gui->setObject($this->object);
1139  $bibItemName = $_POST["bibItemName"] ? $_POST["bibItemName"] : $_GET["bibItemName"];
1140  $bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
1141  if ($bibItemIndex == "")
1142  $bibItemIndex = 0;
1143  $bibItemPath = $_POST["bibItemPath"] ? $_POST["bibItemPath"] : $_GET["bibItemPath"];
1144  if ($bibItemName != "")
1145  {
1146  $bib_gui->bib_obj->add($bibItemName, $bibItemPath, $bibItemIndex);
1147  $data = $bib_gui->bib_obj->getElement("BibItem");
1148  $bibItemIndex = (count($data) - 1);
1149  }
1150  else
1151  {
1152  ilUtil::sendInfo($this->lng->txt("bibitem_choose_element"), true);
1153  }
1154  if ($a_target == "")
1155  {
1156  $a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
1157  }
1158 
1159  $bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
1160  }
1161 
1165  function addBibItem()
1166  {
1167  $this->setTabs();
1168 
1169  // questionable workaround to make this old stuff work
1170  $this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
1171 
1172  $this->addBibItemObject($this->ctrl->getLinkTarget($this));
1173  }
1174 
1178  function deleteBibItemObject($a_target = "")
1179  {
1180  include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
1181  $bib_gui =& new ilBibItemGUI();
1182  $bib_gui->setObject($this->object);
1183  $bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
1184  $bib_gui->bib_obj->delete($_GET["bibItemName"], $_GET["bibItemPath"], $bibItemIndex);
1185  if (strpos($bibItemIndex, ",") > 0)
1186  {
1187  $bibItemIndex = substr($bibItemIndex, 0, strpos($bibItemIndex, ","));
1188  }
1189  if ($a_target == "")
1190  {
1191  $a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
1192  }
1193 
1194  $bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, max(0, $bibItemIndex - 1));
1195  }
1196 
1200  function deleteBibItem()
1201  {
1202  $this->setTabs();
1203 
1204  // questionable workaround to make this old stuff work
1205  $this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
1206 
1207  $this->deleteBibItemObject($this->ctrl->getLinkTarget($this));
1208  }
1209 
1210 
1214  function editBibItemObject($a_target = "")
1215  {
1216  include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
1217  $bib_gui =& new ilBibItemGUI();
1218  $bib_gui->setObject($this->object);
1219  $bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
1220  $bibItemIndex *= 1;
1221  if ($bibItemIndex < 0)
1222  {
1223  $bibItemIndex = 0;
1224  }
1225  if ($a_target == "")
1226  {
1227  $a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
1228  }
1229 
1230  $bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
1231  }
1232 
1236  function editBibItem()
1237  {
1238  $this->setTabs();
1239 
1240  // questionable workaround to make this old stuff work
1241  $this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
1242 
1243  $this->editBibItemObject($this->ctrl->getLinkTarget($this));
1244  }
1245 
1249  function saveBibItemObject($a_target = "")
1250  {
1251  include_once "./Modules/LearningModule/classes/class.ilBibItemGUI.php";
1252  $bib_gui =& new ilBibItemGUI();
1253  $bib_gui->setObject($this->object);
1254  $bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
1255  $bibItemIndex *= 1;
1256  if ($bibItemIndex < 0)
1257  {
1258  $bibItemIndex = 0;
1259  }
1260  $bibItemIndex = $bib_gui->save($bibItemIndex);
1261 
1262  if ($a_target == "")
1263  {
1264  $a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
1265  }
1266 
1267  $bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
1268  }
1269 
1273  function saveBibItem()
1274  {
1275  $this->setTabs();
1276 
1277  // questionable workaround to make this old stuff work
1278  $this->ctrl->setParameter($this, ilCtrl::IL_RTOKEN_NAME, $this->ctrl->getRequestToken());
1279 
1280  $this->saveBibItemObject($this->ctrl->getLinkTarget($this));
1281  }
1282 
1288  function exportObject()
1289  {
1290  return;
1291  }
1292 
1298  function importObject()
1299  {
1300  $this->createObject();
1301  return;
1302  }
1303 
1304 
1311  function importFileObject()
1312  {
1313  global $_FILES, $rbacsystem, $ilDB, $tpl;
1314 
1315  $no_manifest = false;
1316  try
1317  {
1318  // the new import
1319  parent::importFileObject(null, false);
1320  return;
1321  }
1323  {
1324  // we just run through in this case.
1325  $no_manifest = true;
1326  }
1327 
1328  if (!$no_manifest)
1329  {
1330  return; // something different has gone wrong, but we have a manifest, this is definitely not "the old" import
1331  }
1332 
1333  // the "old" (pre 5.1) import
1334 
1335  include_once "./Modules/LearningModule/classes/class.ilObjLearningModule.php";
1336 
1337  if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $_GET["new_type"]))
1338  {
1339  $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->MESSAGE);
1340  return;
1341  }
1342  $form = $this->initImportForm();
1343  if ($form->checkInput())
1344  {
1345  // create and insert object in objecttree
1346  include_once("./Modules/LearningModule/classes/class.ilObjContentObject.php");
1347  $newObj = new ilObjContentObject();
1348  $newObj->setType($_GET["new_type"]);
1349  $newObj->setTitle($_FILES["importfile"]["name"]);
1350  $newObj->setDescription("");
1351  $newObj->create(true);
1352  $newObj->createReference();
1353  $newObj->putInTree($_GET["ref_id"]);
1354  $newObj->setPermissions($_GET["ref_id"]);
1355  $newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId());
1356 
1357  // create learning module tree
1358  $newObj->createLMTree();
1359 
1360  // since the "new" import already did the extracting
1361  $mess = $newObj->importFromDirectory($this->tmp_import_dir, $_POST["validate"]);
1362 
1363 
1364  // import lm from file
1365 // $mess = $newObj->importFromZipFile($_FILES["importfile"]["tmp_name"], $_FILES["importfile"]["name"],
1366 // $_POST["validate"]);
1367 
1368  if ($mess == "")
1369  {
1370  ilUtil::sendSuccess($this->lng->txt($this->type."_added"),true);
1371  ilUtil::redirect("ilias.php?ref_id=".$newObj->getRefId().
1372  "&baseClass=ilLMEditorGUI");
1373  }
1374  else
1375  {
1376  $link = '<a href="'."ilias.php?ref_id=".$newObj->getRefId().
1377  "&baseClass=ilLMEditorGUI".'" target="_top">'.$this->lng->txt("btn_next").'</a>';
1378  $tpl->setContent("<br />".$link."<br /><br />".$mess.$link);
1379  }
1380  }
1381  else
1382  {
1383  $form->setValuesByPost();
1384  $tpl->setContent($form->getHtml());
1385  }
1386  }
1387 
1391  function chapters()
1392  {
1393  global $tree, $lng, $ilCtrl, $ilUser;
1394 
1395  $this->setTabs();
1396  $this->setContentSubTabs("chapters");
1397 
1398  $ilCtrl->setParameter($this, "backcmd", "chapters");
1399 
1400  include_once("./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
1401  $form_gui = new ilChapterHierarchyFormGUI($this->object->getType(), $_GET["transl"]);
1402  $form_gui->setFormAction($ilCtrl->getFormAction($this));
1403  $form_gui->setTitle($this->object->getTitle());
1404  $form_gui->setIcon(ilUtil::getImagePath("icon_lm.svg"));
1405  $form_gui->setTree($this->lm_tree);
1406  $form_gui->setMaxDepth(0);
1407  $form_gui->setCurrentTopNodeId($this->tree->getRootId());
1408  $form_gui->addMultiCommand($lng->txt("delete"), "delete");
1409  $form_gui->addMultiCommand($lng->txt("cut"), "cutItems");
1410  $form_gui->addMultiCommand($lng->txt("copy"), "copyItems");
1411  if ($this->object->getLayoutPerPage())
1412  {
1413  $form_gui->addMultiCommand($lng->txt("cont_set_layout"), "setPageLayoutInHierarchy");
1414  }
1415  $form_gui->setDragIcon(ilUtil::getImagePath("icon_st.svg"));
1416  $form_gui->addCommand($lng->txt("cont_save_all_titles"), "saveAllTitles");
1417  $up_gui = ($this->object->getType() == "dbk")
1418  ? "ilobjdlbookgui"
1419  : "ilobjlearningmodulegui";
1420 
1421  $ctpl = new ilTemplate("tpl.chap_and_pages.html", true, true, "Modules/LearningModule");
1422  $ctpl->setVariable("HIERARCHY_FORM", $form_gui->getHTML());
1423  $ilCtrl->setParameter($this, "obj_id", "");
1424 
1425  $ml_head = self::getMultiLangHeader($this->object->getId(), $this);
1426 
1427  $this->tpl->setContent($ml_head.$ctpl->get());
1428  }
1429 
1436  static function getMultiLangHeader($a_lm_id, $a_gui_class)
1437  {
1438  global $lng, $ilCtrl;
1439 
1440  // multi language
1441  include_once("./Services/Object/classes/class.ilObjectTranslation.php");
1442  $ot = ilObjectTranslation::getInstance($a_lm_id);
1443  //include_once("./Services/COPage/classes/class.ilPageMultiLang.php");
1444  //$ml = new ilPageMultiLang("lm", $a_lm_id);
1445  if ($ot->getContentActivated())
1446  {
1447  $lng->loadLanguageModule("meta");
1448 
1449  // info
1450  include_once("./Services/COPage/classes/class.ilPageMultiLangGUI.php");
1451  $ml_gui = new ilPageMultiLangGUI("lm", $a_lm_id);
1452  $ml_head = $ml_gui->getMultiLangInfo($_GET["transl"]);
1453 
1454  // language switch
1455  include_once("./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
1456  $list = new ilAdvancedSelectionListGUI();
1457  $list->setListTitle($lng->txt("actions"));
1458  $list->setId("copage_act");
1459  $entries = false;
1460  if (!in_array($_GET["transl"], array("", "-")))
1461  {
1462  $l = $ot->getMasterLanguage();
1463  $list->addItem($lng->txt("cont_edit_language_version").": ".
1464  $lng->txt("meta_l_".$l), "",
1465  $ilCtrl->getLinkTarget($a_gui_class, "editMasterLanguage"));
1466  $entries = true;
1467  }
1468 
1469  foreach ($ot->getLanguages() as $al => $lang)
1470  {
1471  if ($_GET["transl"] != $al &&
1472  $al != $ot->getMasterLanguage())
1473  {
1474  $ilCtrl->setParameter($a_gui_class, "totransl", $al);
1475  $list->addItem($lng->txt("cont_edit_language_version").": ".
1476  $lng->txt("meta_l_".$al), "",
1477  $ilCtrl->getLinkTarget($a_gui_class, "switchToLanguage"));
1478  $ilCtrl->setParameter($a_gui_class, "totransl", $_GET["totransl"]);
1479  }
1480  $entries = true;
1481  }
1482 
1483  if ($entries)
1484  {
1485  $ml_head = '<div class="ilFloatLeft">'.$ml_head.'</div><div style="margin: 5px 0;" class="small ilRight">'.$list->getHTML()."</div>";
1486  }
1487 
1488  }
1489 
1490  return $ml_head;
1491  }
1492 
1493 
1494  /*
1495  * List all pages of learning module
1496  */
1497  function pages()
1498  {
1499  global $tree, $tpl, $ilToolbar, $ilCtrl, $lng;
1500 
1501  $this->setTabs();
1502  $this->setContentSubTabs("pages");
1503 
1504  $ilCtrl->setParameter($this, "backcmd", "pages");
1505  $ilCtrl->setParameterByClass("illmpageobjectgui", "new_type", "pg");
1506  $ilToolbar->addButton($lng->txt("pg_add"),
1507  $ilCtrl->getLinkTargetByClass("illmpageobjectgui", "create"));
1508  $ilCtrl->setParameterByClass("illmpageobjectgui", "new_type", "");
1509 
1510  include_once("./Modules/LearningModule/classes/class.ilLMPagesTableGUI.php");
1511  $t = new ilLMPagesTableGUI($this, "pages", $this->object);
1512  $tpl->setContent($t->getHTML());
1513  }
1514 
1518  function listLinks()
1519  {
1520  global $tpl;
1521 
1522  $this->setTabs();
1523  $this->setContentSubTabs("internal_links");
1524 
1525  include_once("./Modules/LearningModule/classes/class.ilLinksTableGUI.php");
1526  $table_gui = new ilLinksTableGUI($this, "listLinks",
1527  $this->object->getId(), $this->object->getType());
1528 
1529  $tpl->setContent($table_gui->getHTML());
1530  }
1531 
1535  function showMaintenance()
1536  {
1537  global $tpl, $ilToolbar;
1538 
1539  $this->setTabs();
1540  $this->setContentSubTabs("maintenance");
1541 
1542  $ilToolbar->addButton($this->lng->txt("cont_fix_tree"),
1543  $this->ctrl->getLinkTarget($this, "fixTreeConfirm"));
1544  }
1545 
1549  function activatePages()
1550  {
1551  if (is_array($_POST["id"]))
1552  {
1553  foreach($_POST["id"] as $id)
1554  {
1555  include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
1556  $act = ilLMPage::_lookupActive($id, $this->object->getType());
1557  ilLMPage::_writeActive($id, $this->object->getType(), !$act);
1558  }
1559  }
1560 
1561  $this->ctrl->redirect($this, "pages");
1562  }
1563 
1567  function pastePage()
1568  {
1570  {
1571  $this->ilias->raiseError($this->lng->txt("no_page_in_clipboard"),$this->ilias->error_obj->MESSAGE);
1572  }
1573 
1574  // paste selected object
1576 
1577  // copy page, if action is copy
1578  if (ilEditClipboard::getAction() == "copy")
1579  {
1580  // check wether page belongs to lm
1582  == $this->object->getID())
1583  {
1584  $lm_page = new ilLMPageObject($this->object, $id);
1585  $new_page =& $lm_page->copy();
1586  $id = $new_page->getId();
1587  }
1588  else
1589  {
1590  // get page from other content object into current content object
1592  $lm_obj =& $this->ilias->obj_factory->getInstanceByObjId($lm_id);
1593  $lm_page = new ilLMPageObject($lm_obj, $id);
1594  $copied_nodes = array();
1595  $new_page =& $lm_page->copyToOtherContObject($this->object, $copied_nodes);
1596  $id = $new_page->getId();
1597  ilLMObject::updateInternalLinks($copied_nodes);
1598  }
1599  }
1600 
1601  // cut is not be possible in "all pages" form yet
1602  if (ilEditClipboard::getAction() == "cut")
1603  {
1604  // check wether page belongs not to lm
1606  != $this->object->getID())
1607  {
1609  $lm_obj =& $this->ilias->obj_factory->getInstanceByObjId($lm_id);
1610  $lm_page = new ilLMPageObject($lm_obj, $id);
1611  $lm_page->setLMId($this->object->getID());
1612  $lm_page->update();
1613  $page =& $lm_page->getPageObject();
1614  $page->buildDom();
1615  $page->setParentId($this->object->getID());
1616  $page->update();
1617  }
1618  }
1619 
1620 
1622  $this->ctrl->redirect($this, "pages");
1623  }
1624 
1628  function copyPage()
1629  {
1630  global $ilUser;
1631 
1632  if(!isset($_POST["id"]))
1633  {
1634  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
1635  }
1636 
1637  $items = ilUtil::stripSlashesArray($_POST["id"]);
1638  ilLMObject::clipboardCopy($this->object->getId(), $items);
1640 
1641  ilUtil::sendInfo($this->lng->txt("cont_selected_items_have_been_copied"), true);
1642 
1643  $this->ctrl->redirect($this, "pages");
1644  }
1645 
1653  function delete($a_parent_subobj_id = 0)
1654  {
1655  if(!isset($_POST["id"]))
1656  {
1657  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
1658  }
1659 
1660  if(count($_POST["id"]) == 1 && $_POST["id"][0] == IL_FIRST_NODE)
1661  {
1662  $this->ilias->raiseError($this->lng->txt("cont_select_item"), $this->ilias->error_obj->MESSAGE);
1663  }
1664 
1665  if ($a_parent_subobj_id == 0)
1666  {
1667  $this->setTabs();
1668  }
1669 
1670  if ($a_parent_subobj_id != 0)
1671  {
1672  $this->ctrl->setParameterByClass("ilStructureObjectGUI", "backcmd", $_GET["backcmd"]);
1673  $this->ctrl->setParameterByClass("ilStructureObjectGUI", "obj_id", $a_parent_subobj_id);
1674  $form_action = $this->ctrl->getFormActionByClass("ilStructureObjectGUI");
1675  }
1676  else
1677  {
1678  $this->ctrl->setParameter($this, "backcmd", $_GET["backcmd"]);
1679  $form_action = $this->ctrl->getFormAction($this);
1680  }
1681 
1682  // display confirmation message
1683  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1684  $cgui = new ilConfirmationGUI();
1685  $cgui->setFormAction($form_action);
1686  $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
1687  $cgui->setCancel($this->lng->txt("cancel"), "cancelDelete");
1688  $cgui->setConfirm($this->lng->txt("confirm"), "confirmedDelete");
1689 
1690  foreach($_POST["id"] as $id)
1691  {
1692  if ($id != IL_FIRST_NODE)
1693  {
1694  $obj = new ilLMObject($this->object, $id);
1695  $caption = ilUtil::getImageTagByType($obj->getType(), $this->tpl->tplPath).
1696  " ".$obj->getTitle();
1697 
1698  $cgui->addItem("id[]", $id, $caption);
1699  }
1700  }
1701 
1702  $this->tpl->setContent($cgui->getHTML());
1703  }
1704 
1708  function cancelDelete()
1709  {
1710  $this->ctrl->redirect($this, $_GET["backcmd"]);
1711 
1712  }
1713 
1721  function confirmedDelete($a_parent_subobj_id = 0)
1722  {
1723  $tree = new ilTree($this->object->getId());
1724  $tree->setTableNames('lm_tree','lm_data');
1725  $tree->setTreeTablePK("lm_id");
1726 
1727  // check number of objects
1728  if (!$_POST["id"])
1729  {
1730  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
1731  }
1732 
1733  // delete all selected objects
1734  foreach ($_POST["id"] as $id)
1735  {
1736  if ($id != IL_FIRST_NODE)
1737  {
1738  $obj =& ilLMObjectFactory::getInstance($this->object, $id, false);
1739  $node_data = $tree->getNodeData($id);
1740  if (is_object($obj))
1741  {
1742  $obj->setLMId($this->object->getId());
1743 
1744  include_once("./Services/History/classes/class.ilHistory.php");
1745  ilHistory::_createEntry($this->object->getId(), "delete_".$obj->getType(),
1746  array(ilLMObject::_lookupTitle($id), $id),
1747  $this->object->getType());
1748 
1749  $obj->delete();
1750  }
1751  if($tree->isInTree($id))
1752  {
1753  $tree->deleteTree($node_data);
1754  }
1755  }
1756  }
1757 
1758  // check the tree
1759  $this->object->checkTree();
1760 
1761  // feedback
1762  ilUtil::sendSuccess($this->lng->txt("info_deleted"),true);
1763 
1764  if ($a_parent_subobj_id == 0)
1765  {
1766  $this->ctrl->redirect($this, $_GET["backcmd"]);
1767  }
1768  }
1769 
1770 
1771 
1778  function getContextPath($a_endnode_id, $a_startnode_id = 1)
1779  {
1780  $path = "";
1781 
1782  $tmpPath = $this->lm_tree->getPathFull($a_endnode_id, $a_startnode_id);
1783 
1784  // count -1, to exclude the learning module itself
1785  for ($i = 1; $i < (count($tmpPath) - 1); $i++)
1786  {
1787  if ($path != "")
1788  {
1789  $path .= " > ";
1790  }
1791 
1792  $path .= $tmpPath[$i]["title"];
1793  }
1794 
1795  return $path;
1796  }
1797 
1798 
1799 
1805  function showActions($a_actions)
1806  {
1807  foreach ($a_actions as $name => $lng)
1808  {
1809  $d[$name] = array("name" => $name, "lng" => $lng);
1810  }
1811 
1812  $notoperations = array();
1813 
1814  $operations = array();
1815 
1816  if (is_array($d))
1817  {
1818  foreach ($d as $row)
1819  {
1820  if (!in_array($row["name"], $notoperations))
1821  {
1822  $operations[] = $row;
1823  }
1824  }
1825  }
1826 
1827  if (count($operations)>0)
1828  {
1829  foreach ($operations as $val)
1830  {
1831  $this->tpl->setCurrentBlock("operation_btn");
1832  $this->tpl->setVariable("BTN_NAME", $val["name"]);
1833  $this->tpl->setVariable("BTN_VALUE", $this->lng->txt($val["lng"]));
1834  $this->tpl->parseCurrentBlock();
1835  }
1836 
1837  $this->tpl->setCurrentBlock("operation");
1838  $this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.svg"));
1839  $this->tpl->parseCurrentBlock();
1840  }
1841  }
1842 
1846  function perm()
1847  {
1848  $this->setTabs();
1849 
1850  $this->setFormAction("addRole", $this->ctrl->getLinkTarget($this, "addRole"));
1851  $this->setFormAction("permSave", $this->ctrl->getLinkTarget($this, "permSave"));
1852  $this->permObject();
1853  }
1854 
1855 
1859  function permSave()
1860  {
1861  $this->setReturnLocation("permSave", $this->ctrl->getLinkTarget($this, "perm"));
1862  $this->permSaveObject();
1863  }
1864 
1868  function info()
1869  {
1870  $this->setTabs();
1871  $this->infoObject();
1872  }
1873 
1874 
1878  function addRole()
1879  {
1880  $this->setReturnLocation("addRole", $this->ctrl->getLinkTarget($this, "perm"));
1881  $this->addRoleObject();
1882  }
1883 
1884 
1888  function owner()
1889  {
1890  $this->setTabs();
1891  $this->ownerObject();
1892  }
1893 
1894 
1898  function view()
1899  {
1900  if (strtolower($_GET["baseClass"]) == "iladministrationgui")
1901  {
1902  $this->prepareOutput();
1903  parent::viewObject();
1904  }
1905  else
1906  {
1907  $this->viewObject();
1908  }
1909  }
1910 
1911 
1915  function moveChapter($a_parent_subobj_id = 0)
1916  {
1917  if(!isset($_POST["id"]))
1918  {
1919  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
1920  }
1921 //echo "Hallo::"; exit;
1922  if(count($_POST["id"]) > 1)
1923  {
1924  $this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
1925  }
1926 
1927  if(count($_POST["id"]) == 1 && $_POST["id"][0] == IL_FIRST_NODE)
1928  {
1929  $this->ilias->raiseError($this->lng->txt("cont_select_item"), $this->ilias->error_obj->MESSAGE);
1930  }
1931 
1932  // SAVE POST VALUES
1933  ilEditClipboard::storeContentObject("st", $_POST["id"][0], "move");
1934 
1935  ilUtil::sendInfo($this->lng->txt("cont_chap_select_target_now"), true);
1936 
1937  if ($a_parent_subobj_id == 0)
1938  {
1939  $this->ctrl->redirect($this, "chapters");
1940  }
1941  }
1942 
1943 
1947  function copyChapter($a_parent_subobj_id = 0)
1948  {
1949  $this->copyItems();
1950  }
1951 
1955  function pasteChapter($a_parent_subobj_id = 0)
1956  {
1957  return $this->insertChapterClip(false);
1958  }
1959 
1963  function movePage()
1964  {
1965  global $ilUser;
1966 
1967  if(!isset($_POST["id"]))
1968  {
1969  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
1970  }
1971 
1972  ilUtil::sendInfo($this->lng->txt("cont_selected_items_have_been_cut"), true);
1973 
1974  $items = ilUtil::stripSlashesArray($_POST["id"]);
1975  ilLMObject::clipboardCut($this->object->getId(), $items);
1977 
1978  $this->ctrl->redirect($this, "pages");
1979  }
1980 
1984  function cancel()
1985  {
1986  if ($_GET["new_type"] == "pg")
1987  {
1988  $this->ctrl->redirect($this, "pages");
1989  }
1990  else
1991  {
1992  $this->ctrl->redirect($this, "chapters");
1993  }
1994  }
1995 
1996 
2000  function export()
2001  {
2002  $ot = ilObjectTranslation::getInstance($this->object->getId());
2003  $opt = "";
2004  if ($ot->getContentActivated())
2005  {
2006  $format = explode("_", $_POST["format"]);
2007  $opt = ilUtil::stripSlashes($format[1]);
2008  }
2009 
2010 
2011  require_once("./Modules/LearningModule/classes/class.ilContObjectExport.php");
2012  $cont_exp = new ilContObjectExport($this->object);
2013  $cont_exp->buildExportFile(($opt == "master"));
2014 // $this->ctrl->redirect($this, "exportList");
2015  }
2016 
2020  function getPublicAccessColValue($a_type, $a_file)
2021  {
2022  global $lng, $ilCtrl;
2023 
2024  $changelink = "<a href='".$ilCtrl->getLinkTarget($this, "editMenuProperties")."'>".$lng->txt("change")."</a>";
2025  if (!$this->object->isActiveLMMenu())
2026  {
2027  $add = "<br />".$lng->txt("cont_download_no_menu")." ".$changelink;
2028  }
2029  else if (!$this->object->isActiveDownloads())
2030  {
2031  $add = "<br />".$lng->txt("cont_download_no_download")." ".$changelink;
2032  }
2033 
2034 
2035  if ($this->object->getPublicExportFile($a_type) == $a_file)
2036  {
2037  return $lng->txt("yes").$add;
2038  }
2039 
2040  return " ";
2041  }
2042 
2043 
2044 
2048  function publishExportFile($a_files)
2049  {
2050  global $ilCtrl;
2051 
2052  if(!isset($a_files))
2053  {
2054  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
2055  }
2056  else
2057  {
2058  foreach ($a_files as $f)
2059  {
2060  $file = explode(":", $f);
2061  $export_dir = $this->object->getExportDirectory($file[0]);
2062 
2063  if ($this->object->getPublicExportFile($file[0]) ==
2064  $file[1])
2065  {
2066  $this->object->setPublicExportFile($file[0], "");
2067  }
2068  else
2069  {
2070  $this->object->setPublicExportFile($file[0], $file[1]);
2071  }
2072  }
2073  $this->object->update();
2074  }
2075  $ilCtrl->redirectByClass("ilexportgui");
2076  }
2077 
2081  function downloadPDFFile()
2082  {
2083  if(!isset($_POST["file"]))
2084  {
2085  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
2086  }
2087 
2088  if (count($_POST["file"]) > 1)
2089  {
2090  $this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
2091  }
2092 
2093 
2094  $export_dir = $this->object->getOfflineDirectory();
2095 
2096  $file = basename($_POST["file"][0]);
2097 
2098  ilUtil::deliverFile($export_dir."/".$file, $file);
2099  }
2100 
2101 
2106  function fixTreeConfirm()
2107  {
2108  $this->setTabs();
2109  $this->setContentSubTabs("maintenance");
2110 
2111  // display confirmation message
2112  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
2113  $cgui = new ilConfirmationGUI();
2114  $cgui->setFormAction($this->ctrl->getFormAction($this));
2115  $cgui->setHeaderText($this->lng->txt("cont_fix_tree_confirm"));
2116  $cgui->setCancel($this->lng->txt("cancel"), "showMaintenance");
2117  $cgui->setConfirm($this->lng->txt("cont_fix_tree"), "fixTree");
2118 
2119  $this->tpl->setContent($cgui->getHTML());
2120  }
2121 
2125  function fixTree()
2126  {
2127  $this->object->fixTree();
2128  ilUtil::sendSuccess($this->lng->txt("cont_tree_fixed"), true);
2129  $this->ctrl->redirect($this, "showMaintenance");
2130  }
2131 
2135  function setilLMMenu($a_offline = false, $a_export_format = "",
2136  $a_active = "content", $a_use_global_tabs = false, $a_as_subtabs = false,
2137  $a_cur_page = 0)
2138  {
2139  global $ilCtrl,$ilUser, $ilAccess, $ilTabs, $rbacsystem, $ilPluginAdmin, $ilHelp;
2140 
2141  $ilHelp->setScreenIdComponent("lm");
2142 
2143  if ($a_as_subtabs)
2144  {
2145  $addcmd = "addSubTabTarget";
2146  $getcmd = "getSubTabHTML";
2147  }
2148  else
2149  {
2150  $addcmd = "addTarget";
2151  $getcmd = "getHTML";
2152  }
2153 
2154  $active[$a_active] = true;
2155 
2156  if (!$this->object->isActiveLMMenu())
2157  {
2158  return "";
2159  }
2160 
2161  if ($a_use_global_tabs)
2162  {
2163  $tabs_gui = $ilTabs;
2164  }
2165  else
2166  {
2167  $tabs_gui = new ilTabsGUI();
2168  }
2169 
2170  // Determine whether the view of a learning resource should
2171  // be shown in the frameset of ilias, or in a separate window.
2172  //$showViewInFrameset = $this->ilias->ini->readVariable("layout","view_target") == "frame";
2173  $showViewInFrameset = true;
2174 
2175  if ($showViewInFrameset && !$a_offline)
2176  {
2177  $buttonTarget = ilFrameTargetInfo::_getFrame("MainContent");
2178  }
2179  else
2180  {
2181  $buttonTarget = "_top";
2182  }
2183 
2184  if ($a_export_format == "scorm")
2185  {
2186  $buttonTarget = "";
2187  }
2188 
2189  include_once("./Services/Payment/classes/class.ilPaymentObject.php");
2190  $requires_purchase_to_access = ilPaymentObject::_requiresPurchaseToAccess((int)$_GET['ref_id']);
2191 
2192  // content
2193  if (!$a_offline && $ilAccess->checkAccess("read", "", $_GET["ref_id"]))
2194  {
2195  $ilCtrl->setParameterByClass("illmpresentationgui", "obj_id", $_GET["obj_id"]);
2196  $tabs_gui->$addcmd("content",
2197  $ilCtrl->getLinkTargetByClass("illmpresentationgui", "layout"),
2198  "", "", $buttonTarget, $active["content"]);
2199  if ($active["content"])
2200  {
2201  $ilHelp->setScreenId("content");
2202  $ilHelp->setSubScreenId("content");
2203  }
2204  }
2205 
2206  // table of contents
2207  if (!$requires_purchase_to_access && $this->object->isActiveTOC() && $ilAccess->checkAccess("read", "", $_GET["ref_id"]))
2208  {
2209  if (!$a_offline)
2210  {
2211  $ilCtrl->setParameterByClass("illmpresentationgui", "obj_id", $_GET["obj_id"]);
2212  $link = $ilCtrl->getLinkTargetByClass("illmpresentationgui", "showTableOfContents");
2213  }
2214  else
2215  {
2216  $link = "./table_of_contents.html";
2217  }
2218 
2219  $tabs_gui->$addcmd("cont_toc", $link,
2220  "", "", $buttonTarget, $active["toc"]);
2221  }
2222 
2223  // print view
2224  if (!$requires_purchase_to_access && $this->object->isActivePrintView() && $ilAccess->checkAccess("read", "", $_GET["ref_id"]))
2225  {
2226  if (!$a_offline) // has to be implemented for offline mode
2227  {
2228  $ilCtrl->setParameterByClass("illmpresentationgui", "obj_id", $_GET["obj_id"]);
2229  $link = $ilCtrl->getLinkTargetByClass("illmpresentationgui", "showPrintViewSelection");
2230  $tabs_gui->$addcmd("cont_print_view", $link,
2231  "", "", $buttonTarget, $active["print"]);
2232  }
2233  }
2234 
2235  // download
2236  if (!$requires_purchase_to_access && $ilUser->getId() == ANONYMOUS_USER_ID)
2237  {
2238  $is_public = $this->object->isActiveDownloadsPublic();
2239  }
2240  else if(!$requires_purchase_to_access)
2241  {
2242  $is_public = true;
2243  }
2244 
2245  if (!$requires_purchase_to_access && $this->object->isActiveDownloads() && !$a_offline && $is_public &&
2246  $ilAccess->checkAccess("read", "", $_GET["ref_id"]))
2247  {
2248  $ilCtrl->setParameterByClass("illmpresentationgui", "obj_id", $_GET["obj_id"]);
2249  $link = $ilCtrl->getLinkTargetByClass("illmpresentationgui", "showDownloadList");
2250  $tabs_gui->$addcmd("download", $link,
2251  "", "", $buttonTarget, $active["download"]);
2252  }
2253 
2254  // info button
2255  if ($a_export_format != "scorm" && !$a_offline)
2256  {
2257  if (!$a_offline)
2258  {
2259  $ilCtrl->setParameterByClass("illmpresentationgui", "obj_id", $_GET["obj_id"]);
2260  $link = $this->ctrl->getLinkTargetByClass(
2261  array("illmpresentationgui", "ilinfoscreengui"), "showSummary");
2262  }
2263  else
2264  {
2265  $link = "./info.html";
2266  }
2267 
2268  $tabs_gui->$addcmd(($requires_purchase_to_access ? 'buy' : 'info_short'), $link,
2269  "", "", $buttonTarget, $active["info"]);
2270  }
2271 
2272  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
2273  if(!$a_offline &&
2274  $ilAccess->checkAccess("read", "", $_GET["ref_id"]) && // #14075
2275  ilLearningProgressAccess::checkAccess($_GET["ref_id"]))
2276  {
2277  include_once './Services/Object/classes/class.ilObjectLP.php';
2278  $olp = ilObjectLP::getInstance($this->object->getId());
2279  if($olp->getCurrentMode() == ilLPObjSettings::LP_MODE_COLLECTION_MANUAL)
2280  {
2281  $tabs_gui->$addcmd("learning_progress",
2282  $this->ctrl->getLinkTargetByClass(array("illmpresentationgui", "illearningprogressgui"), "editmanual"),
2283  "", "", $buttonTarget, $active["learning_progress"]);
2284  }
2285  else if($olp->getCurrentMode() == ilLPObjSettings::LP_MODE_COLLECTION_TLT)
2286  {
2287  $tabs_gui->$addcmd("learning_progress",
2288  $this->ctrl->getLinkTargetByClass(array("illmpresentationgui", "illearningprogressgui"), "showtlt"),
2289  "", "", $buttonTarget, $active["learning_progress"]);
2290  }
2291  }
2292 
2293  // edit learning module
2294  if (!$a_offline && $a_cur_page > 0)
2295  {
2296  if ($rbacsystem->checkAccess("write", $_GET["ref_id"]))
2297  {
2298  //$page_id = $this->getCurrentPageId();
2299  $page_id = $a_cur_page;
2300  $tabs_gui->$addcmd("edit_page", ILIAS_HTTP_PATH."/ilias.php?baseClass=ilLMEditorGUI&ref_id=".$_GET["ref_id"].
2301  "&obj_id=".$page_id."&to_page=1",
2302  "", "", $buttonTarget, $active["edit_page"]);
2303  }
2304  }
2305 
2306  if(!$requires_purchase_to_access)
2307  {
2308  // get user defined menu entries
2309  $this->__initLMMenuEditor();
2310  $entries = $this->lmme_obj->getMenuEntries(true);
2311 
2312  if (count($entries) > 0 && $ilAccess->checkAccess("read", "", $_GET["ref_id"]))
2313  {
2314  foreach ($entries as $entry)
2315  {
2316  // build goto-link for internal resources
2317  if ($entry["type"] == "intern")
2318  {
2319  $entry["link"] = ILIAS_HTTP_PATH."/goto.php?target=".$entry["link"];
2320  }
2321 
2322  // add http:// prefix if not exist
2323  if (!strstr($entry["link"],'://') && !strstr($entry["link"],'mailto:'))
2324  {
2325  $entry["link"] = "http://".$entry["link"];
2326  }
2327 
2328  if (!strstr($entry["link"],'mailto:'))
2329  {
2330  $entry["link"] = ilUtil::appendUrlParameterString($entry["link"], "ref_id=".$this->ref_id."&structure_id=".$this->obj_id);
2331  }
2332  $tabs_gui->$addcmd($entry["title"],
2333  $entry["link"],
2334  "", "", "_blank", "", true);
2335  }
2336  }
2337  }
2338 
2339  // user interface hook [uihk]
2340  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
2341  $plugin_html = false;
2342  foreach ($pl_names as $pl)
2343  {
2344  $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
2345  $gui_class = $ui_plugin->getUIClassInstance();
2346  $resp = $gui_class->modifyGUI("Modules/LearningModule", "lm_menu_tabs",
2347  array("lm_menu_tabs" => $tabs_gui));
2348  }
2349 
2350 
2351  return $tabs_gui->$getcmd();
2352  }
2353 
2357  function createPDF()
2358  {
2359  require_once("./Modules/LearningModule/classes/class.ilContObjectExport.php");
2360  $cont_exp = new ilContObjectExport($this->object, "pdf");
2361  $cont_exp->buildExportFile();
2362  $this->offlineList();
2363  }
2364 
2368  function exportHTML()
2369  {
2370  include_once("./Services/Object/classes/class.ilObjectTranslation.php");
2371  $ot = ilObjectTranslation::getInstance($this->object->getId());
2372  $lang = "";
2373  if ($ot->getContentActivated())
2374  {
2375  $format = explode("_", $_POST["format"]);
2376  $lang = ilUtil::stripSlashes($format[1]);
2377  }
2378  require_once("./Modules/LearningModule/classes/class.ilContObjectExport.php");
2379  $cont_exp = new ilContObjectExport($this->object, "html", $lang);
2380  $cont_exp->buildExportFile();
2381 //echo $this->tpl->get();
2382 // $this->ctrl->redirect($this, "exportList");
2383  }
2384 
2388  function exportSCORM()
2389  {
2390  require_once("./Modules/LearningModule/classes/class.ilContObjectExport.php");
2391  $cont_exp = new ilContObjectExport($this->object, "scorm");
2392  $cont_exp->buildExportFile();
2393 //echo $this->tpl->get();
2394 // $this->ctrl->redirect($this, "exportList");
2395  }
2396 
2402  function addLocations($a_omit_obj_id = false)
2403  {
2404  global $lng, $tree, $ilLocator, $ilCtrl;
2405 
2406  $par_id = $tree->getParentId($_GET["ref_id"]);
2407  $parent_title = ilObject::_lookupTitle(ilObject::_lookupObjId($par_id));
2408 
2409  // parent is not root folder, "shorten" locator
2410  if($par_id != ROOT_FOLDER_ID)
2411  {
2412  $this->ctrl->addLocation("...",
2413  "");
2414  }
2415  else
2416  {
2417  // if parent is root folder and has no custom title
2418  // we adapt it [see $ilLocator->addRepositoryItems()]
2419  if ($parent_title == "ILIAS")
2420  {
2421  $parent_title = $lng->txt("repository");
2422  }
2423  }
2424 
2425  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $par_id);
2426  $this->ctrl->addLocation($parent_title,
2427  $ilCtrl->getLinkTargetByClass("ilrepositorygui", "frameset"),
2428  ilFrameTargetInfo::_getFrame("MainContent"), $par_id);
2429  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
2430 
2431  if (!$a_omit_obj_id)
2432  {
2433  $obj_id = $_GET["obj_id"];
2434  }
2435  $lmtree =& $this->object->getTree();
2436 
2437  if (($obj_id != 0) && $lmtree->isInTree($obj_id))
2438  {
2439  $path = $lmtree->getPathFull($obj_id);
2440  }
2441  else
2442  {
2443  $path = $lmtree->getPathFull($lmtree->getRootId());
2444  if ($obj_id != 0)
2445  {
2446  $path[] = array("type" => "pg", "child" => $this->obj_id,
2447  "title" => ilLMPageObject::_getPresentationTitle($this->obj_id));
2448  }
2449  }
2450 
2451  $modifier = 1;
2452 
2453  foreach ($path as $key => $row)
2454  {
2455  if ($row["child"] == 1)
2456  {
2457  $this->ctrl->setParameter($this, "obj_id", "");
2458  $this->ctrl->addLocation(
2459  $this->object->getTitle(),
2460  $this->ctrl->getLinkTarget($this, "chapters"), "", $_GET["ref_id"]);
2461  }
2462  else
2463  {
2464  $title = $row["title"];
2465  switch($row["type"])
2466  {
2467  case "st":
2468  $this->ctrl->setParameterByClass("ilstructureobjectgui", "obj_id", $row["child"]);
2469  $this->ctrl->addLocation(
2470  $title,
2471  $this->ctrl->getLinkTargetByClass("ilstructureobjectgui", "view"));
2472  break;
2473 
2474  case "pg":
2475  $this->ctrl->setParameterByClass("illmpageobjectgui", "obj_id", $row["child"]);
2476  $this->ctrl->addLocation(
2477  $title,
2478  $this->ctrl->getLinkTargetByClass("illmpageobjectgui", "edit"));
2479  break;
2480  }
2481  }
2482  }
2483  if (!$a_omit_obj_id)
2484  {
2485  $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
2486  }
2487  }
2488 
2492 
2493 
2497  function listQuestions()
2498  {
2499  global $tpl;
2500 
2501  $this->setTabs("questions");
2502  $this->setQuestionsSubTabs("question_stats");
2503 
2504  include_once("./Modules/LearningModule/classes/class.ilLMQuestionListTableGUI.php");
2505  $table = new ilLMQuestionListTableGUI($this, "listQuestions", $this->object);
2506  $tpl->setContent($table->getHTML());
2507 
2508  }
2509 
2513  function listBlockedUsers()
2514  {
2515  global $tpl;
2516 
2517  $this->setTabs("questions");
2518  $this->setQuestionsSubTabs("blocked_users");
2519 
2520  include_once("./Modules/LearningModule/classes/class.ilLMBlockedUsersTableGUI.php");
2521  $table = new ilLMBlockedUsersTableGUI($this, "listBlockedUsers", $this->object);
2522  $tpl->setContent($table->getHTML());
2523 
2524  }
2525 
2530  {
2531  global $lng, $ilCtrl;
2532 
2533  include_once("./Services/COPage/classes/class.ilPageQuestionProcessor.php");
2534  if (is_array($_POST["userquest_id"]))
2535  {
2536  foreach ($_POST["userquest_id"] as $uqid)
2537  {
2538  $uqid = explode(":", $uqid);
2539  ilPageQuestionProcessor::resetTries((int) $uqid[0], (int) $uqid[1]);
2540  }
2541  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2542  }
2543  $ilCtrl->redirect($this, "listBlockedUsers");
2544  }
2545 
2549  function unlockQuestion()
2550  {
2551  global $lng, $ilCtrl;
2552 
2553  include_once("./Services/COPage/classes/class.ilPageQuestionProcessor.php");
2554  if (is_array($_POST["userquest_id"]))
2555  {
2556  foreach ($_POST["userquest_id"] as $uqid)
2557  {
2558  $uqid = explode(":", $uqid);
2559  ilPageQuestionProcessor::unlock((int) $uqid[0], (int) $uqid[1]);
2560  }
2561  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2562  }
2563  $ilCtrl->redirect($this, "listBlockedUsers");
2564  }
2565 
2570  {
2571  global $ilCtrl;
2572 
2573  if (!is_array($_POST["userquest_id"]))
2574  {
2575  ilUtil::sendFailure($this->lng->txt("no_checkbox"), 1);
2576  $ilCtrl->redirect($this, "listBlockedUsers");
2577  }
2578 
2579  $rcps = array();
2580  foreach($_POST["userquest_id"] as $uqid)
2581  {
2582  $uqid = explode(":", $uqid);
2583  $login = ilObjUser::_lookupLogin($uqid[1]);
2584  if (!in_array($login, $rcps))
2585  {
2586  $rcps[] = $login;
2587  }
2588  }
2589  require_once 'Services/Mail/classes/class.ilMailFormCall.php';
2590  ilUtil::redirect(ilMailFormCall::getRedirectTarget($this, 'listBlockedUsers',
2591  array(),
2592  array(
2593  'type' => 'new',
2594  'rcp_to' => implode(',',$rcps),
2595  'sig' => $this->getBlockedUsersMailSignature()
2596  )));
2597  }
2598 
2602  protected function getBlockedUsersMailSignature()
2603  {
2604  $link = chr(13).chr(10).chr(13).chr(10);
2605  $link .= $this->lng->txt('cont_blocked_users_mail_link');
2606  $link .= chr(13).chr(10).chr(13).chr(10);
2607  include_once './Services/Link/classes/class.ilLink.php';
2608  $link .= ilLink::_getLink($this->object->getRefId());
2609  return rawurlencode(base64_encode($link));
2610  }
2611 
2612 
2616 
2617 
2621  function setTabs($a_act = "")
2622  {
2623  global $lng, $ilHelp;
2624 
2625  $ilHelp->setScreenIdComponent("lm");
2626 
2627  $this->addTabs($a_act);
2628  parent::setTitleAndDescription();
2629  $this->tpl->setTitle($this->object->getTitle());
2630  $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"),
2631  $lng->txt("obj_lm"));
2632  }
2633 
2639  function setContentSubTabs($a_active)
2640  {
2641  global $ilTabs, $lng, $ilCtrl;
2642 
2643  $lm_set = new ilSetting("lm");
2644 
2645  // chapters
2646  $ilTabs->addSubtab("chapters",
2647  $lng->txt("cont_chapters"),
2648  $ilCtrl->getLinkTarget($this, "chapters"));
2649 
2650  // all pages
2651  $ilTabs->addSubtab("pages",
2652  $lng->txt("cont_all_pages"),
2653  $ilCtrl->getLinkTarget($this, "pages"));
2654 
2655  // export ids
2656  if ($lm_set->get("html_export_ids"))
2657  {
2658  if (!ilObjContentObject::isOnlineHelpModule($this->object->getRefId()))
2659  {
2660  $ilTabs->addSubtab("export_ids",
2661  $lng->txt("cont_html_export_ids"),
2662  $ilCtrl->getLinkTarget($this, "showExportIDsOverview"));
2663  }
2664  }
2665  if (ilObjContentObject::isOnlineHelpModule($this->object->getRefId()))
2666  {
2667  $lng->loadLanguageModule("help");
2668  $ilTabs->addSubtab("export_ids",
2669  $lng->txt("cont_online_help_ids"),
2670  $ilCtrl->getLinkTarget($this, "showExportIDsOverview"));
2671 
2672  $ilTabs->addSubtab("help_tooltips",
2673  $lng->txt("help_tooltips"),
2674  $ilCtrl->getLinkTarget($this, "showTooltipList"));
2675  }
2676 
2677  // list links
2678  $ilTabs->addSubtab("internal_links",
2679  $lng->txt("cont_internal_links"),
2680  $ilCtrl->getLinkTarget($this, "listLinks"));
2681 
2682  // web link checker
2683  if ($this->object->getType() == "lm")
2684  {
2685  if(@include_once('HTTP/Request.php'))
2686  {
2687  $ilTabs->addSubtab("link_check",
2688  $lng->txt("link_check"),
2689  $ilCtrl->getLinkTarget($this, "linkChecker"));
2690  }
2691  }
2692 
2693  $ilTabs->addSubtab("history",
2694  $lng->txt("history"),
2695  $this->ctrl->getLinkTarget($this, "history"));
2696 
2697  // maintenance
2698  $ilTabs->addSubtab("maintenance",
2699  $lng->txt("cont_maintenance"),
2700  $ilCtrl->getLinkTarget($this, "showMaintenance"));
2701 
2702  // srt files
2703  $ilTabs->addSubtab("srt_files",
2704  $lng->txt("cont_subtitle_files"),
2705  $ilCtrl->getLinkTargetByClass("illmmultisrtuploadgui", ""));
2706 
2707  // srt files
2708  $ilTabs->addSubtab("import",
2709  $lng->txt("cont_import"),
2710  $ilCtrl->getLinkTargetByClass("illmimportgui", ""));
2711 
2712  $ilTabs->activateSubTab($a_active);
2713  $ilTabs->activateTab("content");
2714  }
2715 
2721  function setQuestionsSubTabs($a_active)
2722  {
2723  global $ilTabs, $lng, $ilCtrl;
2724 
2725  // chapters
2726  $ilTabs->addSubtab("question_stats",
2727  $lng->txt("cont_question_stats"),
2728  $ilCtrl->getLinkTarget($this, "listQuestions"));
2729 
2730  // blocked users
2731  $ilTabs->addSubtab("blocked_users",
2732  $lng->txt("cont_blocked_users"),
2733  $ilCtrl->getLinkTarget($this, "listBlockedUsers"));
2734 
2735  $ilTabs->activateSubTab($a_active);
2736  }
2737 
2741  function addTabs($a_act = "")
2742  {
2743  global $rbacsystem, $ilUser, $ilTabs, $lng;
2744 
2745  $tabs_gui = $ilTabs;
2746 
2747  // content
2748  $ilTabs->addTab("content",
2749  $lng->txt("content"),
2750  $this->ctrl->getLinkTarget($this, "chapters"));
2751 
2752  // info
2753  $ilTabs->addTab("info",
2754  $lng->txt("info_short"),
2755  $this->ctrl->getLinkTargetByClass("ilinfoscreengui",'showSummary'));
2756 
2757  // settings
2758  $ilTabs->addTab("settings",
2759  $lng->txt("settings"),
2760  $this->ctrl->getLinkTarget($this,'properties'));
2761 
2762  // questions
2763  $ilTabs->addTab("questions",
2764  $lng->txt("objs_qst"),
2765  $this->ctrl->getLinkTarget($this, "listQuestions"));
2766 
2767  // learning progress
2768  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
2769  if(ilLearningProgressAccess::checkAccess($this->object->getRefId()) and ($this->object->getType() == 'lm' or $this->object->getType() == 'dbk'))
2770  {
2771  $ilTabs->addTab('learning_progress',
2772  $lng->txt("learning_progress"),
2773  $this->ctrl->getLinkTargetByClass(array('illearningprogressgui'),''));
2774  }
2775 
2776  if ($this->object->getType() != "lm")
2777  {
2778  // bibliographical data
2779  $ilTabs->addTab("bib_data",
2780  $lng->txt("bib_data"),
2781  $this->ctrl->getLinkTarget($this, "editBibItem"));
2782  }
2783 
2784  // meta data
2785  include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
2786  $mdgui = new ilObjectMetaDataGUI($this->object);
2787  $mdtab = $mdgui->getTab();
2788  if($mdtab)
2789  {
2790  $ilTabs->addTab("meta",
2791  $lng->txt("meta_data"),
2792  $mdtab);
2793  }
2794 
2795  if ($this->object->getType() == "lm")
2796  {
2797  // export
2798  $ilTabs->addTab("export",
2799  $lng->txt("export"),
2800  $this->ctrl->getLinkTargetByClass("ilexportgui", ""));
2801  }
2802 
2803  // permissions
2804  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
2805  {
2806  $ilTabs->addTab("perm",
2807  $lng->txt("perm_settings"),
2808  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"));
2809  }
2810 
2811  if ($a_act != "")
2812  {
2813  $ilTabs->activateTab($a_act);
2814  }
2815 
2816  // presentation view
2817  $ilTabs->addNonTabbedLink("pres_mode", $lng->txt("cont_presentation_view"),
2818  "ilias.php?baseClass=ilLMPresentationGUI&ref_id=".$this->object->getRefID(), "_top");
2819  }
2820 
2824  function setSubTabs($a_active)
2825  {
2826  global $ilTabs, $ilSetting;
2827 
2828  if (in_array($a_active,
2829  array("settings", "cont_style", "cont_lm_menu", "public_section",
2830  "cont_glossaries", "cont_multilinguality", "obj_multilinguality")))
2831  {
2832  // general properties
2833  $ilTabs->addSubTabTarget("settings",
2834  $this->ctrl->getLinkTarget($this, 'properties'),
2835  "", "");
2836 
2837  // style properties
2838  $ilTabs->addSubTabTarget("cont_style",
2839  $this->ctrl->getLinkTarget($this, 'editStyleProperties'),
2840  "", "");
2841 
2842  // menu properties
2843  $ilTabs->addSubTabTarget("cont_lm_menu",
2844  $this->ctrl->getLinkTarget($this, 'editMenuProperties'),
2845  "", "");
2846 
2847  // glossaries
2848  $ilTabs->addSubTabTarget("cont_glossaries",
2849  $this->ctrl->getLinkTarget($this, 'editGlossaries'),
2850  "", "");
2851 
2852  if ($ilSetting->get("pub_section"))
2853  {
2854  if ($this->object->getType() != "dbk")
2855  {
2856  // public section
2857  $ilTabs->addSubTabTarget("public_section",
2858  $this->ctrl->getLinkTarget($this, 'editPublicSection'),
2859  "", "");
2860  }
2861  }
2862 
2863  // multilinguality
2864  /* $ilTabs->addSubTabTarget("cont_multilinguality",
2865  $this->ctrl->getLinkTargetByClass("ilPageMultiLangGUI", ''),
2866  "", "");*/
2867 
2868  $ilTabs->addSubTabTarget("obj_multilinguality",
2869  $this->ctrl->getLinkTargetByClass("ilobjecttranslationgui", ""));
2870 
2871  $ilTabs->setSubTabActive($a_active);
2872  }
2873  }
2874 
2876  {
2877  global $ilTabs, $ilToolbar, $ilAccess;
2878 
2879 
2880  if (!$ilAccess->checkAccessOfUser(ANONYMOUS_USER_ID, "read", "", $this->object->getRefId()))
2881  {
2882  ilUtil::sendInfo($this->lng->txt("cont_anonymous_user_missing_perm"));
2883  }
2884 
2885  $this->setTabs();
2886  $this->setSubTabs("public_section");
2887  $ilTabs->setTabActive("settings");
2888 
2889  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.lm_public_selector.html",
2890  "Modules/LearningModule");
2891 
2892  // get learning module object
2893  $this->lm_obj = new ilObjLearningModule($this->ref_id, true);
2894 
2895 
2896  // public mode
2897  $modes = array("complete" => $this->lng->txt("all_pages"), "selected" => $this->lng->txt("selected_pages_only"));
2898  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
2899  $si = new ilSelectInputGUI($this->lng->txt("choose_public_mode"), "lm_public_mode");
2900  $si->setOptions($modes);
2901  $si->setValue($this->object->getPublicAccessMode());
2902  $ilToolbar->addInputItem($si, true);
2903  $ilToolbar->addFormButton($this->lng->txt("save"), "savePublicSectionAccess");
2904  $ilToolbar->setFormAction($this->ctrl->getFormAction($this,"savePublicSectionAccess"));
2905 
2906  if ($this->object->getPublicAccessMode() == "selected")
2907  {
2908  $this->tpl->setCurrentBlock("select_pages");
2909  $this->tpl->setVariable("FORMACTION", $this->ctrl->getLinkTarget($this, "savePublicSectionPages"));
2910 
2911  include_once ("./Modules/LearningModule/classes/class.ilPublicSectionExplorerGUI.php");
2912  $tree = new ilPublicSectionExplorerGUI($this,"editPublicSection", $this->lm_obj);
2913  $tree->setSelectMode("pages", true);
2914  $tree->setSkipRootNode(true);
2915 
2916  $this->tpl->setVariable("EXPLORER",$tree->getHTML());
2917  $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
2918 
2919  $this->tpl->parseCurrentBlock();
2920  }
2921  }
2922 
2924  {
2925  //var_dump($_POST["lm_public_mode"]);exit;
2926  $this->object->setPublicAccessMode($_POST["lm_public_mode"]);
2927  $this->object->updateProperties();
2928  ilLMObject::_writePublicAccessStatus($_POST["pages"],$this->object->getId());
2929  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
2930  $this->ctrl->redirect($this, "editPublicSection");
2931  }
2932 
2937  {
2938  $this->object->setPublicAccessMode($_POST["lm_public_mode"]);
2939  $this->object->updateProperties();
2940  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
2941  $this->ctrl->redirect($this, "editPublicSection");
2942  }
2943 
2948  {
2949  ilLMObject::_writePublicAccessStatus($_POST["pages"],$this->object->getId());
2950  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
2951  $this->ctrl->redirect($this, "editPublicSection");
2952  }
2953 
2959  function history()
2960  {
2961  $this->setTabs("content");
2962  $this->setContentSubTabs("history");
2963 
2964  require_once("./Services/History/classes/class.ilHistoryTableGUI.php");
2965  $hist_gui =& new ilHistoryTableGUI($this,"history",
2966  $this->object->getId() ,$this->object->getType());
2967  $hist_gui->initTable();
2968  $hist_gui->setCommentVisibility($this->object->isActiveHistoryUserComments());
2969 
2970  $this->tpl->setContent($hist_gui->getHTML());
2971  }
2972 
2981  public function formatInvalidLinkArray(Array $row)
2982  {
2983  $row['title'] = ilLMPageObject::_getPresentationTitle($row['page_id'], $this->object->getPageHeader());
2984 
2985  require_once 'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
2987  $actions->setSelectionHeaderClass('small');
2988  $actions->setItemLinkClass('xsmall');
2989  $actions->setListTitle($this->lng->txt('actions'));
2990  $actions->setId($row['page_id']);
2991  $this->ctrl->setParameterByClass('ilLMPageObjectGUI', 'obj_id', $row['page_id']);
2992  $actions->addItem(
2993  $this->lng->txt('edit'),
2994  '',
2995  $this->ctrl->getLinkTargetByClass('ilLMPageObjectGUI', 'edit')
2996  );
2997  $this->ctrl->clearParametersByClass('ilLMPageObjectGUI');
2998  $row['action_html'] = $actions->getHTML();
2999 
3000  return $row;
3001  }
3002 
3003  function linkChecker()
3004  {
3005  global $ilias, $ilUser, $tpl;
3006 
3007  $this->__initLinkChecker();
3008 
3009  $this->setTabs();
3010  $this->setContentSubTabs("link_check");
3011 
3012  require_once './Services/LinkChecker/classes/class.ilLinkCheckerTableGUI.php';
3013 
3014  $toolbar = new ilToolbarGUI();
3015 
3016  // #13684
3017  include_once "Services/Cron/classes/class.ilCronManager.php";
3018  if(ilCronManager::isJobActive("lm_link_check"))
3019  {
3020  include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
3021  include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
3022 
3023  $chb = new ilCheckboxInputGUI($this->lng->txt('link_check_message_a'), 'link_check_message');
3024  $chb->setValue(1);
3025  $chb->setChecked((bool)ilLinkCheckNotify::_getNotifyStatus($ilUser->getId(),$this->object->getId()));
3026  $chb->setOptionTitle($this->lng->txt('link_check_message_b'));
3027 
3028  $toolbar->addInputItem($chb);
3029  $toolbar->addFormButton($this->lng->txt('save'), 'saveLinkCheck');
3030  $toolbar->setFormAction($this->ctrl->getLinkTarget($this, 'saveLinkCheck'));
3031  }
3032 
3033  $tgui = new ilLinkCheckerTableGUI($this, 'linkChecker');
3034  $tgui->setLinkChecker($this->link_checker_obj)
3035  ->setRowHandler($this)
3036  ->setRefreshButton($this->lng->txt('refresh'), 'refreshLinkCheck');
3037 
3038  return $tpl->setContent($tgui->prepareHTML()->getHTML().$toolbar->getHTML());
3039  }
3040 
3041  function saveLinkCheck()
3042  {
3043  global $ilDB,$ilUser;
3044 
3045  include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php';
3046 
3047  $link_check_notify =& new ilLinkCheckNotify($ilDB);
3048  $link_check_notify->setUserId($ilUser->getId());
3049  $link_check_notify->setObjId($this->object->getId());
3050 
3051  if($_POST['link_check_message'])
3052  {
3053  ilUtil::sendSuccess($this->lng->txt('link_check_message_enabled'));
3054  $link_check_notify->addNotifier();
3055  }
3056  else
3057  {
3058  ilUtil::sendSuccess($this->lng->txt('link_check_message_disabled'));
3059  $link_check_notify->deleteNotifier();
3060  }
3061  $this->linkChecker();
3062 
3063  return true;
3064  }
3065 
3066 
3067 
3068  function refreshLinkCheck()
3069  {
3070  $this->__initLinkChecker();
3071 
3072  if(!$this->link_checker_obj->checkPear())
3073  {
3074  ilUtil::sendFailure($this->lng->txt('missing_pear_library'));
3075  $this->linkChecker();
3076 
3077  return false;
3078  }
3079 
3080  $this->link_checker_obj->checkLinks();
3081  ilUtil::sendSuccess($this->lng->txt('link_checker_refreshed'));
3082 
3083  $this->linkChecker();
3084 
3085  return true;
3086  }
3087 
3089  {
3090  global $ilDB;
3091 
3092  include_once './Services/LinkChecker/classes/class.ilLinkChecker.php';
3093 
3094  $this->link_checker_obj =& new ilLinkChecker($ilDB,false);
3095  $this->link_checker_obj->setObjId($this->object->getId());
3096 
3097  return true;
3098  }
3099 
3101  {
3102  include_once './Modules/LearningModule/classes/class.ilLMMenuEditor.php';
3103 
3104  $this->lmme_obj =& new ilLMMenuEditor();
3105  $this->lmme_obj->setObjId($this->object->getId());
3106 
3107  return true;
3108  }
3109 
3113  function addMenuEntry()
3114  {
3115  global $ilTabs, $ilToolbar, $tpl, $ilCtrl;
3116 
3117  $this->setTabs();
3118 
3119  $ilTabs->setTabActive("settings");
3120  $this->setSubTabs("cont_lm_menu");
3121 
3122  $ilToolbar->addButton($this->lng->txt("lm_menu_select_internal_object"),
3123  $ilCtrl->getLinkTarget($this, "showEntrySelector"));
3124 
3125  $form = $this->initMenuEntryForm("create");
3126  $this->tpl->setContent($form->getHTML());
3127  }
3128 
3134  public function initMenuEntryForm($a_mode = "edit")
3135  {
3136  global $lng, $ilCtrl;
3137 
3138  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
3139  $form = new ilPropertyFormGUI();
3140 
3141  // title
3142  $ti = new ilTextInputGUI($this->lng->txt("lm_menu_entry_title"), "title");
3143  $ti->setMaxLength(255);
3144  $ti->setSize(40);
3145  $form->addItem($ti);
3146 
3147  // target
3148  $ta = new ilTextInputGUI($this->lng->txt("lm_menu_entry_target"), "target");
3149  $ta->setMaxLength(255);
3150  $ta->setSize(40);
3151  $form->addItem($ta);
3152 
3153  if ($a_mode == "edit")
3154  {
3155  $this->__initLMMenuEditor();
3156  $this->lmme_obj->readEntry($_REQUEST["menu_entry"]);
3157  $ti->setValue($this->lmme_obj->getTitle());
3158  $ta->setValue($this->lmme_obj->getTarget());
3159  }
3160 
3161  if (isset($_GET["link_ref_id"]))
3162  {
3163  $link_ref_id = (int) $_GET["link_ref_id"];
3164  $obj_type = ilObject::_lookupType($link_ref_id,true);
3165  $obj_id = ilObject::_lookupObjectId($link_ref_id);
3166  $title = ilObject::_lookupTitle($obj_id);
3167 
3168  $target_link = $obj_type."_".$link_ref_id;
3169  $ti->setValue($title);
3170  $ta->setValue($target_link);
3171 
3172  // link ref id
3173  $hi = new ilHiddenInputGUI("link_ref_id");
3174  $hi->setValue($link_ref_id);
3175  $form->addItem($hi);
3176  }
3177 
3178 
3179  // save and cancel commands
3180  if ($a_mode == "create")
3181  {
3182  $form->addCommandButton("saveMenuEntry", $lng->txt("save"));
3183  $form->addCommandButton("editMenuProperties", $lng->txt("cancel"));
3184  $form->setTitle($lng->txt("lm_menu_new_entry"));
3185  }
3186  else
3187  {
3188  $form->addCommandButton("updateMenuEntry", $lng->txt("save"));
3189  $form->addCommandButton("editMenuProperties", $lng->txt("cancel"));
3190  $form->setTitle($lng->txt("lm_menu_edit_entry"));
3191  }
3192 
3193  $form->setFormAction($ilCtrl->getFormAction($this));
3194 
3195  return $form;
3196  }
3197 
3201  function saveMenuEntry()
3202  {
3203  global $ilCtrl;
3204 
3205  // check title and target
3206  if (empty($_POST["title"]))
3207  {
3208  //$this->ilias->raiseError($this->lng->txt("please_enter_title"),$this->ilias->error_obj->MESSAGE);
3209  ilUtil::sendFailure($this->lng->txt("please_enter_title") , true);
3210  $ilCtrl->redirect($this, "addMenuEntry");
3211  }
3212  if (empty($_POST["target"]))
3213  {
3214  //$this->ilias->raiseError($this->lng->txt("please_enter_target"),$this->ilias->error_obj->MESSAGE);
3215  ilUtil::sendFailure($this->lng->txt("please_enter_target"), true);
3216  $ilCtrl->redirect($this, "addMenuEntry");
3217  }
3218 
3219  $this->__initLMMenuEditor();
3220  $this->lmme_obj->setTitle($_POST["title"]);
3221  $this->lmme_obj->setTarget($_POST["target"]);
3222  $this->lmme_obj->setLinkRefId($_POST["link_ref_id"]);
3223 
3224  if ($_POST["link_ref_id"])
3225  {
3226  $this->lmme_obj->setLinkType("intern");
3227  }
3228 
3229  $this->lmme_obj->create();
3230 
3231  ilUtil::sendSuccess($this->lng->txt("msg_entry_added"), true);
3232  $this->ctrl->redirect($this, "editMenuProperties");
3233  }
3234 
3238  function deleteMenuEntry()
3239  {
3240  if (empty($_GET["menu_entry"]))
3241  {
3242  $this->ilias->raiseError($this->lng->txt("no_menu_entry_id"),$this->ilias->error_obj->MESSAGE);
3243  }
3244 
3245  $this->__initLMMenuEditor();
3246  $this->lmme_obj->delete($_GET["menu_entry"]);
3247 
3248  ilUtil::sendSuccess($this->lng->txt("msg_entry_removed"), true);
3249  $this->ctrl->redirect($this, "editMenuProperties");
3250  }
3251 
3255  function editMenuEntry()
3256  {
3257  global $ilToolbar, $ilCtrl;
3258 
3259  if (empty($_GET["menu_entry"]))
3260  {
3261  $this->ilias->raiseError($this->lng->txt("no_menu_entry_id"),$this->ilias->error_obj->MESSAGE);
3262  }
3263 
3264  $ilCtrl->saveParameter($this, array("menu_entry"));
3265  $ilToolbar->addButton($this->lng->txt("lm_menu_select_internal_object"),
3266  $ilCtrl->getLinkTarget($this, "showEntrySelector"));
3267 
3268  $form = $this->initMenuEntryForm("edit");
3269  $this->tpl->setContent($form->getHTML());
3270  }
3271 
3275  function updateMenuEntry()
3276  {
3277  if (empty($_REQUEST["menu_entry"]))
3278  {
3279  $this->ilias->raiseError($this->lng->txt("no_menu_entry_id"),$this->ilias->error_obj->MESSAGE);
3280  }
3281 
3282  // check title and target
3283  if (empty($_POST["title"]))
3284  {
3285  $this->ilias->raiseError($this->lng->txt("please_enter_title"),$this->ilias->error_obj->MESSAGE);
3286  }
3287  if (empty($_POST["target"]))
3288  {
3289  $this->ilias->raiseError($this->lng->txt("please_enter_target"),$this->ilias->error_obj->MESSAGE);
3290  }
3291 
3292  $this->__initLMMenuEditor();
3293  $this->lmme_obj->readEntry($_REQUEST["menu_entry"]);
3294  $this->lmme_obj->setTitle($_POST["title"]);
3295  $this->lmme_obj->setTarget($_POST["target"]);
3296  $this->lmme_obj->update();
3297 
3298  ilUtil::sendSuccess($this->lng->txt("msg_entry_updated"), true);
3299  $this->ctrl->redirect($this, "editMenuProperties");
3300  }
3301 
3303  {
3304  global $ilTabs, $ilCtrl;
3305 
3306  $this->setTabs();
3307 
3308  $ilTabs->setTabActive("settings");
3309  $this->setSubTabs("cont_lm_menu");
3310 
3311  $ilCtrl->saveParameter($this, array("menu_entry"));
3312 
3313  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.lm_menu_object_selector.html","Modules/LearningModule");
3314 
3315  ilUtil::sendInfo($this->lng->txt("lm_menu_select_object_to_add"));
3316 
3317  require_once ("./Modules/LearningModule/classes/class.ilLMMenuObjectSelector.php");
3318  $exp = new ilLMMenuObjectSelector($this->ctrl->getLinkTarget($this,'test'),$this);
3319 
3320  $exp->setExpand($_GET["lm_menu_expand"] ? $_GET["lm_menu_expand"] : $this->tree->readRootId());
3321  $exp->setExpandTarget($this->ctrl->getLinkTarget($this,'showEntrySelector'));
3322  $exp->setTargetGet("ref_id");
3323  $exp->setRefId($this->cur_ref_id);
3324 
3325  $sel_types = array('mcst', 'mep', 'cat', 'lm','dbk','glo','frm','exc','tst','svy', 'chat', 'wiki', 'sahs',
3326  "crs", "grp", "book", "tst", "file");
3327  $exp->setSelectableTypes($sel_types);
3328 
3329  //$exp->setTargetGet("obj_id");
3330 
3331  // build html-output
3332  $exp->setOutput(0);
3333  $output = $exp->getOutput();
3334 
3335  // get page ids
3336  foreach ($exp->format_options as $node)
3337  {
3338  if (!$node["container"])
3339  {
3340  $pages[] = $node["child"];
3341  }
3342  }
3343 
3344  //$this->tpl->setCurrentBlock("content");
3345  //var_dump($this->object->getPublicAccessMode());
3346  // access mode selector
3347  $this->tpl->setVariable("TXT_SET_PUBLIC_MODE", $this->lng->txt("set_public_mode"));
3348  $this->tpl->setVariable("TXT_CHOOSE_PUBLIC_MODE", $this->lng->txt("choose_public_mode"));
3349  $modes = array("complete" => $this->lng->txt("all_pages"), "selected" => $this->lng->txt("selected_pages_only"));
3350  $select_public_mode = ilUtil::formSelect ($this->object->getPublicAccessMode(),"lm_public_mode",$modes, false, true);
3351  $this->tpl->setVariable("SELECT_PUBLIC_MODE", $select_public_mode);
3352 
3353  $this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("choose_public_pages"));
3354  $this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
3355  $this->tpl->setVariable("EXPLORER",$output);
3356  $this->tpl->setVariable("ONCLICK",$js_pages);
3357  $this->tpl->setVariable("TXT_CHECKALL", $this->lng->txt("check_all"));
3358  $this->tpl->setVariable("TXT_UNCHECKALL", $this->lng->txt("uncheck_all"));
3359  $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
3360  $this->tpl->setVariable("FORMACTION", $this->ctrl->getLinkTarget($this, "savePublicSection"));
3361  //$this->tpl->parseCurrentBlock();
3362  }
3363 
3367  function selectHeader()
3368  {
3369  if(!isset($_POST["id"]))
3370  {
3371  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
3372  }
3373  if(count($_POST["id"]) > 1)
3374  {
3375  $this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
3376  }
3377  if ($_POST["id"][0] != $this->object->getHeaderPage())
3378  {
3379  $this->object->setHeaderPage($_POST["id"][0]);
3380  }
3381  else
3382  {
3383  $this->object->setHeaderPage(0);
3384  }
3385  $this->object->updateProperties();
3386  $this->ctrl->redirect($this, "pages");
3387  }
3388 
3392  function selectFooter()
3393  {
3394  if(!isset($_POST["id"]))
3395  {
3396  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
3397  }
3398  if(count($_POST["id"]) > 1)
3399  {
3400  $this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
3401  }
3402  if ($_POST["id"][0] != $this->object->getFooterPage())
3403  {
3404  $this->object->setFooterPage($_POST["id"][0]);
3405  }
3406  else
3407  {
3408  $this->object->setFooterPage(0);
3409  }
3410  $this->object->updateProperties();
3411  $this->ctrl->redirect($this, "pages");
3412  }
3413 
3417  function saveAllTitles()
3418  {
3419  global $ilCtrl;
3420 
3421  ilLMObject::saveTitles($this->object, ilUtil::stripSlashesArray($_POST["title"]), $_GET["transl"]);
3422 
3423  $ilCtrl->redirect($this, "chapters");
3424  }
3425 
3429  function insertChapter()
3430  {
3431  global $ilCtrl, $lng;
3432 
3433  include_once("./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
3434 
3437 
3438  if (!ilChapterHierarchyFormGUI::getPostFirstChild()) // insert after node id
3439  {
3440  $parent_id = $this->lm_tree->getParentId($node_id);
3441  $target = $node_id;
3442  }
3443  else // insert as first child
3444  {
3445  $parent_id = $node_id;
3446  $target = IL_FIRST_NODE;
3447  }
3448 
3449  for ($i = 1; $i <= $num; $i++)
3450  {
3451  $chap = new ilStructureObject($this->object);
3452  $chap->setType("st");
3453  $chap->setTitle($lng->txt("cont_new_chap"));
3454  $chap->setLMId($this->object->getId());
3455  $chap->create();
3456  ilLMObject::putInTree($chap, $parent_id, $target);
3457  }
3458 
3459  $ilCtrl->redirect($this, "chapters");
3460  }
3461 
3466  {
3467  global $ilUser, $ilCtrl, $ilLog;
3468 
3469  include_once("./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
3470 
3473 
3474  $ilLog->write("InsertChapterClip, num: $num, node_id: $node_id, ".
3475  " getPostFirstChild ".ilChapterHierarchyFormGUI::getPostFirstChild());
3476 
3477  if (!$first_child) // insert after node id
3478  {
3479  $parent_id = $this->lm_tree->getParentId($node_id);
3480  $target = $node_id;
3481  }
3482  else // insert as first child
3483  {
3484  $parent_id = $node_id;
3485  $target = IL_FIRST_NODE;
3486  }
3487 
3488  // copy and paste
3489  $chapters = $ilUser->getClipboardObjects("st", true);
3490  $copied_nodes = array();
3491  foreach ($chapters as $chap)
3492  {
3493  $ilLog->write("Call pasteTree, Target LM: ".$this->object->getId().", Chapter ID: ".$chap["id"]
3494  .", Parent ID: ".$parent_id.", Target: ".$target);
3495  $cid = ilLMObject::pasteTree($this->object, $chap["id"], $parent_id,
3496  $target, $chap["insert_time"], $copied_nodes,
3497  (ilEditClipboard::getAction() == "copy"));
3498  $target = $cid;
3499  }
3500  ilLMObject::updateInternalLinks($copied_nodes);
3501 
3502  if (ilEditClipboard::getAction() == "cut")
3503  {
3504  $ilUser->clipboardDeleteObjectsOfType("pg");
3505  $ilUser->clipboardDeleteObjectsOfType("st");
3507  }
3508 
3509  $this->object->checkTree();
3510  $ilCtrl->redirect($this, "chapters");
3511  }
3512 
3518  public static function _goto($a_target)
3519  {
3520  global $ilAccess, $ilErr, $lng;
3521 
3522  if ($ilAccess->checkAccess("read", "", $a_target))
3523  {
3524  $_GET["baseClass"] = "ilLMPresentationGUI";
3525  $_GET["ref_id"] = $a_target;
3526  $_GET["cmd"] = "resume";
3527  include("ilias.php");
3528  exit;
3529  } else if ($ilAccess->checkAccess("visible", "", $a_target))
3530  {
3531  $_GET["baseClass"] = "ilLMPresentationGUI";
3532  $_GET["ref_id"] = $a_target;
3533  $_GET["cmd"] = "infoScreen";
3534  include("ilias.php");
3535  exit;
3536  }
3537  else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
3538  {
3539  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
3540  ilObject::_lookupTitle(ilObject::_lookupObjId($a_target))), true);
3542  }
3543 
3544 
3545  $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
3546  }
3547 
3551  function cutItems($a_return = "chapters")
3552  {
3553  global $ilCtrl, $lng;
3554 
3555  $items = ilUtil::stripSlashesArray($_POST["id"]);
3556  if (!is_array($items))
3557  {
3558  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
3559  $ilCtrl->redirect($this, $a_return);
3560  }
3561 
3562  $todel = array(); // delete IDs < 0 (needed for non-js editing)
3563  foreach($items as $k => $item)
3564  {
3565  if ($item < 0)
3566  {
3567  $todel[] = $k;
3568  }
3569  }
3570  foreach($todel as $k)
3571  {
3572  unset($items[$k]);
3573  }
3574  ilLMObject::clipboardCut($this->object->getId(), $items);
3576  ilUtil::sendInfo($lng->txt("cont_selected_items_have_been_cut"), true);
3577 
3578  $ilCtrl->redirect($this, $a_return);
3579  }
3580 
3584  function copyItems()
3585  {
3586  global $ilCtrl, $lng;
3587 
3588  $items = ilUtil::stripSlashesArray($_POST["id"]);
3589  if (!is_array($items))
3590  {
3591  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
3592  $ilCtrl->redirect($this, "chapters");
3593  }
3594 
3595  $todel = array(); // delete IDs < 0 (needed for non-js editing)
3596  foreach($items as $k => $item)
3597  {
3598  if ($item < 0)
3599  {
3600  $todel[] = $k;
3601  }
3602  }
3603  foreach($todel as $k)
3604  {
3605  unset($items[$k]);
3606  }
3607  ilLMObject::clipboardCopy($this->object->getId(), $items);
3609  ilUtil::sendInfo($lng->txt("cont_selected_items_have_been_copied"), true);
3610  $ilCtrl->redirect($this, "chapters");
3611  }
3612 
3616  function cutChapter()
3617  {
3618  $this->cutItems("chapters");
3619  }
3620 
3624 
3631  function showExportIDsOverview($a_validation = false)
3632  {
3633  global $tpl, $ilToolbar, $lng, $ilCtrl;
3634 
3635  $this->setTabs();
3636  $this->setContentSubTabs("export_ids");
3637 
3638  if (ilObjContentObject::isOnlineHelpModule($this->object->getRefId()))
3639  {
3640  // toolbar
3641  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
3642  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
3643  $lm_tree = $this->object->getTree();
3644  $childs = $lm_tree->getChilds($lm_tree->readRootId());
3645  $options = array("" => $lng->txt("all"));
3646  foreach ($childs as $c)
3647  {
3648  $options[$c["child"]] = $c["title"];
3649  }
3650  $si = new ilSelectInputGUI($this->lng->txt("help_component"), "help_chap");
3651  $si->setOptions($options);
3652  $si->setValue(ilSession::get("help_chap"));
3653  $ilToolbar->addInputItem($si, true);
3654  $ilToolbar->addFormButton($lng->txt("help_filter"), "filterHelpChapters");
3655 
3656  include_once("./Modules/LearningModule/classes/class.ilHelpMappingTableGUI.php");
3657  $tbl = new ilHelpMappingTableGUI($this, "showExportIDsOverview", $a_validation, false);
3658  }
3659  else
3660  {
3661  include_once("./Modules/LearningModule/classes/class.ilExportIDTableGUI.php");
3662  $tbl = new ilExportIDTableGUI($this, "showExportIDsOverview", $a_validation, false);
3663  }
3664 
3665  $tpl->setContent($tbl->getHTML());
3666  }
3667 
3675  {
3676  global $ilCtrl;
3677 
3678  ilSession::set("help_chap", ilUtil::stripSlashes($_POST["help_chap"]));
3679  $ilCtrl->redirect($this, "showExportIDsOverview");
3680  }
3681 
3682 
3686  function saveExportIds()
3687  {
3688  global $ilCtrl, $lng;
3689 
3690  // check all export ids
3691  $ok = true;
3692  if (is_array($_POST["exportid"]))
3693  {
3694  foreach ($_POST["exportid"] as $pg_id => $exp_id)
3695  {
3696  if ($exp_id != "" && !preg_match("/^([a-zA-Z]+)[0-9a-zA-Z_]*$/",
3697  trim($exp_id)))
3698  {
3699  $ok = false;
3700  }
3701  }
3702  }
3703  if (!$ok)
3704  {
3705  ilUtil::sendFailure($lng->txt("cont_exp_ids_not_resp_format1").": a-z, A-Z, 0-9, '_'. ".
3706  $lng->txt("cont_exp_ids_not_resp_format3")." ".
3707  $lng->txt("cont_exp_ids_not_resp_format2"));
3708  $this->showExportIDsOverview(true);
3709  return;
3710  }
3711 
3712 
3713  if (is_array($_POST["exportid"]))
3714  {
3715  foreach ($_POST["exportid"] as $pg_id => $exp_id)
3716  {
3717  ilLMPageObject::saveExportId($this->object->getId(), $pg_id,
3718  ilUtil::stripSlashes($exp_id), ilLMObject::_lookupType($pg_id));
3719  }
3720  }
3721 
3722  ilUtil::sendSuccess($lng->txt("cont_saved_export_ids"), true);
3723  $ilCtrl->redirect($this, "showExportIdsOverview");
3724  }
3725 
3732  function saveHelpMapping()
3733  {
3734  global $lng, $ilCtrl;
3735 
3736  include_once("./Services/Help/classes/class.ilHelpMapping.php");
3737  if (is_array($_POST["screen_ids"]))
3738  {
3739  foreach ($_POST["screen_ids"] as $chap => $ids)
3740  {
3741  $ids = explode("\n", $ids);
3743  }
3744  }
3745  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
3746  $ilCtrl->redirect($this, "showExportIdsOverview");
3747  }
3748 
3752 
3759  function showTooltipList()
3760  {
3761  global $tpl, $ilToolbar, $ilCtrl, $lng;
3762 
3763  $this->setTabs();
3764  $this->setContentSubTabs("help_tooltips");
3765 
3766  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
3767  include_once("./Services/Form/classes/class.ilTextInputGUI.php");
3768  $ti = new ilTextInputGUI($this->lng->txt("help_tooltip_id"), "tooltip_id");
3769  $ti->setMaxLength(200);
3770  $ti->setSize(20);
3771  $ilToolbar->addInputItem($ti, true);
3772  $ilToolbar->addFormButton($lng->txt("add"), "addTooltip");
3773  $ilToolbar->addSeparator();
3774 
3775  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
3777  if (ilSession::get("help_tt_comp") != "")
3778  {
3779  $options[ilSession::get("help_tt_comp")] = ilSession::get("help_tt_comp");
3780  }
3781  $si = new ilSelectInputGUI($this->lng->txt("help_component"), "help_tt_comp");
3782  $si->setOptions($options);
3783  $si->setValue(ilSession::get("help_tt_comp"));
3784  $ilToolbar->addInputItem($si, true);
3785  $ilToolbar->addFormButton($lng->txt("help_filter"), "filterTooltips");
3786 
3787  include_once("./Modules/LearningModule/classes/class.ilHelpTooltipTableGUI.php");
3788  $tbl = new ilHelpTooltipTableGUI($this, "showTooltipList", ilSession::get("help_tt_comp"));
3789 
3790  $tpl->setContent($tbl->getHTML());
3791  }
3792 
3799  function addTooltip()
3800  {
3801  global $lng, $ilCtrl;
3802 
3803  $tt_id = ilUtil::stripSlashes($_POST["tooltip_id"]);
3804  if (trim($tt_id) != "")
3805  {
3806  if (is_int(strpos($tt_id, "_")))
3807  {
3808  include_once("./Services/Help/classes/class.ilHelp.php");
3809  ilHelp::addTooltip(trim($tt_id), "");
3810  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
3811 
3812  $fu = strpos($tt_id, "_");
3813  $comp = substr($tt_id, 0, $fu);
3814  ilSession::set("help_tt_comp", ilUtil::stripSlashes($comp));
3815  }
3816  else
3817  {
3818  ilUtil::sendFailure($lng->txt("cont_help_no_valid_tooltip_id"), true);
3819  }
3820  }
3821  $ilCtrl->redirect($this, "showTooltipList");
3822  }
3823 
3830  function filterTooltips()
3831  {
3832  global $lng, $ilCtrl;
3833 
3834  ilSession::set("help_tt_comp", ilUtil::stripSlashes($_POST["help_tt_comp"]));
3835  $ilCtrl->redirect($this, "showTooltipList");
3836  }
3837 
3838 
3845  function saveTooltips()
3846  {
3847  global $ilCtrl, $lng;
3848 
3849  include_once("./Services/Help/classes/class.ilHelp.php");
3850 
3851  if (is_array($_POST["text"]))
3852  {
3853  foreach ($_POST["text"] as $id => $text)
3854  {
3856  ilUtil::stripSlashes($_POST["tt_id"][(int) $id]));
3857  }
3858  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
3859  }
3860  $ilCtrl->redirect($this, "showTooltipList");
3861  }
3862 
3866  function deleteTooltips()
3867  {
3868  global $lng, $ilCtrl;
3869 
3870  if (is_array($_POST["id"]))
3871  {
3872  include_once("./Services/Help/classes/class.ilHelp.php");
3873  foreach ($_POST["id"] as $id)
3874  {
3875  ilHelp::deleteTooltip((int) $id);
3876  }
3877  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
3878  }
3879  $ilCtrl->redirect($this, "showTooltipList");
3880  }
3881 
3888 /* function saveHelpMapping()
3889  {
3890  global $lng, $ilCtrl;
3891 
3892  include_once("./Services/Help/classes/class.ilHelpMapping.php");
3893  if (is_array($_POST["screen_ids"]))
3894  {
3895  foreach ($_POST["screen_ids"] as $chap => $ids)
3896  {
3897  $ids = explode("\n", $ids);
3898  ilHelpMapping::saveScreenIdsForChapter($chap, $ids);
3899  }
3900  }
3901  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
3902  $ilCtrl->redirect($this, "showExportIdsOverview");
3903  }*/
3904 
3905 
3909 
3915  static function getLayoutOption($a_txt, $a_var, $a_def_option = "")
3916  {
3917  global $lng;
3918 
3919  // default layout
3920  $layout = new ilRadioGroupInputGUI($a_txt, $a_var);
3921  if ($a_def_option != "")
3922  {
3923  if (is_file($im = ilUtil::getImagePath("layout_".$a_def_option.".png")))
3924  {
3925  $im_tag = ilUtil::img($im, $a_def_option);
3926  }
3927  $layout->addOption(new ilRadioOption("<table><tr><td>".$im_tag."</td><td><b>".
3928  $lng->txt("cont_lm_default_layout").
3929  "</b>: ".$lng->txt("cont_layout_".$a_def_option).
3930  "</td></tr></table>", ""));
3931  }
3933  {
3934  $im_tag = "";
3935  if (is_file($im = ilUtil::getImagePath("layout_".$l.".png")))
3936  {
3937  $im_tag = ilUtil::img($im, $l);
3938  }
3939  $layout->addOption(new ilRadioOption("<table><tr><td style='padding: 0px 5px 5px;'>".
3940  $im_tag."</td><td style='padding:5px;'><b>".$lng->txt("cont_layout_".$l)."</b>: ".
3941  $lng->txt("cont_layout_".$l."_desc")."</td></tr></table>", $l));
3942  }
3943 
3944  return $layout;
3945  }
3946 
3951  {
3952  global $ilCtrl;
3953  $ilCtrl->setParameter($this, "hierarchy", "1");
3954  $this->setPageLayout(true);
3955  }
3956 
3957 
3961  function setPageLayout($a_in_hierarchy = false)
3962  {
3963  global $tpl, $ilCtrl, $lng;
3964 
3965  if (!is_array($_POST["id"]))
3966  {
3967  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
3968 
3969  if ($a_in_hierarchy)
3970  {
3971  $ilCtrl->redirect($this, "chapters");
3972  }
3973  else
3974  {
3975  $ilCtrl->redirect($this, "pages");
3976  }
3977  }
3978 
3979  $this->initSetPageLayoutForm();
3980 
3981  $tpl->setContent($this->form->getHTML());
3982  }
3983 
3987  public function initSetPageLayoutForm()
3988  {
3989  global $lng, $ilCtrl;
3990 
3991  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
3992  $this->form = new ilPropertyFormGUI();
3993 
3994  if (is_array($_POST["id"]))
3995  {
3996  foreach ($_POST["id"] as $id)
3997  {
3998  $hi = new ilHiddenInputGUI("id[]");
3999  $hi->setValue($id);
4000  $this->form->addItem($hi);
4001  }
4002  }
4003  $layout = self::getLayoutOption($lng->txt("cont_layout"), "layout",
4004  $this->object->getLayout());
4005  $this->form->addItem($layout);
4006 
4007  $this->form->addCommandButton("savePageLayout", $lng->txt("save"));
4008  $this->form->addCommandButton("pages", $lng->txt("cancel"));
4009 
4010  $this->form->setTitle($lng->txt("cont_set_layout"));
4011  $this->form->setFormAction($ilCtrl->getFormAction($this));
4012 
4013  }
4014 
4018  function savePageLayout()
4019  {
4020  global $lng, $ilCtrl;
4021 
4022  $ilCtrl->setParameter($this, "hierarchy", $_GET["hierarchy"]);
4023 
4024  foreach ($_POST["id"] as $id)
4025  {
4027  ilUtil::stripSlashes($_POST["layout"]),
4028  $this->object);
4029  }
4030  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
4031 
4032  if ($_GET["hierarchy"] == 1)
4033  {
4034  $ilCtrl->redirect($this, "chapters");
4035  }
4036  else
4037  {
4038  $ilCtrl->redirect($this, "pages");
4039  }
4040  }
4041 
4042  //
4043  // Auto glossaries
4044  //
4045 
4052  function editGlossaries()
4053  {
4054  global $tpl, $ilToolbar, $lng, $ilCtrl, $ilTabs;
4055 
4056  $this->setTabs();
4057  $ilTabs->setTabActive("settings");
4058  $this->setSubTabs("cont_glossaries");
4059 
4060  $ilToolbar->addButton($lng->txt("add"),
4061  $ilCtrl->getLinkTarget($this, "showLMGlossarySelector"));
4062 
4063  include_once("./Modules/LearningModule/classes/class.ilLMGlossaryTableGUI.php");
4064  $tab = new ilLMGlossaryTableGUI($this->object, $this, "editGlossaries");
4065 
4066  $tpl->setContent($tab->getHTML());
4067  }
4068 
4076  {
4077  global $tpl, $lng, $ilCtrl, $tree, $ilUser, $ilTabs;
4078 
4079  $this->setTabs();
4080  $ilTabs->setTabActive("settings");
4081  $this->setSubTabs("cont_glossaries");
4082 
4083  include_once 'Services/Search/classes/class.ilSearchRootSelector.php';
4084 
4085  $exp = new ilSearchRootSelector($ilCtrl->getLinkTarget($this,'showLMGlossarySelector'));
4086  $exp->setExpand($_GET["search_root_expand"] ? $_GET["search_root_expand"] : $tree->readRootId());
4087  $exp->setExpandTarget($ilCtrl->getLinkTarget($this,'showLMGlossarySelector'));
4088  $exp->setTargetClass(get_class($this));
4089  $exp->setCmd('confirmGlossarySelection');
4090  $exp->setClickableTypes(array("glo"));
4091  $exp->addFilter("glo");
4092 
4093  // build html-output
4094  $exp->setOutput(0);
4095  $tpl->setContent($exp->getOutput());
4096 
4097  }
4098 
4103  {
4104  global $ilCtrl, $tpl, $lng;
4105 
4106  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
4107  $cgui = new ilConfirmationGUI();
4108  $ilCtrl->setParameter($this, "glo_ref_id", $_GET["root_id"]);
4109  $cgui->setFormAction($ilCtrl->getFormAction($this));
4110  $cgui->setHeaderText($lng->txt("cont_link_glo_in_lm"));
4111  $cgui->setCancel($lng->txt("no"), "selectLMGlossary");
4112  $cgui->setConfirm($lng->txt("yes"), "selectLMGlossaryLink");
4113  $tpl->setContent($cgui->getHTML());
4114  }
4115 
4123  {
4124  $glo_ref_id = (int) $_GET["glo_ref_id"];
4125  $glo_id = ilObject::_lookupObjId($glo_ref_id);
4126  $this->object->autoLinkGlossaryTerms($glo_id);
4127  $this->selectLMGlossary();
4128  }
4129 
4130 
4137  function selectLMGlossary()
4138  {
4139  global $ilCtrl, $lng;
4140 
4141  $glos = $this->object->getAutoGlossaries();
4142  $glo_ref_id = (int) $_GET["glo_ref_id"];
4143  $glo_id = ilObject::_lookupObjId($glo_ref_id);
4144  if (!in_array($glo_id, $glos))
4145  {
4146  $glos[] = $glo_id;
4147  }
4148  $this->object->setAutoGlossaries($glos);
4149  $this->object->update();
4150 
4151  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
4152  $ilCtrl->redirect($this, "editGlossaries");
4153  }
4154 
4161  function removeLMGlossary()
4162  {
4163  global $ilCtrl, $lng;
4164 
4165  $this->object->removeAutoGlossary((int) $_GET["glo_id"]);
4166  $this->object->update();
4167 
4168  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
4169  $ilCtrl->redirect($this, "editGlossaries");
4170  }
4171 
4179  {
4180  global $ilCtrl;
4181 
4182  $ilCtrl->setParameter($this, "transl", "");
4183  $ilCtrl->redirect($this, "chapters");
4184  }
4185 
4192  function switchToLanguage()
4193  {
4194  global $ilCtrl;
4195 
4196  $ilCtrl->setParameter($this, "transl", $_GET["totransl"]);
4197  $ilCtrl->redirect($this, "chapters");
4198  }
4199 
4201  {
4202  // #12281
4203  return parent::redrawHeaderActionObject();
4204  }
4205 
4206 }
4207 ?>
listBlockedUsers()
List blocked users.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _lookupLogin($a_user_id)
lookup login
cutItems($a_return="chapters")
Copy items to clipboard, then cut them from the current tree.
saveBibItem()
save bib item (module call)
resetNumberOfTries()
Reset number of tries.
exportSCORM()
create scorm package
unlockQuestion()
Unlock blocked question.
static resetTries($a_q_id, $a_user_id)
Reset tries.
This class represents an option in a radio group.
ILIAS Setting Class.
static getPostMulti()
Get multi number of _POST input.
moveChapter($a_parent_subobj_id=0)
move a single chapter (selection)
Class ilObjectMetaDataGUI.
print $file
deleteBibItemObject($a_target="")
delete bib item (admin call)
static updateInternalLinks($a_copied_nodes, $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
sendMailToBlockedUsers()
Send Mail to blocked users.
static hasNotification($type, $user_id, $id)
Check notification status for object and user.
editMasterLanguage()
Edit master language.
exit
Definition: login.php:54
static saveExportId($a_lm_id, $a_lmobj_id, $a_exp_id, $a_type="pg")
Save export id.
pasteChapter($a_parent_subobj_id=0)
paste chapter
Class ilObjLearningModule.
Class ilInfoScreenGUI.
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
TableGUI class for lm menu items.
setSubTabs($a_active)
Set sub tabs.
Import related features for learning modules.
$_POST['username']
Definition: cron.php:12
setPageLayoutInHierarchy()
Set layout for multipl pages.
showActions($a_actions)
show possible action (form buttons)
static getMultiLangHeader($a_lm_id, $a_gui_class)
Get multi lang header.
selectLMGlossary()
Select lm glossary.
This class represents a selection list property in a property form.
initMenuEntryForm($a_mode="edit")
Init menu entry form.
Tabs GUI.
This class represents a property form user interface.
GUI class for the workflow of copying objects.
initStylePropertiesForm()
Init style properties form.
Upload SRT files to all media objects of a learning module.
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
$tbl
Definition: example_048.php:81
getInstance(&$a_content_obj, $a_id=0, $a_halt=true)
This class represents a section header in a property form.
This class represents a file property in a property form.
static getImageTagByType($a_type, $a_path, $a_big=false)
Builds an html image tag TODO: function still in use, but in future use getImagePath and move HTML-Co...
static saveTitles($a_lm, $a_titles, $a_lang="-")
Save titles for lm objects.
updateMenuEntry()
update a menu entry
addBibItemObject($a_target="")
add bib item (admin call)
Class ilObject Basic functions for all objects.
$valid
listLinks()
List all broken links.
activatePages()
activates or deactivates pages
setReturnLocation($a_cmd, $a_location)
set specific return location for command
$cmd
Definition: sahs_server.php:35
static getPostNodeId()
Get node ID of _POST input.
static _requiresPurchaseToAccess($a_ref_id, $a_purchasetype='')
this function should be used by all buyable repository objects !!
static get($a_var)
Get a value.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
Class ilStructureObjectGUI.
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.
setFormAction($a_cmd, $a_formaction)
set specific form action for command
static getLayoutOption($a_txt, $a_var, $a_def_option="")
Save help mapping.
static set($a_var, $a_val)
Set a value.
popup()
popup window for wysiwyg editor
This class represents a checkbox property in a property form.
showExportIDsOverview($a_validation=false)
Show export IDs overview.
setFormAction($a_formaction)
Set FormAction.
static _lookupTitle($a_id)
lookup object title
setQuestionsSubTabs($a_active)
Set pages tabs.
Export class for content objects.
class for checking external links in page objects Normally used in Cron jobs, but should be extensibl...
static writeLayout($a_obj_id, $a_layout, $a_lm=null)
Write layout setting.
editMenuProperties()
Edit menu properies.
viewObject()
list childs of current object
createObject()
create new object form
createPDF()
export content object
getAvailableLayouts()
get all available lm layouts
class for checking external links in page objects.
static _lookupTitle($a_obj_id)
Lookup title.
saveAllTitles()
Save all titles of chapters/pages.
saveStyleSettings()
Save style settings.
getPropertiesFormValues()
Get values for properties form.
storeContentObject($a_type, $a_id, $a_action="cut")
addBibItem()
add bib item (module call)
Class ilECSLearningModuleSettings.
static _lookupObjectId($a_ref_id)
lookup object id
fixTreeConfirm()
confirm screen for tree fixing
global $ilCtrl
Definition: ilias.php:18
static getTooltipComponents($a_module_id=0)
Get all tooltip components.
const IL_RTOKEN_NAME
class ilLinkCheckerTableGUI
proceedDragDrop()
proceed drag and drop operations on pages/chapters
setInfo($a_info)
Set Information Text.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getPostFirstChild()
Should node be inserted as first child of target node (true) or as successor (false) ...
downloadPDFFile()
download export file
$section
Definition: Utf8Test.php:84
getPublicAccessColValue($a_type, $a_file)
Get public access value for export table.
owner()
show owner of content object
setChecked($a_checked)
Set Checked.
clipboardCut($a_cont_obj_id, $a_ids)
Copy a set of chapters/pages into the clipboard.
Export User Interface Class.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
This class represents a hidden form property in a property form.
$info
Definition: example_052.php:80
selectFooter()
select page as footer
setilLMMenu($a_offline=false, $a_export_format="", $a_active="content", $a_use_global_tabs=false, $a_as_subtabs=false, $a_cur_page=0)
get lm menu html
addLocations($a_omit_obj_id=false)
display locator
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
afterSave(ilObject $a_new_object)
This class represents a property in a property form.
_createEntry($a_obj_id, $a_action, $a_info_params="", $a_obj_type="", $a_user_comment="", $a_update_last=false)
Creates a new history entry for an object.
deleteBibItem()
delete bib item (module call)
TableGUI class for (broken) links in learning module.
Class ilLMPageObject.
if(!is_array($argv)) $options
saveScreenIdsForChapter($a_chap, $a_ids)
Save screen ids for chapter.
static clipboardCopy($a_cont_obj_id, $a_ids)
Copy a set of chapters/pages into the clipboard.
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
properties()
edit properties form
_writeActive($a_id, $a_parent_type, $a_active, $a_reset_scheduled_activation=true, $a_lang="-")
write activation status
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
copyItems()
Copy items to clipboard.
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.
savePublicSectionAccess()
Saves lm access mode.
selectHeader()
select page as header
This class represents a hierarchical form.
importObject()
display dialogue for importing XML-LeaningObjects
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
const IL_FIRST_NODE
Definition: class.ilTree.php:5
addMenuEntry()
display add menu entry form
setValue($a_value)
Set Value.
special template class to simplify handling of ITX/PEAR
omitLocator($a_omit=true)
setTitle($a_title)
Set Title.
selectLMGlossaryLink()
Select a glossary and link all its terms.
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
put this object into content object tree
static setNotification($type, $user_id, $id, $status=true)
Set notification status for object and user.
_lookupContObjID($a_id)
get learning module / digibook id for lm object
TableGUI class for glossary tables.
This class represents a text property in a property form.
insertChapterClip()
Insert Chapter from clipboard.
copyChapter($a_parent_subobj_id=0)
copy a single chapter (selection)
Class ilBibItemGUI.
Page multilinguality GUI class.
_getStandardStyles($a_exclude_default_style=false, $a_include_deactivated=false, $a_scope=0)
Get standard styles.
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
redirection script todo: (a better solution should control the processing via a xml file) ...
setPageLayout($a_in_hierarchy=false)
Set layout for multipl pages.
interface ilLinkCheckerGUIRowHandling
class for editing lm menu
setMaxLength($a_maxlength)
Set Max Length.
publishExportFile($a_files)
download export file
setTableNames($a_table_tree, $a_table_obj_data, $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...
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
manifest.xml file not found-exception for import
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
setOptions($a_options)
Set Options.
ilObjContentObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=false)
Constructor.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
prepareOutput()
prepare output
static _lookupType($a_id, $a_reference=false)
lookup object type
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 isOnlineHelpModule($a_id, $a_as_obj_id=false)
Is module an online module.
User interface class for advanced drop-down selection lists.
Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE Date: 24.10.14 Time: 10:35.
Class ilLMPageObjectGUI.
notify($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
notifys an object about an event occured Based on the event passed, each object may decide how it rea...
_lookupStandard($a_id)
Lookup standard flag.
confirmedDelete($a_parent_subobj_id=0)
delete page object or structure objects
setContentSubTabs($a_active)
Set pages tabs.
Class ilStructreObject.
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static _getFrame($a_class, $a_type='')
Get content frame name.
editMenuEntry()
edit menu entry form
$lm_set
This class represents a non editable value in a property form.
global $ilUser
Definition: imgupload.php:15
global $l
Definition: afr.php:30
saveBibItemObject($a_target="")
save bib item (admin call)
Class ilObjStyleSheetGUI.
global $ilSetting
Definition: privfeed.php:40
confirmGlossarySelection()
Confirm glossary selection.
static unlock($a_q_id, $a_user_id)
Reset tries.
_writePublicAccessStatus($a_pages, $a_cont_obj_id)
update public access flags in lm_data for all pages of a content object
static getRedirectTarget($gui, $cmd, array $gui_params=array(), array $mail_params=array(), array $context_params=array())
$path
Definition: index.php:22
This class represents a text area property in a property form.
static getInstance($a_obj_id)
Get instance.
getBlockedUsersMailSignature()
Get mail signature for blocked users.
global $ilDB
initPropertiesForm()
Init properties form.
Class ilObjContentObjectGUI.
getCreationMode()
get creation mode
getRefId()
get reference id public
$text
getContextPath($a_endnode_id, $a_startnode_id=1)
get context path in content object tree
static _getPresentationTitle($a_pg_id, $a_mode=IL_CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-")
presentation title doesn&#39;t have to be page title, it may be chapter title + page title or chapter tit...
editBibItemObject($a_target="")
edit bib items (admin call)
static deleteTooltip($a_id)
Delete tooltip.
savePublicSectionPages()
Saves public lm pages.
_getNotifyStatus($a_usr_id, $a_obj_id)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
setTabs()
set admin tabs public
editGlossaries()
Edit automatically linked glossaries.
initSetPageLayoutForm()
Init set page layout form.
Class ilObjContentObject.
switchToLanguage()
Switch to language.
importFileObject()
display status information or report errors messages in case of error
update()
update object in db
editStyleProperties()
Edit style properties.
static isJobActive($a_job_id)
Check if given job is currently active.
showLMGlossarySelector()
Select LM Glossary.
static updateTooltip($a_id, $a_text, $a_tt_id)
Update tooltip.
static redirect($a_script)
http redirect to other script
Class ilLMObject.
static getInstance($a_obj_id)
filterHelpChapters()
Filter help chapters.
addHeaderAction()
Add header action menu.
setSuffixes($a_suffixes)
Set Accepted Suffixes.
Class ilObjUserTrackingGUI.
showTooltipList()
Show export IDs overview.
setRequired($a_required)
Set Required.
const IL_COMP_SERVICE
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
removeLMGlossary()
Remove lm glossary.
setExpand($a_node_id)
set the expand option this value is stored in a SESSION variable to save it different view (lo view...
static addTooltip($a_tt_id, $a_text, $a_module_id=0)
Add tooltip.
GUI class for object translation handling.
TableGUI class for all pages of a learning module.
Confirmation screen class.
insertChapter()
Insert (multiple) chapters at node.
editBibItem()
edit bib items (module call)
static _goto($a_target)
redirect script