4 include_once 
"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';
 
   35                 $lng->loadLanguageModule(
"content");
 
   44                 global $ilAccess, 
$lng;
 
   46                 if ($this->ctrl->getRedirectSource() == 
"ilinternallinkgui")
 
   52                 if ($this->ctrl->getCmdClass() == 
"ilinternallinkgui")
 
   54                         $this->ctrl->setReturn($this, 
"explorer");
 
   58                 $next_class = $this->ctrl->getNextClass($this);
 
   61                 $cmd = $this->ctrl->getCmd(
"", array(
"downloadExportFile"));
 
   65                         case "illearningprogressgui":
 
   67                                 include_once 
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
 
   72                                 $this->ctrl->forwardCommand($new_gui);
 
   78                                 include_once 
'Services/MetaData/classes/class.ilMDEditorGUI.php';
 
   80                                 $md_gui =& 
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
 
   81                                 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
 
   83                                 $this->ctrl->forwardCommand($md_gui);
 
   86                         case "ilobjstylesheetgui":
 
   88                                 include_once (
"./Services/Style/classes/class.ilObjStyleSheetGUI.php");
 
   89                                 $this->ctrl->setReturn($this, 
"editStyleProperties");
 
   90                                 $style_gui =& 
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(), 
false, 
false);
 
   92                                 if (
$cmd == 
"create" || 
$_GET[
"new_type"]==
"sty")
 
   94                                         $style_gui->setCreationMode(
true);
 
   96                                 $ret =& $this->ctrl->forwardCommand($style_gui);
 
   99                                 if (
$cmd == 
"save" || 
$cmd == 
"copyStyle" || 
$cmd == 
"importStyle")
 
  102                                         $this->
object->setStyleSheetId($style_id);
 
  103                                         $this->
object->update();
 
  104                                         $this->ctrl->redirectByClass(
"ilobjstylesheetgui", 
"edit");
 
  108                         case "illmpageobjectgui":
 
  109                                 $this->ctrl->saveParameter($this, array(
"obj_id"));
 
  111                                 $this->ctrl->setReturn($this, 
"chapters");
 
  116                                 if (
$_GET[
"obj_id"] != 
"")
 
  119                                         $pg_gui->setLMPageObject($obj);
 
  122                                 $ret =& $this->ctrl->forwardCommand($pg_gui);
 
  123                                 if (
$cmd == 
"save" || 
$cmd == 
"cancel")
 
  129                         case "ilstructureobjectgui":
 
  130                                 $this->ctrl->saveParameter($this, array(
"obj_id"));
 
  132                                 $this->ctrl->setReturn($this, 
"chapters");
 
  134                                 if (
$_GET[
"obj_id"] != 
"")
 
  137                                         $st_gui->setStructureObject($obj);
 
  140                                 $ret =& $this->ctrl->forwardCommand($st_gui);
 
  141                                 if (
$cmd == 
"save" || 
$cmd == 
"cancel")
 
  143                                         if (
$_GET[
"obj_id"] == 
"")
 
  145                                                 $this->ctrl->redirect($this, 
"chapters");
 
  149                                                 $this->ctrl->setCmd(
"subchap");
 
  155                         case 'ilpermissiongui':
 
  156                                 if (strtolower(
$_GET[
"baseClass"]) == 
"iladministrationgui")
 
  165                                 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
 
  167                                 $ret =& $this->ctrl->forwardCommand($perm_gui);
 
  171                         case 'ilinfoscreengui':
 
  174                                 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
 
  176                                 $info->enablePrivateNotes();
 
  177                                 $info->enableLearningProgress();
 
  180                                 if ($ilAccess->checkAccess(
"write", 
"", 
$_GET[
"ref_id"]))
 
  182                                         $info->enableNewsEditing();
 
  183                                         $info->setBlockProperty(
"news", 
"settings", 
true);
 
  187                                 $info->addMetaDataSections($this->object->getId(), 0,
 
  188                                         $this->
object->getType());
 
  190                                 $ret =& $this->ctrl->forwardCommand($info);
 
  196                                 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
 
  198                                 $exp_gui->addFormat(
"xml", 
"", $this, 
"export");
 
  199                                 $exp_gui->addFormat(
"html", 
"", $this, 
"exportHTML");
 
  200                                 $exp_gui->addFormat(
"scorm", 
"", $this, 
"exportSCORM");
 
  201                                 $exp_gui->addCustomColumn($lng->txt(
"cont_public_access"),
 
  202                                                 $this, 
"getPublicAccessColValue");
 
  203                                 $exp_gui->addCustomMultiCommand($lng->txt(
"cont_public_access"),
 
  204                                                 $this, 
"publishExportFile");
 
  205                                 $ret = $this->ctrl->forwardCommand($exp_gui);
 
  210                                 $new_type = 
$_POST[
"new_type"]
 
  215                                 if (
$cmd == 
"create" &&
 
  216                                         !in_array($new_type, array(
"dbk", 
"lm")))
 
  223                                                         $this->ctrl->setCmdClass(
"ilLMPageObjectGUI");
 
  229                                                         $this->ctrl->setCmdClass(
"ilStructureObjectGUI");
 
  238                                                 in_array($new_type, array(
"dbk", 
"lm")))
 
  261                 return array(
"ilLMPageObjectGUI", 
"ilStructureObjectGUI",
"ilObjStyleSheetGUI");
 
  271                 $lng->loadLanguageModule(
"style");
 
  276                 $showViewInFrameset = 
true;
 
  278                 if ($showViewInFrameset)
 
  284                         $buttonTarget = 
"ilContObj".$this->object->getID();
 
  288                 $this->tpl->addBlockfile(
"BUTTONS", 
"buttons", 
"tpl.buttons.html");
 
  291                 $this->tpl->setCurrentBlock(
"btn_cell");
 
  292                 $this->tpl->setVariable(
"BTN_LINK", 
"ilias.php?baseClass=ilLMPresentationGUI&ref_id=".$this->object->getRefID());
 
  293                 $this->tpl->setVariable(
"BTN_TARGET",
" target=\"".$buttonTarget.
"\" ");
 
  294                 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"view"));
 
  295                 $this->tpl->parseCurrentBlock();
 
  297                 $this->tpl->setCurrentBlock(
"btn_cell");
 
  298                 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this, 
"fixTreeConfirm"));
 
  300                 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_fix_tree"));
 
  301                 $this->tpl->parseCurrentBlock();
 
  308                 $this->tpl->setContent($this->form->getHTML());
 
  318                 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
  327                 $this->form->addItem($ti);
 
  334                 $this->form->addItem($ta);
 
  338                 $this->form->addItem($online);
 
  350                         $option[$l] = 
"<table><tr><td>".$im_tag.
"</td><td><b>".$lng->txt(
"cont_layout_".$l).
"</b>: ".$lng->txt(
"cont_layout_".$l.
"_desc").
"</td></tr></table>";
 
  353                 $this->form->addItem($layout);
 
  356                 $page_header = 
new ilSelectInputGUI($lng->txt(
"cont_page_header"), 
"lm_pg_header");
 
  357                 $option = array (
"st_title" => $this->lng->txt(
"cont_st_title"),
 
  358                         "pg_title" => $this->lng->txt(
"cont_pg_title"),
 
  359                         "none" => $this->lng->txt(
"cont_none"));
 
  361                 $this->form->addItem($page_header);
 
  365                 $this->form->addItem($chap_num);
 
  369                 $option = array (
"chapters" => $this->lng->txt(
"cont_chapters_only"),
 
  370                         "pages" => $this->lng->txt(
"cont_chapters_and_pages"));
 
  372                 $this->form->addItem($toc_mode);
 
  375                 if (!$this->ilias->getSetting(
'disable_notes'))
 
  377                         $pub_nodes = 
new ilCheckboxInputGUI($lng->txt(
"cont_public_notes"), 
"cobj_pub_notes");
 
  378                         $pub_nodes->
setInfo($this->lng->txt(
"cont_public_notes_desc"));
 
  379                         $this->form->addItem($pub_nodes);
 
  384                 $lpp->
setInfo($this->lng->txt(
"cont_layout_per_page_info"));
 
  385                 $this->form->addItem($lpp);
 
  388                 $synch = 
new ilCheckboxInputGUI($lng->txt(
"cont_synchronize_frames"), 
"cobj_clean_frames");
 
  389                 $synch->
setInfo($this->lng->txt(
"cont_synchronize_frames_desc"));
 
  390                 $this->form->addItem($synch);
 
  393                 $com = 
new ilCheckboxInputGUI($lng->txt(
"enable_hist_user_comments"), 
"cobj_user_comments");
 
  394                 $com->
setInfo($this->lng->txt(
"enable_hist_user_comments_desc"));
 
  395                 $this->form->addItem($com);
 
  397                 $this->form->setTitle($lng->txt(
"cont_general_properties"));
 
  398                 $this->form->addCommandButton(
"saveProperties", $lng->txt(
"save"));
 
  399                 $this->form->setFormAction($ilCtrl->getFormAction($this));
 
  408                 $values[
"title"] = $this->
object->getTitle();
 
  409                 $values[
"description"] = $this->
object->getDescription();
 
  410                 if ($this->object->getOnline())
 
  412                         $values[
"cobj_online"] = 
true;
 
  414                 $values[
"lm_layout"] = $this->
object->getLayout();
 
  415                 $values[
"lm_pg_header"] = $this->
object->getPageHeader();
 
  416                 if ($this->object->isActiveNumbering())
 
  418                         $values[
"cobj_act_number"] = 
true;
 
  420                 $values[
"toc_mode"] = $this->
object->getTOCMode();
 
  421                 if ($this->object->publicNotes())
 
  423                         $values[
"cobj_pub_notes"] = 
true;
 
  425                 if ($this->object->cleanFrames())
 
  427                         $values[
"cobj_clean_frames"] = 
true;
 
  429                 if ($this->object->isActiveHistoryUserComments())
 
  431                         $values[
"cobj_user_comments"] = 
true;
 
  433                 $values[
"layout_per_page"] = $this->
object->getLayoutPerPage();
 
  435                 $this->form->setValuesByArray($values);
 
  446                 if ($this->form->checkInput())
 
  448                         $this->
object->setTitle(
$_POST[
'title']);
 
  449                         $this->
object->setDescription(
$_POST[
'description']);
 
  450                         $this->
object->setLayout(
$_POST[
"lm_layout"]);
 
  451                         $this->
object->setPageHeader(
$_POST[
"lm_pg_header"]);
 
  452                         $this->
object->setTOCMode(
$_POST[
"toc_mode"]);
 
  453                         $this->
object->setOnline(
$_POST[
"cobj_online"]);
 
  454                         $this->
object->setActiveNumbering(
$_POST[
"cobj_act_number"]);
 
  455                         $this->
object->setCleanFrames(
$_POST[
"cobj_clean_frames"]);
 
  456                         $this->
