/**
  * checks wether a user may invoke a command or not
  * (this method is called by ilAccessHandler::checkAccess)
  *
  * @param	string		$a_cmd		command (not permission!)
  * @param	string		$a_permission	permission
  * @param	int			$a_ref_id	reference id
  * @param	int			$a_obj_id	object id
  * @param	int			$a_user_id	user id (if not provided, current user is taken)
  *
  * @return	boolean		true, if everything is ok
  */
 function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = "")
 {
     global $ilUser, $lng, $rbacsystem, $ilAccess;
     if ($a_user_id == "") {
         $a_user_id = $ilUser->getId();
     }
     switch ($a_permission) {
         case "visible":
             if (!ilObjFileBasedLMAccess::_lookupOnline($a_obj_id) && !$rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id)) {
                 $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
                 return false;
             }
             break;
         case "read":
             if (!ilObjFileBasedLMAccess::_lookupOnline($a_obj_id) && !$rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id) || ilObjFileBasedLMAccess::_determineStartUrl($a_obj_id) == "") {
                 $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
                 return false;
             }
             break;
     }
     return true;
 }
 /**
  * adds tabs to tab gui object
  */
 function getTabs()
 {
     global $ilUser, $ilAccess, $ilTabs, $lng, $ilHelp;
     $ilHelp->setScreenIdComponent("htlm");
     if ($ilAccess->checkAccess('write', '', $this->ref_id)) {
         $ilTabs->addTab("id_list_files", $lng->txt("cont_list_files"), $this->ctrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"));
         $ilTabs->addTab("id_info", $lng->txt("info_short"), $this->ctrl->getLinkTargetByClass(array("ilobjfilebasedlmgui", "ilinfoscreengui"), "showSummary"));
         $ilTabs->addTab("id_settings", $lng->txt("settings"), $this->ctrl->getLinkTarget($this, "properties"));
     }
     include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
     if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
         $ilTabs->addTab("id_learning_progress", $lng->txt("learning_progress"), $this->ctrl->getLinkTargetByClass(array('ilobjfilebasedlmgui', 'illearningprogressgui'), ''));
     }
     include_once "Services/License/classes/class.ilLicenseAccess.php";
     if ($ilAccess->checkAccess('edit_permission', '', $this->ref_id) and ilLicenseAccess::_isEnabled()) {
         $ilTabs->addTab("id_license", $lng->txt("license"), $this->ctrl->getLinkTargetByClass('illicensegui', ''));
     }
     if ($ilAccess->checkAccess('write', '', $this->ref_id)) {
         $ilTabs->addTab("id_meta_data", $lng->txt("meta_data"), $this->ctrl->getLinkTargetByClass('ilmdeditorgui', ''));
         $ilTabs->addTab("id_bib_data", $lng->txt("bib_data"), $this->ctrl->getLinkTarget($this, "editBibItem"));
     }
     // export
     if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
         $ilTabs->addTab("export", $lng->txt("export"), $this->ctrl->getLinkTargetByClass("ilexportgui", ""));
     }
     if ($ilAccess->checkAccess('edit_permission', '', $this->object->getRefId())) {
         $ilTabs->addTab("id_permissions", $lng->txt("perm_settings"), $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilpermissiongui'), "perm"));
     }
     require_once "./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php";
     $startfile = ilObjFileBasedLMAccess::_determineStartUrl($this->object->getId());
     if ($startfile != "") {
         $ilTabs->addNonTabbedLink("presentation_view", $this->lng->txt("glo_presentation_view"), "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=" . $this->object->getRefID(), "_blank");
     }
 }
 /**
  * Get item properties
  *
  * @return	array		array of property arrays:
  *						"alert" (boolean) => display as an alert property (usually in red)
  *						"property" (string) => property name
  *						"value" (string) => property value
  */
 function getProperties()
 {
     global $lng, $rbacsystem;
     $props = array();
     include_once "./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php";
     if (ilObjFileBasedLMAccess::_isOffline($this->obj_id)) {
         $props[] = array("alert" => true, "property" => $lng->txt("status"), "value" => $lng->txt("offline"));
     } else {
         if (!ilObjFileBasedLMAccess::_determineStartUrl($this->obj_id)) {
             $props[] = array("alert" => true, "property" => $lng->txt("status"), "value" => $lng->txt("no_start_file"));
         }
     }
     if ($rbacsystem->checkAccess("write", $this->ref_id)) {
         $props[] = array("alert" => false, "property" => $lng->txt("type"), "value" => $lng->txt("htlm"));
     }
     return $props;
 }