/**
  * Workaround for course titles (linked if join or read permission is granted)
  * @param type $a_permission
  * @param type $a_cmd
  * @param type $a_ref_id
  * @param type $a_type
  * @param type $a_obj_id
  * @return type
  */
 public function checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id = "")
 {
     if ($a_permission == 'grp_linked') {
         return parent::checkCommandAccess('read', '', $a_ref_id, $a_type, $a_obj_id) || parent::checkCommandAccess('join', 'join', $a_ref_id, $a_type, $a_obj_id);
     }
     return parent::checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id);
 }
 /**
  * Only check cmd access for cmd 'register' and 'unregister'
  * @param string $a_permission
  * @param object $a_cmd
  * @param object $a_ref_id
  * @param object $a_type
  * @param object $a_obj_id [optional]
  * @return 
  */
 public function checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id = "")
 {
     if ($a_cmd != 'register' and $a_cmd != 'unregister') {
         $a_cmd = '';
     }
     return parent::checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id);
 }
 /**
  * Workaround for course titles (linked if join or read permission is granted)
  * @param type $a_permission
  * @param type $a_cmd
  * @param type $a_ref_id
  * @param type $a_type
  * @param type $a_obj_id
  * @return type
  */
 public function checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id = "")
 {
     // Only check cmd access for cmd 'register' and 'unregister'
     if ($a_cmd != 'view' and $a_cmd != 'leave') {
         $a_cmd = '';
     }
     if ($a_permission == 'crs_linked') {
         return parent::checkCommandAccess('read', $a_cmd, $a_ref_id, $a_type, $a_obj_id) || parent::checkCommandAccess('join', $a_cmd, $a_ref_id, $a_type, $a_obj_id);
     }
     return parent::checkCommandAccess($a_permission, $a_cmd, $a_ref_id, $a_type, $a_obj_id);
 }
 /**
  * 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, $ilUser;
     // BEGIN WebDAV: Get parent properties
     $props = parent::getProperties();
     // END WebDAV: Get parent properties
     // to do: implement extra smaller file info object
     include_once "./Modules/File/classes/class.ilObjFileAccess.php";
     // Display a warning if a file is not a hidden Unix file, and
     // the filename extension is missing
     if (!preg_match('/^\\.|\\.[a-zA-Z0-9]+$/', $this->title)) {
         $props[] = array("alert" => false, "property" => $lng->txt("filename_interoperability"), "value" => $lng->txt("filename_extension_missing"), 'propertyNameVisible' => false);
     }
     // BEGIN WebDAV: Only display relevant information.
     $props[] = array("alert" => false, "property" => $lng->txt("type"), "value" => ilObjFileAccess::_getFileExtension($this->title), 'propertyNameVisible' => false);
     $fileData = ilObjFileAccess::getListGUIData($this->obj_id);
     if (is_array($fileData)) {
         $props[] = array("alert" => false, "property" => $lng->txt("size"), "value" => ilFormat::formatSize($fileData['size'], 'short'), 'propertyNameVisible' => false);
         $version = $fileData['version'];
         if ($version > 1) {
             // add versions link
             if (parent::checkCommandAccess("write", "versions", $this->ref_id, $this->type)) {
                 $link = $this->getCommandLink("versions");
                 $value = "<a href=\"{$link}\">" . $lng->txt("version") . ": {$version}</a>";
             } else {
                 $value = $lng->txt("version") . ": {$version}";
             }
             $props[] = array("alert" => false, "property" => $lng->txt("version"), "value" => $value, "propertyNameVisible" => false);
         }
         // #6040
         if ($fileData["date"]) {
             $props[] = array("alert" => false, "property" => $lng->txt("last_update"), "value" => ilDatePresentation::formatDate(new ilDateTime($fileData["date"], IL_CAL_DATETIME)), 'propertyNameVisible' => false);
         }
     }
     // END WebDAV: Only display relevant information.
     return $props;
 }