object->setPublicNotes(
$_POST[
"cobj_pub_notes"]);
 
  457                         $this->
object->setHistoryUserComments(
$_POST[
"cobj_user_comments"]);
 
  458                         $this->
object->setLayoutPerPage(
$_POST[
"layout_per_page"]);
 
  459                         $this->
object->updateProperties();
 
  460                         $this->
object->update();
 
  462                         $this->ctrl->redirect($this, 
"properties");
 
  466                         $this->form->setValuesByPost();
 
  467                         $tpl->setContent($this->form->getHTML());
 
  479                 $tpl->setContent($this->form->getHTML());
 
  489                 $lng->loadLanguageModule(
"style");
 
  491                 $ilTabs->setTabActive(
"settings");
 
  494                 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
  497                 $fixed_style = $ilSetting->get(
"fixed_content_style_id");
 
  498                 $style_id = $this->
object->getStyleSheetId();
 
  500                 if ($fixed_style > 0)
 
  504                                 $this->lng->txt(
"global_fixed").
")");
 
  505                         $this->form->addItem($st);
 
  512                         $st_styles[0] = $this->lng->txt(
"default");
 
  522                                         $this->form->addItem($st);
 
  527                                         $this->form->addCommandButton(
"editStyle",
 
  528                                                 $lng->txt(
"cont_edit_style"));
 
  529                                         $this->form->addCommandButton(
"deleteStyle",
 
  530                                                 $lng->txt(
"cont_delete_style"));
 
  538                                         $st_styles, 
false, 
true);
 
  539                                 $style_sel = 
new ilSelectInputGUI($lng->txt(
"cont_current_style"), 
"style_id");
 
  541                                 $style_sel->setValue($style_id);
 
  542                                 $this->form->addItem($style_sel);
 
  544                                 $this->form->addCommandButton(
"saveStyleSettings",
 
  546                                 $this->form->addCommandButton(
"createStyle",
 
  547                                         $lng->txt(
"sty_create_ind_style"));
 
  550                 $this->form->setTitle($lng->txt(
"cont_style"));
 
  551                 $this->form->setFormAction($ilCtrl->getFormAction($this));
 
  561                 $ilCtrl->redirectByClass(
"ilobjstylesheetgui", 
"create");
 
  571                 $ilCtrl->redirectByClass(
"ilobjstylesheetgui", 
"edit");
 
  581                 $ilCtrl->redirectByClass(
"ilobjstylesheetgui", 
"delete");
 
  591                 if ($ilSetting->get(
"fixed_content_style_id") <= 0 &&
 
  593                         || $this->object->getStyleSheetId() == 0))
 
  596                         $this->
object->update();
 
  599                 $this->ctrl->redirect($this, 
"editStyleProperties");
 
  609                 $lng->loadLanguageModule(
"style");
 
  611                 $ilTabs->setTabActive(
"settings");
 
  615                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.lm_properties.html", 
"Modules/LearningModule");
 
  616                 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
  618                 $this->tpl->setVariable(
"TXT_LM_MENU", $this->lng->txt(
"cont_lm_menu"));
 
  619                 $this->tpl->setVariable(
"TXT_ACT_MENU", $this->lng->txt(
"cont_active"));
 
  620                 $this->tpl->setVariable(
"CBOX_LM_MENU", 
"cobj_act_lm_menu");
 
  621                 $this->tpl->setVariable(
"VAL_LM_MENU", 
"y");
 
  622                 if ($this->object->isActiveLMMenu())
 
  624                         $this->tpl->setVariable(
"CHK_LM_MENU", 
"checked");
 
  628                 $this->tpl->setVariable(
"TXT_TOC", $this->lng->txt(
"cont_toc"));
 
  629                 $this->tpl->setVariable(
"CBOX_TOC", 
"cobj_act_toc");
 
  630                 $this->tpl->setVariable(
"VAL_TOC", 
"y");
 
  631                 if ($this->object->isActiveTOC())
 
  633                         $this->tpl->setVariable(
"CHK_TOC", 
"checked");
 
  637                 $this->tpl->setVariable(
"TXT_PRINT", $this->lng->txt(
"cont_print_view"));
 
  638                 $this->tpl->setVariable(
"CBOX_PRINT", 
"cobj_act_print");
 
  639                 $this->tpl->setVariable(
"VAL_PRINT", 
"y");
 
  640                 if ($this->object->isActivePrintView())
 
  642                         $this->tpl->setVariable(
"CHK_PRINT", 
"checked");
 
  646                 $this->tpl->setVariable(
"TXT_PRINT_PREV_GLO", $this->lng->txt(
"cont_print_view_pre_glo"));
 
  647                 $this->tpl->setVariable(
"CBOX_PRINT_PREV_GLO", 
"cobj_act_print_prev_glo");
 
  648                 $this->tpl->setVariable(
"VAL_PRINT_PREV_GLO", 
"y");
 
  649                 if ($this->object->isActivePreventGlossaryAppendix())
 
  651                         $this->tpl->setVariable(
"CHK_PRINT_PREV_GLO", 
"checked");
 
  655                 $no_download_file_available =
 
  656                         " ".$lng->txt(
"cont_no_download_file_available").
 
  657                         " <a href='".$ilCtrl->getLinkTargetByClass(
"ilexportgui", 
"").
"'>".$lng->txt(
"change").
"</a>";
 
  658                 $types = array(
"xml", 
"html", 
"scorm");
 
  659                 foreach($types as $type)
 
  661                         if ($this->object->getPublicExportFile($type) != 
"")
 
  663                                 if (is_file($this->object->getExportDirectory($type).
"/".
 
  664                                         $this->
object->getPublicExportFile($type)))
 
  666                                         $no_download_file_available = 
"";
 
  670                 $this->tpl->setVariable(
"TXT_DOWNLOADS", $this->lng->txt(
"cont_downloads"));
 
  671                 $this->tpl->setVariable(
"TXT_DOWNLOADS_DESC", $this->lng->txt(
"cont_downloads_desc").$no_download_file_available);
 
  672                 $this->tpl->setVariable(
"CBOX_DOWNLOADS", 
"cobj_act_downloads");
 
  673                 $this->tpl->setVariable(
"VAL_DOWNLOADS", 
"y");
 
  675                 if ($this->object->isActiveDownloads())
 
  677                         $this->tpl->setVariable(
"CHK_DOWNLOADS", 
"checked=\"checked\"");
 
  680                 $this->tpl->setVariable(
"TXT_DOWNLOADS_PUBLIC_DESC", $this->lng->txt(
"cont_downloads_public_desc"));
 
  681                 $this->tpl->setVariable(
"CBOX_DOWNLOADS_PUBLIC", 
"cobj_act_downloads_public");
 
  682                 $this->tpl->setVariable(
"VAL_DOWNLOADS_PUBLIC", 
"y");
 
  684                 if ($this->object->isActiveDownloadsPublic())
 
  686                         $this->tpl->setVariable(
"CHK_DOWNLOADS_PUBLIC", 
"checked=\"checked\"");
 
  689                 if (!$this->object->isActiveDownloads())
 
  691                         $this->tpl->setVariable(
"CHK2_DOWNLOADS_PUBLIC", 
"disabled=\"disabled\"");
 
  696                 $entries = $this->lmme_obj->getMenuEntries();
 
  698                 if (count($entries) > 0)
 
  700                         foreach ($entries as $entry)
 
  702                                 $this->ctrl->setParameter($this, 
"menu_entry", $entry[
"id"]);
 
  704                                 $this->tpl->setCurrentBlock(
"menu_entries");
 
  706                                 if ($entry[
"type"] == 
"intern")
 
  708                                         $entry[
"link"] = ILIAS_HTTP_PATH.
"/goto.php?target=".$entry[
"link"];
 
  712                                 if (!strstr($entry[
"link"],
'://') && !strstr($entry[
"link"],
'mailto:'))
 
  714                                         $entry[
"link"] = 
"http://".$entry[
"link"];
 
  717                                 $this->tpl->setVariable(
"ENTRY_LINK", $entry[
"link"]);
 
  718                                 $this->tpl->setVariable(
"ENTRY_TITLE", $entry[
"title"]);
 
  720                                 $this->tpl->setVariable(
"CBOX_ENTRY", 
"menu_entries[]");
 
  721                                 $this->tpl->setVariable(
"VAL_ENTRY", $entry[
"id"]);
 
  725                                         $this->tpl->setVariable(
"CHK_ENTRY", 
"checked=\"checked\"");
 
  729                                 $this->tpl->setVariable(
"LINK_EDIT", $this->ctrl->getLinkTarget($this,
"editMenuEntry"));
 
  730                                 $this->tpl->setVariable(
"TARGET_EDIT", 
"content");
 
  731                                 $this->tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
 
  734                                 $this->tpl->setVariable(
"LINK_DROP", $this->ctrl->getLinkTarget($this,
"deleteMenuEntry"));
 
  735                                 $this->tpl->setVariable(
"TARGET_DROP", 
"content");
 
  736                                 $this->tpl->setVariable(
"TXT_DROP", $this->lng->txt(
"drop"));
 
  739                                 $this->tpl->parseCurrentBlock();
 
  746                 $this->tpl->setCurrentBlock(
"commands");
 
  747                 $this->tpl->setVariable(
"BTN_NAME", 
"saveMenuProperties");
 
  748                 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
 
  749                 $this->tpl->setVariable(
"BTN_NAME2", 
"addMenuEntry");
 
  750                 $this->tpl->setVariable(
"BTN_TEXT2", $this->lng->txt(
"add_menu_entry"));
 
  751                 $this->tpl->parseCurrentBlock();
 
  764                 $this->
object->setActivePreventGlossaryAppendix(
ilUtil::yn2tf(
$_POST[
"cobj_act_print_prev_glo"]));
 
  766                 $this->
object->setActiveDownloadsPublic(
ilUtil::yn2tf(
$_POST[
"cobj_act_downloads_public"]));
 
  767                 $this->
object->updateProperties();
 
  771                 $this->lmme_obj->updateActiveStatus(
$_POST[
"menu_entries"]);
 
  774                 $this->ctrl->redirect($this, 
"editMenuProperties");
 
  784                 switch ($this->object->getType())
 
  787                                 $gui_class = 
"ilobjlearningmodulegui";
 
  791                                 $gui_class = 
"ilobjdlbookgui";
 
  795                 $ilCtrl->setParameterByClass($gui_class, 
"active_node", 
$_GET[
"active_node"]);
 
  797                 $this->tpl = 
new ilTemplate(
"tpl.main.html", 
true, 
true);
 
  804                 $this->tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.explorer.html");
 
  807                 require_once (
"./Modules/LearningModule/classes/class.ilLMEditorExplorer.php");
 
  812                 $exp->setExpandTarget($this->ctrl->getLinkTarget($this, 
"explorer"));
 
  814                 if (
$_GET[
"lmmovecopy"] == 
"1")
 
  820                 if (
$_GET[
"lmexpand"] == 
"")
 
  822                         $mtree = 
