Esempio n. 1
0
 /**
  * Determines whether the object with the specified reference id has a preview.
  * 
  * @param int $a_obj_id The id of the object to check.
  * @param string $a_type The type of the object to check.
  * @return bool true, if the object has a preview; otherwise, false.
  */
 public static function hasPreview($a_obj_id, $a_type = "")
 {
     if (!ilPreviewSettings::isPreviewEnabled()) {
         return false;
     }
     $preview = new ilPreview($a_obj_id, $a_type);
     if ($preview->exists()) {
         return true;
     }
     // does not exist, enable on demand rendering if there's any renderer that supports our object
     require_once "./Services/Preview/classes/class.ilRendererFactory.php";
     $renderer = ilRendererFactory::getRenderer($preview);
     return $renderer != null;
 }