コード例 #1
0
 /**
  * get properties (offline)
  *
  * @access public
  * @param
  * 
  */
 public function getProperties()
 {
     global $lng;
     $this->plugin->includeClass("class.ilObjExternalContentAccess.php");
     if (!ilObjExternalContentAccess::_lookupOnline($this->obj_id)) {
         $props[] = array("alert" => true, "property" => $lng->txt("status"), "value" => $lng->txt("offline"));
     }
     return $props ? $props : array();
 }
コード例 #2
0
 /**
  * Get Icon (object, type or plugin specific)
  * (this function should be called wherever an icon has to be displyed)
  * 
  * @param 	string		object type ("xxco")
  * @param 	string		size ("big", "small", "tiny" or "svg")
  * @param	int			object id (optional)
  * @param	int			content type id (optional)
  * @param	string		get icon of a specific level ("plugin", "type" or "object")
  * 
  * @return	string		icon path
  */
 static function _getIcon($a_type, $a_size, $a_obj_id = 0, $a_type_id = 0, $a_level = "")
 {
     // first try to use an object specific icon
     if ($a_level == "object" or $a_level == "") {
         if ($a_obj_id) {
             // always try svg version first
             $name = self::_getIconName("svg");
             $path = self::_getWebspaceDir("object", $a_obj_id) . "/" . $name;
             if (is_file($path)) {
                 return $path;
             }
             // then try older versions (big is default)
             $name = self::_getIconName($a_size);
             $path = self::_getWebspaceDir("object", $a_obj_id) . "/" . $name;
             if (is_file($path)) {
                 return $path;
             }
         }
     }
     // then try to get a content type specific icon
     if ($a_level == "type" or $a_level == "") {
         if ($a_obj_id and !$a_type_id) {
             require_once 'Customizing/global/plugins/Services/Repository/RepositoryObject/ExternalContent/classes/class.ilObjExternalContentAccess.php';
             $a_type_id = ilObjExternalContentAccess::_lookupTypeId($a_obj_id);
         }
         if ($a_type_id) {
             // always try svg version first
             $name = self::_getIconName("svg");
             $path = self::_getWebspaceDir("type", $a_type_id) . "/" . $name;
             if (is_file($path)) {
                 return $path;
             }
             // then try older versions (big is default)
             $name = self::_getIconName($a_size);
             $path = self::_getWebspaceDir("type", $a_type_id) . "/" . $name;
             if (is_file($path)) {
                 return $path;
             }
         }
     }
     // finally get the plugin icon
     if ($a_level == "plugin" or $a_level == "") {
         return parent::_getIcon($a_type, $a_size);
     }
 }