new ilTree($this->object->getId());
 
  824                         $mtree->setTreeTablePK(
"lm_id");
 
  825                         $expanded = $mtree->readRootId();
 
  829                         $expanded = 
$_GET[
"lmexpand"];
 
  831                 if (
$_GET[
"active_node"] != 
"")
 
  833                         $path = $this->lm_tree->getPathId(
$_GET[
"active_node"]);
 
  834                         $exp->setForceOpenPath(
$path);
 
  836                         $exp->highlightNode(
$_GET[
"active_node"]);
 
  838                 $exp->setExpand($expanded);
 
  842                 $output = $exp->getOutput();
 
  845                 if ($ilCtrl->isAsynch())
 
  850                 include_once(
"./Services/COPage/classes/class.ilPageEditorGUI.php");
 
  869                 $this->tpl->setCurrentBlock(
"content");
 
  870                 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"cont_chap_and_pages"));
 
  871                 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
 
  872                 $this->tpl->setVariable(
"EXPLORER",$output);
 
  873                 $this->ctrl->setParameter($this, 
"lmexpand", 
$_GET[
"lmexpand"]);
 
  874                 $this->tpl->setVariable(
"ACTION", $this->ctrl->getLinkTarget($this, 
"explorer"));
 
  875                 $this->tpl->parseCurrentBlock();
 
  876                 $this->tpl->show(
false);
 
  885                 include_once 
"./Services/COPage/classes/class.ilWysiwygUtil.php";
 
  887                 $popup->show(
$_GET[
"ptype"]);
 
  898                 $this->
object->executeDragDrop(
$_POST[
"il_hform_source_id"], 
$_POST[
"il_hform_target_id"],
 
  900                 $ilCtrl->redirect($this, 
"chapters");
 
  908                 global $rbacsystem, 
$tpl;
 
  912                 if (!$rbacsystem->checkAccess(
"create", 
$_GET[
"ref_id"], $new_type))
 
  914                         $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
 
  919                         $f1 = $this->form->getHTML();
 
  921                         $f2 = $this->form->getHTML();
 
  922                         $this->tpl->setContent($f1.
"<br />".$f2);
 
  929                         $data[
"fields"] = array();
 
  935                         $this->tpl->setVariable(
"TYPE_IMG",
 
  937                         $this->tpl->setVariable(
"ALT_IMG",
 
  938                                 $this->lng->txt(
"obj_".$new_type));
 
  940                         foreach (
$data[
"fields"] as $key => $val)
 
  942                                 $this->tpl->setVariable(
"TXT_".strtoupper($key), $this->lng->txt($key));
 
  943                                 $this->tpl->setVariable(strtoupper($key), $val);
 
  945                                 if ($this->prepare_output)
 
  947                                         $this->tpl->parseCurrentBlock();
 
  955                         $this->ctrl->setParameter($this, 
"new_type", $new_type);
 
  956                         $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this, 
"save"));
 
  959                         $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($new_type.
"_new"));
 
  960                         $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
 
  961                         $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt($new_type.
"_add"));
 
  962                         $this->tpl->setVariable(
"CMD_SUBMIT", 
"save");
 
  963                         $this->tpl->setVariable(
"TARGET", 
' target="'.
 
  965                         $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
 
  967                         $this->tpl->setVariable(
"TXT_IMPORT_LM", $this->lng->txt(
"import_".$new_type));
 
  968                         $this->tpl->setVariable(
"TXT_LM_FILE", $this->lng->txt(
"file"));
 
  969                         $this->tpl->setVariable(
"TXT_IMPORT", $this->lng->txt(
"import"));
 
  972                         $umf=get_cfg_var(
"upload_max_filesize");
 
  974                         $pms=get_cfg_var(
"post_max_size");
 
  977                         $max_filesize = ((int) $umf < (
int) $pms)
 
  980                         if ((
int) $pms == 0) $max_filesize = $umf;
 
  982                         if (!$max_filesize) $max_filesize=max($umf, $pms);
 
  985                         $this->tpl->setVariable(
"TXT_FILE_INFO", $this->lng->txt(
"file_notice").
" $max_filesize.");
 
  999                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1003                 $this->ctrl->setParameter($this, 
"new_type", $new_type);
 
 1006                 $this->form->setTableWidth(
"600px");
 
 1011                 $ti->setRequired(
true);
 
 1013                 $this->form->addItem($ti);
 
 1019                 $this->form->addItem($ta);
 
 1021                 $this->form->addCommandButton(
"save", $this->lng->txt($new_type.
"_add"));
 
 1022                 $this->form->addCommandButton(
"cancel", $lng->txt(
"cancel"));
 
 1023                 $this->form->
setTitle($this->lng->txt($new_type.
"_new"));
 
 1024                 $this->form->setFormAction($this->ctrl->getFormAction($this, 
"save"));
 
 1034                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1038                 $this->ctrl->setParameter($this, 
"new_type", $new_type);
 
 1041                 $this->form->setTableWidth(
"600px");
 
 1046                 $fi->setRequired(
true);
 
 1048                 $this->form->addItem($fi);
 
 1052                 $cb->
setInfo($this->lng->txt(
""));
 
 1053                 $this->form->addItem($cb);
 
 1055                 $this->form->addCommandButton(
"importFile", $lng->txt(
"import"));
 
 1056                 $this->form->addCommandButton(
"cancel", $lng->txt(
"cancel"));
 
 1058                 $this->form->setTitle($this->lng->txt(
"import_".$new_type));
 
 1059                 $this->form->setFormAction($ilCtrl->getFormAction($this));
 
 1068                 global $rbacadmin, $rbacsystem, 
$tpl;
 
 1073                 if (!$rbacsystem->checkAccess(
"create", 
$_GET[
"ref_id"], 
$_GET[
"new_type"]))
 
 1075                         $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->MESSAGE);
 
 1080                 if ($this->form->checkInput())
 
 1083                         include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
 
 1085                         $newObj->setType($this->type);
 
 1086                         $newObj->setTitle(
$_POST[
"title"]);#
"content object ".$newObj->getId());                
 
 1087                         $newObj->setDescription(
$_POST[
"desc"]);        
 
 1089                         $newObj->createReference();
 
 1090                         $newObj->putInTree(
$_GET[
"ref_id"]);
 
 1091                         $newObj->setPermissions(
$_GET[
"ref_id"]);
 
 1092                         $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
 
 1093                         $newObj->setCleanFrames(
true);
 
 1097                         $newObj->createLMTree();
 
 1102                                 "&baseClass=ilLMEditorGUI");
 
 1107                         $this->form->setValuesByPost();
 
 1108                         $tpl->setContent($this->form->getHtml());
 
 1117                 include_once 
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
 
 1119                 $bib_gui->setObject($this->
object);
 
 1120                 $bibItemName = 
$_POST[
"bibItemName"] ? 
$_POST[
"bibItemName"] : 
$_GET[
"bibItemName"];
 
 1121                 $bibItemIndex = 
$_POST[
"bibItemIndex"] ? 
$_POST[
"bibItemIndex"] : 
$_GET[
"bibItemIndex"];
 
 1122                 if ($bibItemIndex == 
"")
 
 1124                 $bibItemPath = 
$_POST[
"bibItemPath"] ? 
$_POST[
"bibItemPath"] : 
$_GET[
"bibItemPath"];
 
 1125                 if ($bibItemName != 
"")
 
 1127                         $bib_gui->bib_obj->add($bibItemName, $bibItemPath, $bibItemIndex);
 
 1128                         $data = $bib_gui->bib_obj->getElement(
"BibItem");
 
 1129                         $bibItemIndex = (count(
$data) - 1);
 
 1135                 if ($a_target == 
"")
 
 1137                         $a_target = 
"adm_object.php?ref_id=" . $this->
object->getRefId();
 
 1140                 $bib_gui->edit(
"ADM_CONTENT", 
"adm_content", $a_target, $bibItemIndex);
 
 1161                 include_once 
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
 
 1163                 $bib_gui->setObject($this->
object);
 
 1164                 $bibItemIndex = 
$_POST[
"bibItemIndex"] ? 
$_POST[
"bibItemIndex"] : 
$_GET[
"bibItemIndex"];
 
 1165                 $bib_gui->bib_obj->delete(
$_GET[
"bibItemName"], 
$_GET[
"bibItemPath"], $bibItemIndex);
 
 1166                 if (strpos($bibItemIndex, 
",") > 0)
 
 1168                         $bibItemIndex = substr($bibItemIndex, 0, strpos($bibItemIndex, 
","));
 
 1170                 if ($a_target == 
"")
 
 1172                         $a_target = 
"adm_object.php?ref_id=" . $this->
object->getRefId();
 
 1175                 $bib_gui->edit(
"ADM_CONTENT", 
"adm_content", $a_target, $bibItemIndex);
 
 1197                 include_once 
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
 
 1199                 $bib_gui->setObject($this->
object);
 
 1200                 $bibItemIndex = 
$_POST[
"bibItemIndex"] ? 
$_POST[
"bibItemIndex"] : 
$_GET[
"bibItemIndex"];
 
 1202                 if ($bibItemIndex < 0)
 
 1206                 if ($a_target == 
"")
 
 1208                         $a_target = 
"adm_object.php?ref_id=" . $this->
object->getRefId();
 
 1211                 $bib_gui->edit(
"ADM_CONTENT", 
"adm_content", $a_target, $bibItemIndex);
 
 1232                 include_once 
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
 
 1234                 $bib_gui->setObject($this->
object);
 
 1235                 $bibItemIndex = 
$_POST[
"bibItemIndex"] ? 
$_POST[
"bibItemIndex"] : 
$_GET[
"bibItemIndex"];
 
 1237                 if ($bibItemIndex < 0)
 
 1241                 $bibItemIndex = $bib_gui->save($bibItemIndex);
 
 1243                 if ($a_target == 
"")
 
 1245                         $a_target = 
"adm_object.php?ref_id=" . $this->
object->getRefId();
 
 1248                 $bib_gui->edit(
"ADM_CONTENT", 
"adm_content", $a_target, $bibItemIndex);
 
 1294                 global $_FILES, $rbacsystem, 
$ilDB, 
$tpl;
 
 1296                 include_once 
