/**
  * upload new version of module
  */
 function newModuleVersion()
 {
     global $ilTabs;
     ilObjSAHSLearningModuleGUI::setSettingsSubTabs();
     $ilTabs->setSubTabActive('cont_sc_new_version');
     $obj_id = ilObject::_lookupObjectId($_GET['ref_id']);
     $type = ilObjSAHSLearningModule::_lookupSubType($obj_id);
     // display import form
     $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.scorm_new_version_import.html", "Modules/ScormAicc");
     $this->tpl->setVariable("TYPE_IMG", ilUtil::getImagePath('icon_slm.svg'));
     $this->tpl->setVariable("ALT_IMG", $this->lng->txt("obj_sahs"));
     $this->ctrl->setParameter($this, "new_type", "sahs");
     $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
     $this->tpl->setVariable("BTN_NAME", "newModuleVersionUpload");
     $this->tpl->setVariable("TARGET", ' target="' . ilFrameTargetInfo::_getFrame("MainContent") . '" ');
     $this->tpl->setVariable("TXT_SELECT_LMTYPE", $this->lng->txt("type"));
     if ($type == "scorm2004") {
         $this->tpl->setVariable("TXT_TYPE", $this->lng->txt("lm_type_scorm2004"));
     } else {
         $this->tpl->setVariable("TXT_TYPE", $this->lng->txt("lm_type_scorm"));
     }
     include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
     if (ilUploadFiles::_getUploadDirectory()) {
         $files = ilUploadFiles::_getUploadFiles();
         foreach ($files as $file) {
             $file = htmlspecialchars($file, ENT_QUOTES, "utf-8");
             $this->tpl->setCurrentBlock("option_uploaded_file");
             $this->tpl->setVariable("UPLOADED_FILENAME", $file);
             $this->tpl->setVariable("TXT_UPLOADED_FILENAME", $file);
             $this->tpl->parseCurrentBlock();
         }
         $this->tpl->setCurrentBlock("select_uploaded_file");
         $this->tpl->setVariable("TXT_SELECT_FROM_UPLOAD_DIR", $this->lng->txt("cont_select_from_upload_dir"));
         $this->tpl->setVariable("TXT_UPLOADED_FILE", $this->lng->txt("cont_uploaded_file"));
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setVariable("TXT_UPLOAD", $this->lng->txt("upload"));
     $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
     $this->tpl->setVariable("TXT_IMPORT_LM", $this->lng->txt("import_sahs"));
     $this->tpl->setVariable("TXT_SELECT_FILE", $this->lng->txt("select_file"));
     // gives out the limit as a little notice
     $this->tpl->setVariable("TXT_FILE_INFO", $this->lng->txt("file_notice") . " " . $this->getMaxFileSize());
 }
 /**
  * Scorm 2004 module properties
  */
 function properties()
 {
     global $rbacsystem, $tree, $tpl, $lng, $ilToolbar, $ilCtrl, $ilSetting, $ilTabs;
     $this->setSubTabs("settings", "general_settings");
     $lng->loadLanguageModule("style");
     // not editable
     if ($this->object->editable != 1) {
         ilObjSAHSLearningModuleGUI::setSettingsSubTabs();
         $ilTabs->setSubTabActive('cont_settings');
         // view
         $ilToolbar->addButton($this->lng->txt("view"), "ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=" . $this->object->getRefID(), "_blank");
     } else {
         // glossary buttons to toolbar
         $sep = false;
         if (ilObject::_lookupType($this->object->getAssignedGlossary()) != "glo") {
             $parent_ref_id = $tree->getParentId((int) $_GET["ref_id"]);
             if ($rbacsystem->checkAccess("create", $parent_ref_id, "glo")) {
                 $ilToolbar->addButton($this->lng->txt("cont_glo_create"), $ilCtrl->getLinkTarget($this, "createGlossary"));
             }
             $ilToolbar->addButton($this->lng->txt("cont_glo_assign"), $ilCtrl->getLinkTarget($this, "assignGlossary"));
         } else {
             $ilToolbar->addButton($this->lng->txt("cont_glo_detach"), $ilCtrl->getLinkTarget($this, "detachGlossary"));
         }
         // style buttons to toolbar
         $fixed_style = $ilSetting->get("fixed_content_style_id");
         $style_id = $this->object->getStyleSheetId();
         if ($fixed_style == 0) {
             $st_styles = ilObjStyleSheet::_getStandardStyles(true, false, $_GET["ref_id"]);
             $st_styles[0] = $this->lng->txt("default");
             ksort($st_styles);
             if ($style_id > 0) {
                 // individual style
                 if (!ilObjStyleSheet::_lookupStandard($style_id)) {
                     $ilToolbar->addSeparator();
                     // delete command
                     $ilToolbar->addButton($this->lng->txt("cont_edit_style"), $ilCtrl->getLinkTarget($this, "editStyle"));
                     $ilToolbar->addButton($this->lng->txt("cont_delete_style"), $ilCtrl->getLinkTarget($this, "deleteStyle"));
                 }
             }
             if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id)) {
                 $ilToolbar->addSeparator();
                 $ilToolbar->addButton($this->lng->txt("sty_create_ind_style"), $ilCtrl->getLinkTarget($this, "createStyle"));
             }
         }
     }
     // output forms
     if ($this->object->editable != 1) {
         $this->initPropertiesForm();
         $tpl->setContent($this->form->getHTML());
     } else {
         $this->initPropertiesEditableForm();
         $this->getPropertiesEditableValues();
         $tpl->setContent($this->form->getHTML());
     }
 }