4 require_once(
"./Services/Preview/classes/class.ilPreviewSettings.php");
5 require_once(
"./Services/Preview/classes/class.ilFSStoragePreview.php");
71 $this->obj_id = $a_obj_id;
72 $this->obj_type = $a_type;
87 return $preview->create($a_obj, $a_force);
114 $status = $src->getRenderStatus();
117 if ($status == self::RENDER_STATUS_CREATED)
121 $dest->setRenderDate($src->getRenderDate());
122 $dest->setRenderStatus($src->getRenderStatus());
125 $dest->getStorage()->create();
128 ilUtil::rCopy($src->getStoragePath(), $dest->getStoragePath());
159 require_once(
"./Services/Preview/classes/class.ilRendererFactory.php");
161 return $renderer != null;
193 public function create($a_obj, $a_force =
false)
199 require_once(
"./Services/Preview/classes/class.ilRendererFactory.php");
203 if ($renderer == null)
211 if ($this->
getRenderStatus() == self::RENDER_STATUS_CREATED && !$a_force)
223 $renderer->render($this, $a_obj,
true);
234 public function delete()
245 $this->render_date =
false;
264 if ($handle = @opendir(
$path))
266 while (
false !== (
$file = readdir($handle)))
269 if (!is_file($filepath))
278 $size = @getimagesize($filepath);
281 $image[
"width"] =
$size[0];
282 $image[
"height"] =
$size[1];
285 $images[
$file] = $image;
319 "obj_id" => array(
"integer", $this->
getObjId()),
334 $set = $ilDB->queryF(
335 "SELECT * FROM preview_data WHERE obj_id=%s",
339 while ($rec = $ilDB->fetchAssoc($set))
360 array(
"obj_id" => array(
"integer", $this->
getObjId()))
372 "DELETE FROM preview_data WHERE obj_id=%s",
395 if (empty($this->obj_type))
450 $this->render_date = $a_date;
470 $this->render_status = $a_status;
480 if ($this->storage == null)