"./Modules/LearningModule/classes/class.ilObjLearningModule.php";
 
 1298                 if (!$rbacsystem->checkAccess(
"create", 
$_GET[
"ref_id"], 
$_GET[
"new_type"]))
 
 1300                         $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->MESSAGE);
 
 1305                 if ($this->form->checkInput())
 
 1308                         include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
 
 1310                         $newObj->setType(
$_GET[
"new_type"]);
 
 1311                         $newObj->setTitle($_FILES[
"xmldoc"][
"name"]);
 
 1312                         $newObj->setDescription(
"");
 
 1313                         $newObj->create(
true);
 
 1314                         $newObj->createReference();
 
 1315                         $newObj->putInTree(
$_GET[
"ref_id"]);
 
 1316                         $newObj->setPermissions(
$_GET[
"ref_id"]);
 
 1317                         $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
 
 1320                         $newObj->createLMTree();
 
 1323                         $mess = $newObj->importFromZipFile($_FILES[
"xmldoc"][
"tmp_name"], $_FILES[
"xmldoc"][
"name"],
 
 1330                                         "&baseClass=ilLMEditorGUI");
 
 1334                                 $link = 
'<a href="'.
"ilias.php?ref_id=".$newObj->getRefId().
 
 1335                                         "&baseClass=ilLMEditorGUI".
'" target="_top">'.$this->lng->txt(
"btn_next").
'</a>';
 
 1336                                 $tpl->setContent(
"<br />".$link.
"<br /><br />".$mess.$link);
 
 1341                         $this->form->setValuesByPost();
 
 1342                         $tpl->setContent($this->form->getHtml());
 
 1355                 if ($ilUser->getPref(
"lm_js_chapter_editing") != 
"disable")
 
 1357                         $ilCtrl->setParameter($this, 
"backcmd", 
"chapters");
 
 1359                         include_once(
"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
 
 1362                         $form_gui->setTitle($this->object->getTitle());
 
 1364                         $form_gui->setTree($this->lm_tree);
 
 1365                         $form_gui->setMaxDepth(0);
 
 1366                         $form_gui->setCurrentTopNodeId($this->tree->getRootId());
 
 1367                         $form_gui->addMultiCommand($lng->txt(
"delete"), 
"delete");
 
 1368                         $form_gui->addMultiCommand($lng->txt(
"cut"), 
"cutItems");
 
 1369                         $form_gui->addMultiCommand($lng->txt(
"copy"), 
"copyItems");
 
 1371                         $form_gui->addCommand($lng->txt(
"cont_save_all_titles"), 
"saveAllTitles");
 
 1372                         $up_gui = ($this->
object->getType() == 
"dbk")
 
 1374                                 : 
"ilobjlearningmodulegui";
 
 1375                         $form_gui->setExplorerUpdater(
"tree", 
"tree_div",
 
 1376                                 $ilCtrl->getLinkTargetByClass($up_gui, 
"explorer", 
"", 
true));
 
 1378                         $ctpl = 
new ilTemplate(
"tpl.chap_and_pages.html", 
true, 
true, 
"Modules/LearningModule");
 
 1379                         $ctpl->setVariable(
"HIERARCHY_FORM", $form_gui->getHTML());
 
 1380                         $ilCtrl->setParameter($this, 
"obj_id", 
"");
 
 1381                         $ctpl->setVariable(
"HREF_NO_JS_EDIT",
 
 1382                                 $ilCtrl->getLinkTarget($this, 
"deactivateJSChapterEditing"));
 
 1383                         $ctpl->setVariable(
"TXT_NO_JS_EDIT",
 
 1384                                 $lng->txt(
"cont_not_js_chap_editing"));
 
 1386                         $this->tpl->setContent($ctpl->get());
 
 1390                         $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.structure_edit.html", 
"Modules/LearningModule");
 
 1393                         $this->ctrl->setParameter($this, 
"backcmd", 
"chapters");
 
 1394                         $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
 1395                         $this->tpl->setVariable(
"HEADER_TEXT", $this->lng->txt(
"cont_chapters"));
 
 1399                         $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
 
 1400                         foreach ($childs as $child)
 
 1402                                 if($child[
"type"] != 
"st")
 
 1407                                 $this->tpl->setCurrentBlock(
"table_row");
 
 1412                                 $this->tpl->setVariable(
"CHECKBOX_ID", $child[
"obj_id"]);
 
 1413                                 $this->tpl->setVariable(
"CSS_ROW", $css_row);
 
 1417                                 $this->ctrl->setParameter($this, 
"backcmd", 
"");
 
 1418                                 $this->ctrl->setParameterByClass(
"ilStructureObjectGUI", 
"obj_id", $child[
"obj_id"]);
 
 1419                                 $this->tpl->setVariable(
"LINK_TARGET",
 
 1420                                         $this->ctrl->getLinkTargetByClass(
"ilStructureObjectGUI", 
"view"));
 
 1423                                 $this->tpl->setVariable(
"TEXT_CONTENT",
 
 1425                                         $this->object->isActiveNumbering()));
 
 1427                                 $this->tpl->parseCurrentBlock();
 
 1430                         $paste_active = 
false;
 
 1431                         if ($ilUser->clipboardHasObjectsOfType(
"st"))
 
 1433                                 $paste_active = 
true;
 
 1436                         if($cnt == 0 && !$paste_active)
 
 1438                                 $this->tpl->setCurrentBlock(
"notfound");
 
 1439                                 $this->tpl->setVariable(
"NUM_COLS", 3);
 
 1440                                 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
 
 1441                                 $this->tpl->parseCurrentBlock();
 
 1446                                 $this->tpl->setVariable(
"NUM_COLS", 3);
 
 1449                                         $acts = array(
"delete" => 
"delete", 
"cutChapter" => 
"cut",
 
 1450                                                 "copyChapter" => 
"copyChapter");
 
 1454                                         $acts[
"pasteChapter"] =  
"pasteChapter";
 
 1460                         $this->tpl->setVariable(
"NUM_COLS", 3);
 
 1461                         $subobj = array(
"st");
 
 1463                         $this->tpl->setCurrentBlock(
"add_object");
 
 1464                         $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
 
 1465                         $this->tpl->setVariable(
"BTN_NAME", 
"create");
 
 1466                         $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"insert"));
 
 1467                         $this->tpl->parseCurrentBlock();
 
 1469                         $this->tpl->setCurrentBlock(
"form");
 
 1470                         $this->tpl->parseCurrentBlock();
 
 1472                         $this->tpl->setVariable(
"HREF_JS_EDIT",
 
 1473                                 $ilCtrl->getLinkTarget($this, 
"activateJSChapterEditing"));
 
 1474                         $this->tpl->setVariable(
"TXT_JS_EDIT",
 
 1475                                 $lng->txt(
"cont_js_chap_editing"));
 
 1489                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.all_pages.html", 
"Modules/LearningModule");
 
 1492                 $this->tpl->setCurrentBlock(
"form");
 
 1493                 $this->ctrl->setParameter($this, 
"backcmd", 
"pages");
 
 1494                 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
 1495                 $this->tpl->setVariable(
"HEADER_TEXT", $this->lng->txt(
"cont_pages"));
 
 1496                 $this->tpl->setVariable(
"CONTEXT", $this->lng->txt(
"cont_usage"));
 
 1501                 foreach ($pages as $page)
 
 1503                         $this->tpl->setCurrentBlock(
"table_row");
 
 1506                         include_once(
"./Services/COPage/classes/class.ilPageObject.php");
 
 1509                                 $lm_set->get(
"time_scheduled_page_activation"));
 
 1512                         $img_sc = ($lm_set->get(
"time_scheduled_page_activation") &&
 
 1520                                 $this->tpl->setVariable(
"IMG_ALT",
 
 1521                                         $this->lng->txt(
"cont_page_deactivated"));
 
 1526                                         $this->object->getType()))
 
 1529                                         $this->tpl->setVariable(
"IMG_ALT",
 
 1530                                                 $this->lng->txt(
"cont_page_deactivated_elements"));
 
 1535                                         $this->tpl->setVariable(
"IMG_ALT",
 
 1536                                                 $this->lng->txt(
"pg"));
 
 1544                         $this->tpl->setVariable(
"CHECKBOX_ID", $page[
"obj_id"]);
 
 1545                         $this->tpl->setVariable(
"CSS_ROW", $css_row);
 
 1548                         $this->ctrl->setParameter($this, 
"backcmd", 
"");
 
 1549                         $this->ctrl->setParameterByClass(
"ilLMPageObjectGUI", 
"obj_id", $page[
"obj_id"]);
 
 1551                         $this->tpl->setVariable(
"LINK_TARGET",
 
 1552                                 $this->ctrl->getLinkTargetByClass(
"ilLMPageObjectGUI", 
"edit"));
 
 1555                         $this->tpl->setVariable(
"TEXT_CONTENT", $page[
"title"]);
 
 1558                         if ($this->lm_tree->isInTree($page[
"obj_id"]))
 
 1569                         if ($page[
"obj_id"] == $this->object->getHeaderPage())
 
 1571                                 $add_str = 
" <b>(".$this->lng->txt(
"cont_header").
")</b>";
 
 1573                         if ($page[
"obj_id"] == $this->object->getFooterPage())
 
 1575                                 $add_str = 
" <b>(".$this->lng->txt(
"cont_footer").
")</b>";
 
 1578                         $this->tpl->setVariable(
"TEXT_CONTEXT", $path_str.$add_str);
 
 1581                         $this->tpl->parseCurrentBlock();
 
 1585                         $this->tpl->setCurrentBlock(
"notfound");
 
 1586                         $this->tpl->setVariable(
"NUM_COLS", 4);
 
 1587                         $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
 
 1588                         $this->tpl->parseCurrentBlock();
 
 1592                         $acts = array(
"delete" => 
"delete", 
"movePage" => 
"movePage", 
"copyPage" => 
"copyPage",
 
 1593                                 "selectHeader" => 
"selectHeader", 
"selectFooter" => 
"selectFooter",
 
 1594                                 "activatePages" => 
"cont_de_activate");
 
 1598                                 $acts[
"pastePage"] = 
"pastePage";
 
 1606                         $this->tpl->setVariable(
"NUM_COLS", 4);
 
 1619                 $this->tpl->setVariable(
"NUM_COLS", 4);
 
 1621                 $subobj = array(
"pg");
 
 1623                 $this->tpl->setCurrentBlock(
"add_object");
 
 1624                 $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
 
 1625                 $this->tpl->setVariable(
"BTN_NAME", 
"create");
 
 1626                 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"create"));
 
 1627                 $this->tpl->parseCurrentBlock();
 
 1630                 $this->tpl->setCurrentBlock(
"form");
 
 1631                 $this->tpl->parseCurrentBlock();
 
 1645                 include_once(
"./Modules/LearningModule/classes/class.ilLinksTableGUI.php");
 
 1647                         $this->object->getId(), $this->
object->getType());
 
 1649                 $tpl->setContent($table_gui->getHTML());
 
 1658                 if (is_array(
$_POST[
"id"]))
 
 1660                         foreach(
$_POST[
"id"] as $id)
 
 1662                                 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
 
 1668                 $this->ctrl->redirect($this, 
"pages");
 
 1678                 $ilUser->writePref(
"lm_js_chapter_editing", 
"disable");
 
 1679                 $ilCtrl->redirect($this, 
"chapters");
 
 1689                 $ilUser->writePref(
"lm_js_chapter_editing", 
"enable");
 
 1690                 $ilCtrl->redirect($this, 
"chapters");
 
 1700                         $this->ilias->raiseError($this->lng->txt(
"no_page_in_clipboard"),$this->ilias->error_obj->MESSAGE);
 
 1711                                 == $this->object->getID())
 
 1714                                 $new_page =& $lm_page->copy();
 
 1715                                 $id = $new_page->getId();
 
 1721                                 $lm_obj =& $this->ilias->obj_factory->getInstanceByObjId($lm_id);
 
 1723                                 $copied_nodes = array();
 
 1724                                 $new_page =& $lm_page->copyToOtherContObject($this->
object, $copied_nodes);
 
 1725                                 $id = $new_page->getId();
 
 1735                                 != $this->object->getID())
 
 1738                                 $lm_obj =& $this->ilias->obj_factory->getInstanceByObjId($lm_id);
 
 1740                                 $lm_page->setLMId($this->object->getID());
 
 1742                                 $page =& $lm_page->getPageObject();
 
 1744                                 $page->setParentId($this->object->getID());
 
 1751                 $this->ctrl->redirect($this, 
"pages");
 
 1761                         $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
 
 1770                 $this->ctrl->redirect($this, 
"pages");
 
 1780         function delete($a_parent_subobj_id = 0)
 
 1784                         $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
 
 1789                         $this->ilias->raiseError($this->lng->txt(
"cont_select_item"), $this->ilias->error_obj->MESSAGE);
 
 1792                 if ($a_parent_subobj_id == 0)
 
 1800                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.confirm_deletion.html", 
"Modules/LearningModule");
 
 1804                 if ($a_parent_subobj_id != 0)
 
 1806                         $this->ctrl->setParameterByClass(
"ilStructureObjectGUI", 
"backcmd", 
$_GET[
"backcmd"]);
 
 1807                         $this->ctrl->setParameterByClass(
"ilStructureObjectGUI", 
"obj_id", $a_parent_subobj_id);
 
 1808                         $this->tpl->setVariable(
"FORMACTION",
 
 1809                                 $this->ctrl->getFormActionByClass(
"ilStructureObjectGUI"));
 
 1813                         $this->ctrl->setParameter($this, 
"backcmd", 
$_GET[
"backcmd"]);
 
 1814                         $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
 1817                 $this->tpl->setCurrentBlock(
"table_header");
 
 1818                 $this->tpl->setVariable(
"TEXT",$this->lng->txt(
"objects"));
 
 1819                 $this->tpl->parseCurrentBlock();
 
 1826                 foreach(
$_POST[
"id"] as $id)
 
 1831                                 switch($obj->getType())         
 
 1840                                 $this->tpl->setCurrentBlock(
"table_row");
 
 1842                                 $this->tpl->setVariable(
"TEXT_CONTENT", $obj->getTitle());
 
 1843                                 $this->tpl->parseCurrentBlock();
 
 1849                 $buttons = array( 
"cancelDelete"  => $this->lng->txt(
"cancel"),
 
 1850                                                                   "confirmedDelete"  => $this->lng->txt(
"confirm"));
 
 1851                 foreach ($buttons as $name => $value)
 
 1853                         $this->tpl->setCurrentBlock(
"operation_btn");
 
 1854                         $this->tpl->setVariable(
"BTN_NAME",$name);
 
 1855                         $this->tpl->setVariable(
"BTN_VALUE",$value);
 
 1856                         $this->tpl->parseCurrentBlock();
 
 1865                 session_unregister(
"saved_post");
 
 1867                 $this->ctrl->redirect($this, 
$_GET[
"backcmd"]);
 
 1881                 $tree->setTableNames(
'lm_tree',
'lm_data');
 
 1882                 $tree->setTreeTablePK(
"lm_id");
 
 1887                         $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
 
 1891                 foreach (
$_SESSION[
"saved_post"] as $id)
 
 1896                                 $node_data = 
$tree->getNodeData($id);
 
 1897                                 if (is_object($obj))
 
 1899                                         $obj->setLMId($this->object->getId());
 
 1901                                         include_once(
"classes/class.ilHistory.php");
 
 1904                                                 $this->
object->getType());
 
 1908                                 if(
$tree->isInTree($id))
 
 1910                                         $tree->deleteTree($node_data);
 
 1916                 $this->
object->checkTree();
 
 1921                 if ($a_parent_subobj_id == 0)
 
 1923                         $this->ctrl->redirect($this, 
$_GET[
"backcmd"]);
 
 1939                 $tmpPath = $this->lm_tree->getPathFull($a_endnode_id, $a_startnode_id);
 
 1942                 for ($i = 1; $i < (count($tmpPath) - 1); $i++)
 
 1949                         $path .= $tmpPath[$i][
"title"];
 
 1964                 foreach ($a_actions as $name => 
$lng)
 
 1966                         $d[$name] = array(
"name" => $name, 
"lng" => 
$lng);
 
 1969                 $notoperations = array();
 
 1971                 $operations = array();
 
 1977                                 if (!in_array($row[
"name"], $notoperations))
 
 1979                                         $operations[] = 
$row;
 
 1984                 if (count($operations)>0)
 
 1986                         foreach ($operations as $val)
 
 1988                                 $this->tpl->setCurrentBlock(
"operation_btn");
 
 1989                                 $this->tpl->setVariable(
"BTN_NAME", $val[
"name"]);
 
 1990                                 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt($val[
"lng"]));
 
 1991                                 $this->tpl->parseCurrentBlock();
 
 1994                         $this->tpl->setCurrentBlock(
"operation");
 
 1996                         $this->tpl->parseCurrentBlock();
 
 2007                 $this->
setFormAction(
"addRole", $this->ctrl->getLinkTarget($this, 
"addRole"));
 
 2008                 $this->
setFormAction(
"permSave", $this->ctrl->getLinkTarget($this, 
"permSave"));
 
 2009                 $this->permObject();
 
 2018                 $this->
setReturnLocation(
"permSave", $this->ctrl->getLinkTarget($this, 
"perm"));
 
 2019                 $this->permSaveObject();
 
 2028                 $this->infoObject();
 
 2038                 $this->addRoleObject();
 
 2048                 $this->ownerObject();
 
 2057                 if (strtolower(
$_GET[
"baseClass"]) == 
"iladministrationgui")
 
 2076                         $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
 
 2079                 if(count(
$_POST[
"id"]) > 1)
 
 2081                         $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
 
 2086                         $this->ilias->raiseError($this->lng->txt(
"cont_select_item"), $this->ilias->error_obj->MESSAGE);
 
 2094                 if ($a_parent_subobj_id == 0)
 
 2096                         $this->ctrl->redirect($this, 
"chapters");
 
 2111                         $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
 
 2114                 if(count(
$_POST[
"id"]) > 1)
 
 2116                         $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
 
 2121                         $this->ilias->raiseError($this->lng->txt(
"cont_select_item"), $this->ilias->error_obj->MESSAGE);
 
 2127                 ilUtil::sendInfo($this->lng->txt(
"cont_chap_copy_select_target_now"), 
true);
 
 2129                 if ($a_parent_subobj_id == 0)
 
 2131                         $this->ctrl->redirect($this, 
"chapters");
 
 2145                         $this->ilias->raiseError($this->lng->txt(
"no_chapter_in_clipboard"),$this->ilias->error_obj->MESSAGE);
 
 2148                 $target_tree = 
new ilTree($this->object->getId());
 
 2150                 $target_tree->setTreeTablePK(
"lm_id");
 
 2154                         != $this->object->getID())
 
 2157                         $source_tree->setTableNames(
'lm_tree',
'lm_data');
 
 2158                         $source_tree->setTreeTablePK(
"lm_id");
 
 2162                         $source_tree =& $target_tree;
 
 2167                 $node = $source_tree->getNodeData($id);
 
 2168                 $subnodes = $source_tree->getSubtree($node);
 
 2169                 foreach ($subnodes as $subnode)
 
 2171                         if($subnode[
"obj_id"] == $a_parent_subobj_id)
 
 2173                                 $this->ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->ilias->error_obj->MESSAGE);
 
 2176                 if(
$_POST[
"id"][0] == $id)
 
 2179                         $this->ctrl->redirect($this, 
"chapters");
 
 2183                 $parent = ($a_parent_subobj_id == 0)
 
 2184                         ? $target_tree->getRootId()
 
 2185                         : $a_parent_subobj_id;
 
 2194                         $target = 
$_POST[
"id"][0];
 
 2198                         $childs =& $target_tree->getChildsByType($parent, 
"pg");
 
 2199                         if (count($childs) != 0)
 
 2201                                 $target = $childs[count($childs) - 1][
"obj_id"];
 
 2211                                 != $this->object->getID())
 
 2216                                 if ($a_parent_subobj_id == 0)
 
 2218                                         $this->ctrl->redirect($this, 
"chapters");
 
 2223                         $target_tree->deleteTree($node);
 
 2225                         if (!$target_tree->isInTree($id))
 
 2227                                 $target_tree->insertNode($id, $parent, $target);
 
 2229                                 foreach ($subnodes as $node)
 
 2233                                         if($node[
"obj_id"] != $id)
 
 2235                                                 $target_tree->insertNode($node[
"obj_id"], $node[
"parent"]);
 
 2244                         $copied_nodes = array();
 
 2246                                 == $this->object->getID())
 
 2249                                 $source_obj->setLMId($this->object->getId());
 
 2250                                 $source_obj->copy($target_tree, $parent, $target, $copied_nodes);
 
 2258                                 $source_obj->setLMId($lm_id);
 
 2259                                 $source_obj->copy($target_tree, $parent, $target, $copied_nodes);
 
 2268                 $this->
object->checkTree();
 
 2270                 if ($a_parent_subobj_id == 0)
 
 2272                         $this->ctrl->redirect($this, 
"chapters");
 
 2283                         $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
 
 2290                 $this->ctrl->redirect($this, 
"pages");
 
 2298                 if (
$_GET[
"new_type"] == 
"pg")
 
 2300                         $this->ctrl->redirect($this, 
"pages");
 
 2304                         $this->ctrl->redirect($this, 
"chapters");
 
 2314                 require_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
 
 2316                 $cont_exp->buildExportFile();
 
 2327                 $changelink = 
"<a href='".$ilCtrl->getLinkTarget($this, 
"editMenuProperties").
"'>".$lng->txt(
"change").
"</a>";
 
 2328                 if (!$this->object->isActiveLMMenu())
 
 2330                         $add = 
"<br />".$lng->txt(
"cont_download_no_menu").
" ".$changelink;
 
 2332                 else if (!$this->object->isActiveDownloads())
 
 2334                         $add = 
"<br />".$lng->txt(
"cont_download_no_download").
" ".$changelink;
 
 2338                 if ($this->object->getPublicExportFile($a_type) == $a_file)
 
 2340                         return $lng->txt(
"yes").$add;
 
 2355                 if(!isset($a_files))
 
 2361                         foreach ($a_files as $f)
 
 2363                                 $file = explode(
":", $f);
 
 2364                                 $export_dir = $this->
object->getExportDirectory(
$file[0]);
 
 2366                                 if ($this->object->getPublicExportFile(
$file[0]) ==
 
 2369                                         $this->
object->setPublicExportFile(
$file[0], 
"");
 
 2373                                         $this->
object->setPublicExportFile(
$file[0], 
$file[1]);
 
 2376                         $this->
object->update();
 
 2378                 $ilCtrl->redirectByClass(
"ilexportgui");
 
 2386                 if(!isset(
$_POST[
"file"]))
 
 2388                         $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
 
 2391                 if (count(
$_POST[
"file"]) > 1)
 
 2393                         $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
 
 2397                 $export_dir = $this->
object->getOfflineDirectory();
 
 2411                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.confirm.html");
 
 2413                 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
 2416                 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"confirmation"));
 
 2417                 $this->tpl->setVariable(
"TXT_CONTENT", $this->lng->txt(
"cont_fix_tree_confirm"));
 
 2418                 $this->tpl->setVariable(
"CMD_CANCEL", 
"cancelFixTree");
 
 2419                 $this->tpl->setVariable(
"CMD_OK", 
"fixTree");
 
 2420                 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
 
 2421                 $this->tpl->setVariable(
"TXT_OK", $this->lng->txt(
"cont_fix_tree"));
 
 2440                 $this->ctrl->redirect($this, 
"properties");
 
 2448                 $this->
object->fixTree();
 
 2450                 $this->ctrl->redirect($this, 
"properties");
 
 2457                 $a_active = 
"content", $a_use_global_tabs = 
false, $a_as_subtabs = 
false,
 
 2460                 global 
$ilCtrl,$ilUser, $ilAccess, $ilTabs, $rbacsystem, $ilPluginAdmin;
 
 2465                         $addcmd = 
"addSubTabTarget";
 
 2466                         $getcmd = 
"getSubTabHTML";
 
 2470                         $addcmd = 
"addTarget";
 
 2471                         $getcmd = 
"getHTML";
 
 2474                 $active[$a_active] = 
true;
 
 2476                 if (!$this->object->isActiveLMMenu())
 
 2481                 if ($a_use_global_tabs)
 
 2483                         $tabs_gui = $ilTabs;
 
 2493                 $showViewInFrameset = 
true;
 
 2495                 if ($showViewInFrameset && !$a_offline)
 
 2501                         $buttonTarget = 
"_top";
 
 2504                 if ($a_export_format == 
"scorm")
 
 2509                 $requires_purchase_to_access = 
false;
 
 2510                 if(IS_PAYMENT_ENABLED)
 
 2512                         include_once 
'Services/Payment/classes/class.ilPaymentObject.php';
 
 2517                 if (!$a_offline && $ilAccess->checkAccess(
"read", 
"", 
$_GET[
"ref_id"]))
 
 2519                         $ilCtrl->setParameterByClass(
"illmpresentationgui", 
"obj_id", 
$_GET[
"obj_id"]);
 
 2520                         $tabs_gui->$addcmd(
"content",
 
 2521                                 $ilCtrl->getLinkTargetByClass(
"illmpresentationgui", 
"layout"),
 
 2522                                 "", 
"", $buttonTarget,  $active[
"content"]);
 
 2526                 if (!$requires_purchase_to_access && $this->object->isActiveTOC() && $ilAccess->checkAccess(
"read", 
"", 
$_GET[
"ref_id"]))
 
 2530                                 $ilCtrl->setParameterByClass(
"illmpresentationgui", 
"obj_id", 
$_GET[
"obj_id"]);
 
 2531                                 $link = $ilCtrl->getLinkTargetByClass(
"illmpresentationgui", 
"showTableOfContents");
 
 2535                                 $link = 
"./table_of_contents.html";
 
 2538                         $tabs_gui->$addcmd(
"cont_toc", $link,
 
 2539                                         "", 
"", $buttonTarget, $active[
"toc"]);
 
 2543                 if (!$requires_purchase_to_access && $this->object->isActivePrintView() && $ilAccess->checkAccess(
"read", 
"", 
$_GET[
"ref_id"]))
 
 2547                                 $ilCtrl->setParameterByClass(
"illmpresentationgui", 
"obj_id", 
$_GET[
"obj_id"]);
 
 2548                                 $link = $ilCtrl->getLinkTargetByClass(
"illmpresentationgui", 
"showPrintViewSelection");
 
 2549                                 $tabs_gui->$addcmd(
"cont_print_view", $link,
 
 2550                                         "", 
"", $buttonTarget, $active[
"print"]);
 
 2555                 if (!$requires_purchase_to_access && $ilUser->getId() == ANONYMOUS_USER_ID)
 
 2557                         $is_public = $this->
object->isActiveDownloadsPublic();
 
 2559                 else if(!$requires_purchase_to_access)
 
 2564                 if (!$requires_purchase_to_access && $this->object->isActiveDownloads() && !$a_offline && $is_public &&
 
 2565                         $ilAccess->checkAccess(
"read", 
"", 
$_GET[
"ref_id"]))
 
 2567                         $ilCtrl->setParameterByClass(
"illmpresentationgui", 
"obj_id", 
$_GET[
"obj_id"]);
 
 2568                         $link = $ilCtrl->getLinkTargetByClass(
"illmpresentationgui", 
"showDownloadList");
 
 2569                         $tabs_gui->$addcmd(
"download", $link,
 
 2570                                 "", 
"", $buttonTarget, $active[
"download"]);
 
 2574                 if ($a_export_format != 
"scorm" && !$a_offline)
 
 2578                                 $ilCtrl->setParameterByClass(
"illmpresentationgui", 
"obj_id", 
$_GET[
"obj_id"]);
 
 2579                                 $link = $this->ctrl->getLinkTargetByClass(
 
 2580                                                 array(
"illmpresentationgui", 
"ilinfoscreengui"), 
"showSummary");
 
 2584                                 $link = 
"./info.html";
 
 2587                         $tabs_gui->$addcmd(($requires_purchase_to_access ? 
'buy' : 
'info_short'), $link,
 
 2588                                         "", 
"", $buttonTarget, $active[
"info"]);
 
 2592                 if (!$a_offline && $a_cur_page > 0)
 
 2594                         if ($rbacsystem->checkAccess(
"write", 
$_GET[
"ref_id"]))
 
 2597                                 $page_id = $a_cur_page;
 
 2598                                 $tabs_gui->$addcmd(
"edit_page", ILIAS_HTTP_PATH.
"/ilias.php?baseClass=ilLMEditorGUI&ref_id=".
$_GET[
"ref_id"].
 
 2599                                         "&obj_id=".$page_id.
"&to_page=1",
 
 2600                                         "", 
"", $buttonTarget, $active[
"edit_page"]);
 
 2604                 if(!$requires_purchase_to_access)
 
 2608                         $entries = $this->lmme_obj->getMenuEntries(
true);
 
 2610                         if (count($entries) > 0 && $ilAccess->checkAccess(
"read", 
"", 
$_GET[
"ref_id"]))
 
 2612                                 foreach ($entries as $entry)
 
 2615                                         if ($entry[
"type"] == 
"intern")
 
 2617                                                 $entry[
"link"] = ILIAS_HTTP_PATH.
"/goto.php?target=".$entry[
"link"];
 
 2621                                         if (!strstr($entry[
"link"],
'://') && !strstr($entry[
"link"],
'mailto:'))
 
 2623                                                 $entry[
"link"] = 
"http://".$entry[
"link"];
 
 2626                                         if (!strstr($entry[
"link"],
'mailto:'))
 
 2630                                         $tabs_gui->$addcmd($entry[
"title"],
 
 2632                                                 "", 
"", 
"_blank", 
"", 
true);
 
 2638                 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE, 
"UIComponent", 
"uihk");
 
 2639                 $plugin_html = 
false;
 
 2640                 foreach ($pl_names as $pl)
 
 2643                         $gui_class = $ui_plugin->getUIClassInstance();
 
 2644                         $resp = $gui_class->modifyGUI(
"Modules/LearningModule", 
"lm_menu_tabs",
 
 2645                                 array(
"lm_menu_tabs" => $tabs_gui));
 
 2649                 return $tabs_gui->$getcmd();
 
 2657                 require_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
 
 2659                 $cont_exp->buildExportFile();
 
 2660                 $this->offlineList();
 
 2668                 require_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
 
 2670                 $cont_exp->buildExportFile();
 
 2680                 require_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
 
 2682                 $cont_exp->buildExportFile();
 
 2698                 $this->ctrl->addLocation(
 
 2702                 $par_id = $tree->getParentId(
$_GET[
"ref_id"]);
 
 2703                 $this->ctrl->addLocation(
 
 2705                         "repository.php?cmd=frameset&ref_id=".$par_id,
 
 2707                 if (!$a_omit_obj_id)
 
 2711                 $lmtree =& $this->
object->getTree();
 
 2719                         $path = $lmtree->getPathFull($lmtree->getRootId());
 
 2722                                 $path[] = array(
"type" => 
"pg", 
"child" => $this->obj_id,
 
 2731                         if (
$row[
"child"] == 1)
 
 2733                                 $this->ctrl->setParameter($this, 
"obj_id", 
"");
 
 2734                                 $this->ctrl->addLocation(
 
 2735                                         $this->object->getTitle(),
 
 2736                                         $this->ctrl->getLinkTarget($this, 
"chapters"), 
"", 
$_GET[
"ref_id"]);
 
 2741                                 switch(
$row[
"type"])
 
 2744                                                 $this->ctrl->setParameterByClass(
"ilstructureobjectgui", 
"obj_id", 
$row[
"child"]);
 
 2745                                                 $this->ctrl->addLocation(
 
 2747                                                         $this->ctrl->getLinkTargetByClass(
"ilstructureobjectgui", 
"view"));
 
 2751                                                 $this->ctrl->setParameterByClass(
"illmpageobjectgui", 
"obj_id", 
$row[
"child"]);
 
 2752                                                 $this->ctrl->addLocation(
 
 2754                                                         $this->ctrl->getLinkTargetByClass(
"illmpageobjectgui", 
"edit"));
 
 2759                 if (!$a_omit_obj_id)
 
 2761                         $this->ctrl->setParameter($this, 
"obj_id", 
$_GET[
"obj_id"]);
 
 2782                 include_once(
"./Modules/LearningModule/classes/class.ilLMQuestionListTableGUI.php");
 
 2784                 $tpl->setContent($table->getHTML());
 
 2799                 #include_once("classes/class.ilTabsGUI.php"); 
 2800                 #$tabs_gui =& new ilTabsGUI(); 
 2801                 $this->
getTabs($this->tabs_gui);
 
 2802                 $this->tpl->setCurrentBlock(
"header_image");
 
 2804                 $this->tpl->parseCurrentBlock();
 
 2805                 $this->tpl->setCurrentBlock(
"content");
 
 2806                 #$this->tpl->setVariable("TABS", $tabs_gui->getHTML()); 
 2807                 $this->tpl->setVariable(
"HEADER", $this->object->getTitle());
 
 2820                 $ilTabs->addSubtab(
"internal_links",
 
 2821                         $lng->txt(
"cont_internal_links"),
 
 2822                         $ilCtrl->getLinkTarget($this, 
"listLinks"));
 
 2824                 if ($this->object->getType() == 
"lm")
 
 2826                         if(@include_once(
'HTTP/Request.php'))
 
 2828                                 $ilTabs->addSubtab(
"link_check",
 
 2829                                         $lng->txt(
"link_check"),
 
 2830                                         $ilCtrl->getLinkTarget($this, 
"linkChecker"));
 
 2834                 $ilTabs->activateSubTab($a_active);
 
 2835                 $ilTabs->activateTab(
"cont_links");
 
 2846                 global $rbacsystem,$ilUser;
 
 2852                 $tabs_gui->addTarget(
"cont_chapters",
 
 2853                         $this->ctrl->getLinkTarget($this, 
"chapters"),
 
 2854                         "chapters", get_class($this));
 
 2857                 $tabs_gui->addTarget(
"cont_all_pages",
 
 2858                         $this->ctrl->getLinkTarget($this, 
"pages"),
 
 2859                         "pages", get_class($this));
 
 2862                 $tabs_gui->addTarget(
"objs_qst",
 
 2863                         $this->ctrl->getLinkTarget($this, 
"listQuestions"),
 
 2864                         "listQuestions", get_class($this));
 
 2867                 $tabs_gui->addTarget(
"info_short",
 
 2868                         $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
'showSummary'),
 
 2869                         "", 
"ilinfoscreengui");
 
 2872                 $tabs_gui->addTarget(
"settings",
 
 2873                         $this->ctrl->getLinkTarget($this,
'properties'),
 
 2874                         "properties", get_class($this));
 
 2877                 include_once 
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
 
 2880                         $tabs_gui->addTarget(
'learning_progress',
 
 2881                                                                  $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui'),
''),
 
 2883                                                                  array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui',
'illmstatisticsgui'));
 
 2887                 $tabs_gui->addTarget(
"cont_links",
 
 2888                         $this->ctrl->getLinkTarget($this,
'listLinks'),
 
 2889                         "listLinks", get_class($this));
 
 2891                 if ($this->object->getType() != 
"lm")
 
 2894                         $tabs_gui->addTarget(
"bib_data",
 
 2895                                 $this->ctrl->getLinkTarget($this, 
"editBibItem"),
 
 2896                                 "editBibItem", get_class($this));
 
 2899                 $tabs_gui->addTarget(
"history", $this->ctrl->getLinkTarget($this, 
"history")
 
 2900                         , 
"history", get_class($this));
 
 2902                 $tabs_gui->addTarget(
"meta_data",
 
 2903                         $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
''),
 
 2904                         "", 
"ilmdeditorgui");
 
 2906                 if ($this->object->getType() == 
"lm")
 
 2909                         $tabs_gui->addTarget(
"export",
 
 2910                                 $this->ctrl->getLinkTargetByClass(
"ilexportgui", 
""),
 
 2915                 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
 
 2917                         $tabs_gui->addTarget(
"perm_settings",
 
 2918                                 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'), 
"perm"), array(
"perm",
"info",
"owner"), 
'ilpermissiongui');
 
 2929                 if (in_array($a_active,
 
 2930                         array(
"cont_general_properties", 
"cont_style", 
"cont_lm_menu", 
"public_section")))
 
 2933                         $ilTabs->addSubTabTarget(
"cont_general_properties",
 
 2934                                 $this->ctrl->getLinkTarget($this, 
'properties'),
 
 2938                         $ilTabs->addSubTabTarget(
"cont_style",
 
 2939                                 $this->ctrl->getLinkTarget($this, 
'editStyleProperties'),
 
 2943                         $ilTabs->addSubTabTarget(
"cont_lm_menu",
 
 2944                                 $this->ctrl->getLinkTarget($this, 
'editMenuProperties'),
 
 2947                         if ($ilSetting->get(
"pub_section"))
 
 2949                                 if ($this->object->getType() != 
"dbk")
 
 2952                                         $ilTabs->addSubTabTarget(
"public_section",
 
 2953                                                 $this->ctrl->getLinkTarget($this, 
'editPublicSection'),
 
 2958                         $ilTabs->setSubTabActive($a_active);
 
 2968                 $ilTabs->setTabActive(
"settings");
 
 2970                 switch ($this->object->getType())
 
 2973                                 $gui_class = 
"ilobjlearningmodulegui";
 
 2977                                 $gui_class = 
"ilobjdlbookgui";
 
 2984                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.lm_public_selector.html");
 
 2987                 require_once (
"./Modules/LearningModule/classes/class.ilPublicSectionSelector.php");
 
 2995                 $output = $exp->getOutput();
 
 2998                 foreach ($exp->format_options as $node)
 
 3000                         if (!$node[
"container"])
 
 3002                                 $pages[] = $node[
"child"];
 
 3011                 $this->tpl->setVariable(
"TXT_SET_PUBLIC_MODE", $this->lng->txt(
"set_public_mode"));
 
 3012                 $this->tpl->setVariable(
"TXT_CHOOSE_PUBLIC_MODE", $this->lng->txt(
"choose_public_mode"));
 
 3013                 $modes = array(
"complete" => $this->lng->txt(
"all_pages"), 
"selected" => $this->lng->txt(
"selected_pages_only"));
 
 3014                 $select_public_mode = 
ilUtil::formSelect ($this->object->getPublicAccessMode(),
"lm_public_mode",$modes, 
false, 
true);
 
 3015                 $this->tpl->setVariable(
"SELECT_PUBLIC_MODE", $select_public_mode);
 
 3017                 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"choose_public_pages"));
 
 3018                 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
 
 3019                 $this->tpl->setVariable(
"EXPLORER",$output);
 
 3020                 $this->tpl->setVariable(
"ONCLICK",$js_pages);
 
 3021                 $this->tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
 
 3022                 $this->tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
 
 3023                 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
 
 3024                 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getLinkTarget($this, 
"savePublicSection"));
 
 3032                 $this->
object->setPublicAccessMode(
$_POST[
"lm_public_mode"]);
 
 3033                 $this->
object->updateProperties();
 
 3036                 $this->ctrl->redirect($this, 
"editPublicSection");
 
 3048                 require_once(
"classes/class.ilHistoryGUI.php");
 
 3050                         $this->
object->getType());
 
 3052                         $this->ctrl->getParameterArray($this, 
"history"),
 
 3053                         $this->
object->isActiveHistoryUserComments()
 
 3056                 $this->tpl->setVariable(
"ADM_CONTENT", $hist_html);
 
 3071                 require_once 
'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
 
 3073                 $actions->setSelectionHeaderClass(
'small');     
 
 3074                 $actions->setItemLinkClass(
'xsmall');           
 
 3075                 $actions->setListTitle($this->lng->txt(
'actions'));             
 
 3077                 $this->ctrl->setParameterByClass(
'ilLMPageObjectGUI', 
'obj_id', $row[
'page_id']);
 
 3079                         $this->lng->txt(
'edit'),
 
 3081                         $this->ctrl->getLinkTargetByClass(
'ilLMPageObjectGUI', 
'edit')
 
 3083                 $this->ctrl->clearParametersByClass(
'ilLMPageObjectGUI');
 
 3084                 $row[
'action_html'] = 
$actions->getHTML();              
 
 3098                 require_once 
'Services/LinkChecker/classes/class.ilLinkCheckerTableGUI.php';
 
 3102                 if((
bool)$ilias->getSetting(
'cron_web_resource_check'))
 
 3104                         include_once 
'classes/class.ilLinkCheckNotify.php';
 
 3105                         include_once 
'Services/Form/classes/class.ilPropertyFormGUI.php';
 
 3107                         $chb = 
new ilCheckboxInputGUI($this->lng->txt(
'link_check_message_a'), 
'link_check_message');
 
 3110                         $chb->setOptionTitle($this->lng->txt(
'link_check_message_b'));
 
 3112                         $toolbar->addInputItem($chb);
 
 3113                         $toolbar->addFormButton($this->lng->txt(
'save'), 
'saveLinkCheck');
 
 3114                         $toolbar->setFormAction($this->ctrl->getLinkTarget($this, 
'saveLinkCheck'));
 
 3118                 $tgui->setLinkChecker($this->link_checker_obj)
 
 3119                          ->setRowHandler($this)
 
 3120                          ->setRefreshButton($this->lng->txt(
'refresh'), 
'refreshLinkCheck');
 
 3122                 return $tpl->setContent($tgui->prepareHTML()->getHTML().$toolbar->getHTML());
 
 3127                 global 
$ilDB,$ilUser;
 
 3129                 include_once 
'./classes/class.ilLinkCheckNotify.php';
 
 3132                 $link_check_notify->setUserId($ilUser->getId());
 
 3133                 $link_check_notify->setObjId($this->object->getId());
 
 3135                 if(
$_POST[
'link_check_message'])
 
 3138                         $link_check_notify->addNotifier();
 
 3143                         $link_check_notify->deleteNotifier();
 
 3156                 if(!$this->link_checker_obj->checkPear())
 
 3164                 $this->link_checker_obj->checkLinks();
 
 3176                 include_once 
'./classes/class.ilLinkChecker.php';
 
 3179                 $this->link_checker_obj->setObjId($this->object->getId());
 
 3186                 include_once 
'./Modules/LearningModule/classes/class.ilLMMenuEditor.php';
 
 3189                 $this->lmme_obj->setObjId($this->object->getId());
 
 3201                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.lm_menu_entry_form.html",
"Modules/LearningModule");
 
 3203                 if (isset(
$_GET[
"link_ref_id"]))
 
 3209                         $target_link = $obj_type.
"_".
$_GET[
"link_ref_id"];
 
 3210                         $this->tpl->setVariable(
"TITLE", 
$title);
 
 3211                         $this->tpl->setVariable(
"TARGET", $target_link);
 
 3212                         $this->tpl->setVariable(
"LINK_REF_ID", 
$_GET[
"link_ref_id"]);
 
 3216                 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this, 
"saveMenuEntry"));
 
 3217                 $this->tpl->setVariable(
"TXT_NEW_ENTRY", $this->lng->txt(
"lm_menu_new_entry"));
 
 3218                 $this->tpl->setVariable(
"TXT_TARGET", $this->lng->txt(
"lm_menu_entry_target"));
 
 3219                 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"lm_menu_entry_title"));
 
 3220                 $this->tpl->setVariable(
"BTN_NAME", 
"saveMenuEntry");
 
 3221                 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
 
 3222                 $this->tpl->setVariable(
"BTN_NAME2", 
"showEntrySelector");
 
 3223                 $this->tpl->setVariable(
"BTN_TEXT2", $this->lng->txt(
"lm_menu_select_internal_object"));
 
 3236                 if (empty(
$_POST[
"title"]))
 
 3240                         $ilCtrl->redirect($this, 
"addMenuEntry");
 
 3242                 if (empty(
$_POST[
"target"]))
 
 3246                         $ilCtrl->redirect($this, 
"addMenuEntry");
 
 3250                 $this->lmme_obj->setTitle(
$_POST[
"title"]);
 
 3251                 $this->lmme_obj->setTarget(
$_POST[
"target"]);
 
 3252                 $this->lmme_obj->setLinkRefId(
$_POST[
"link_ref_id"]);
 
 3254                 if (
$_POST[
"link_ref_id"])
 
 3256                         $this->lmme_obj->setLinkType(
"intern");
 
 3259                 $this->lmme_obj->create();
 
 3262                 $this->ctrl->redirect($this, 
"editMenuProperties");
 
 3270                 if (empty(
$_GET[
"menu_entry"]))
 
 3272                         $this->ilias->raiseError($this->lng->txt(
"no_menu_entry_id"),$this->ilias->error_obj->MESSAGE);
 
 3276                 $this->lmme_obj->delete(
$_GET[
"menu_entry"]);
 
 3279                 $this->ctrl->redirect($this, 
"editMenuProperties");
 
 3287                 if (empty(
$_GET[
"menu_entry"]))
 
 3289                         $this->ilias->raiseError($this->lng->txt(
"no_menu_entry_id"),$this->ilias->error_obj->MESSAGE);
 
 3293                 $this->lmme_obj->readEntry(
$_GET[
"menu_entry"]);
 
 3297                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.lm_menu_entry_form.html",
"Modules/LearningModule");
 
 3299                 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
 3300                 $this->tpl->setVariable(
"TXT_NEW_ENTRY", $this->lng->txt(
"lm_menu_edit_entry"));
 
 3301                 $this->tpl->setVariable(
"TXT_TARGET", $this->lng->txt(
"lm_menu_entry_target"));
 
 3302                 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"lm_menu_entry_title"));
 
 3303                 $this->tpl->setVariable(
"TITLE", $this->lmme_obj->getTitle());
 
 3304                 $this->tpl->setVariable(
"TARGET", $this->lmme_obj->getTarget());
 
 3305                 $this->tpl->setVariable(
"ENTRY_ID", $this->lmme_obj->getEntryId());
 
 3306                 $this->tpl->setVariable(
"BTN_NAME", 
"updateMenuEntry");
 
 3307                 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
 
 3308                 $this->tpl->setVariable(
"BTN_NAME2", 
"showEntrySelector");
 
 3309                 $this->tpl->setVariable(
"BTN_TEXT2", $this->lng->txt(
"lm_menu_select_internal_object"));
 
 3318                 if (empty(
$_POST[
"menu_entry"]))
 
 3320                         $this->ilias->raiseError($this->lng->txt(
"no_menu_entry_id"),$this->ilias->error_obj->MESSAGE);
 
 3324                 if (empty(
$_POST[
"title"]))
 
 3326                         $this->ilias->raiseError($this->lng->txt(
"please_enter_title"),$this->ilias->error_obj->MESSAGE);
 
 3328                 if (empty(
$_POST[
"target"]))
 
 3330                         $this->ilias->raiseError($this->lng->txt(
"please_enter_target"),$this->ilias->error_obj->MESSAGE);
 
 3334                 $this->lmme_obj->readEntry(
$_POST[
"menu_entry"]);
 
 3335                 $this->lmme_obj->setTitle(
$_POST[
"title"]);
 
 3336                 $this->lmme_obj->setTarget(
$_POST[
"target"]);
 
 3337                 $this->lmme_obj->update();
 
 3340                 $this->ctrl->redirect($this, 
"editMenuProperties");
 
 3347                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.lm_menu_object_selector.html",
"Modules/LearningModule");
 
 3351                 require_once (
"./Modules/LearningModule/classes/class.ilLMMenuObjectSelector.php");
 
 3354                 $exp->
setExpand(
$_GET[
"lm_menu_expand"] ? 
$_GET[
"lm_menu_expand"] : $this->tree->readRootId());
 
 3355                 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'showEntrySelector'));
 
 3356                 $exp->setTargetGet(
"ref_id");
 
 3357                 $exp->setRefId($this->cur_ref_id);
 
 3359                 $sel_types = array(
'mcst', 
'mep', 
'cat', 
'lm',
'dbk',
'glo',
'frm',
'exc',
'tst',
'svy', 
'chat', 
'wiki', 
'sahs',
 
 3360                         "crs", 
"grp", 
"book", 
"tst", 
"file");
 
 3361                 $exp->setSelectableTypes($sel_types);
 
 3367                 $output = $exp->getOutput();
 
 3370                 foreach ($exp->format_options as $node)
 
 3372                         if (!$node[
"container"])
 
 3374                                 $pages[] = $node[
"child"];
 
 3381                 $this->tpl->setVariable(
"TXT_SET_PUBLIC_MODE", $this->lng->txt(
"set_public_mode"));
 
 3382                 $this->tpl->setVariable(
"TXT_CHOOSE_PUBLIC_MODE", $this->lng->txt(
"choose_public_mode"));
 
 3383                 $modes = array(
"complete" => $this->lng->txt(
"all_pages"), 
"selected" => $this->lng->txt(
"selected_pages_only"));
 
 3384                 $select_public_mode = 
ilUtil::formSelect ($this->object->getPublicAccessMode(),
"lm_public_mode",$modes, 
false, 
true);
 
 3385                 $this->tpl->setVariable(
"SELECT_PUBLIC_MODE", $select_public_mode);
 
 3387                 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"choose_public_pages"));
 
 3388                 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
 
 3389                 $this->tpl->setVariable(
"EXPLORER",$output);
 
 3390                 $this->tpl->setVariable(
"ONCLICK",$js_pages);
 
 3391                 $this->tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
 
 3392                 $this->tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
 
 3393                 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
 
 3394                 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getLinkTarget($this, 
"savePublicSection"));
 
 3405                         $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
 
 3407                 if(count(
$_POST[
"id"]) > 1)
 
 3409                         $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
 
 3411                 if (
$_POST[
"id"][0] != $this->object->getHeaderPage())
 
 3413                         $this->
object->setHeaderPage(
$_POST[
"id"][0]);
 
 3417                         $this->
object->setHeaderPage(0);
 
 3419                 $this->
object->updateProperties();
 
 3420                 $this->ctrl->redirect($this, 
"pages");
 
 3430                         $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
 
 3432                 if(count(
$_POST[
"id"]) > 1)
 
 3434                         $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
 
 3436                 if (
$_POST[
"id"][0] != $this->object->getFooterPage())
 
 3438                         $this->
object->setFooterPage(
$_POST[
"id"][0]);
 
 3442                         $this->
object->setFooterPage(0);
 
 3444                 $this->
object->updateProperties();
 
 3445                 $this->ctrl->redirect($this, 
"pages");
 
 3457                 $ilCtrl->redirect($this, 
"chapters");
 
 3467                 include_once(
"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
 
 3474                         $parent_id = $this->lm_tree->getParentId($node_id);
 
 3479                         $parent_id = $node_id;
 
 3483                 for ($i = 1; $i <= $num; $i++)
 
 3486                         $chap->setType(
"st");
 
 3487                         $chap->setTitle($lng->txt(
"cont_new_chap"));
 
 3488                         $chap->setLMId($this->object->getId());
 
 3493                 $ilCtrl->redirect($this, 
"chapters");
 
 3503                 include_once(
"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
 
 3505                 if ($ilUser->getPref(
"lm_js_chapter_editing") != 
"disable")
 
 3515                                 $node_id = $this->lm_tree->getRootId();
 
 3516                                 $first_child = 
true;
 
 3520                                 $node_id = 
$_POST[
"id"][0];
 
 3521                                 $first_child = 
false;
 
 3525                 $ilLog->write(
"InsertChapterClip, num: $num, node_id: $node_id, ".
 
 3530                         $parent_id = $this->lm_tree->getParentId($node_id);
 
 3535                         $parent_id = $node_id;
 
 3540                 $chapters = $ilUser->getClipboardObjects(
"st", 
true);
 
 3541                 $copied_nodes = array();
 
 3542                 foreach ($chapters as $chap)
 
 3544                         $ilLog->write(
"Call pasteTree, Target LM: ".$this->object->getId().
", Chapter ID: ".$chap[
"id"]
 
 3545                                 .
", Parent ID: ".$parent_id.
", Target: ".$target);
 
 3547                                 $target, $chap[
"insert_time"], $copied_nodes,
 
 3555                         $ilUser->clipboardDeleteObjectsOfType(
"pg");
 
 3556                         $ilUser->clipboardDeleteObjectsOfType(
"st");
 
 3560                 $this->
object->checkTree();
 
 3561                 $ilCtrl->redirect($this, 
"chapters");
 
 3573                 if ($ilAccess->checkAccess(
"read", 
"", $a_target))
 
 3575                         $_GET[
"baseClass"] = 
"ilLMPresentationGUI";
 
 3576                         $_GET[
"ref_id"] = $a_target;
 
 3577                         include(
"ilias.php");
 
 3579                 } 
else if ($ilAccess->checkAccess(
"visible", 
"", $a_target))
 
 3581                         $_GET[
"baseClass"] = 
"ilLMPresentationGUI";
 
 3582                         $_GET[
"ref_id"] = $a_target;
 
 3583                         $_GET[
"cmd"] = 
"infoScreen";
 
 3584                         include(
"ilias.php");
 
 3587                 else if ($ilAccess->checkAccess(
"read", 
"", ROOT_FOLDER_ID))
 
 3589                         $_GET[
"cmd"] = 
"frameset";
 
 3590                         $_GET[
"target"] = 
"";
 
 3591                         $_GET[
"ref_id"] = ROOT_FOLDER_ID;
 
 3594                         include(
"repository.php");
 
 3599                 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
 
 3610                 if (!is_array($items))
 
 3613                         $ilCtrl->redirect($this, $a_return);
 
 3617                 foreach($items as $k => $item)
 
 3624                 foreach($todel as $k)
 
 3632                 $ilCtrl->redirect($this, $a_return);
 
 3643                 if (!is_array($items))
 
 3646                         $ilCtrl->redirect($this, 
"chapters");
 
 3650                 foreach($items as $k => $item)
 
 3657                 foreach($todel as $k)
 
 3664                 $ilCtrl->redirect($this, 
"chapters");