ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilPCIIMOverlaysTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once("./Services/Table/classes/class.ilTable2GUI.php");
6 
16 {
20  function __construct($a_parent_obj, $a_parent_cmd, $a_mob)
21  {
22  global $ilCtrl, $lng, $ilAccess, $lng;
23 
24  parent::__construct($a_parent_obj, $a_parent_cmd);
25  $this->mob = $a_mob;
26  $this->setData($this->getOverlays());
27  $this->setTitle($lng->txt("cont_overlay_images"));
28 
29  $this->addColumn("", "", "1", true);
30  $this->addColumn($this->lng->txt("thumbnail"), "", "20px");
31  $this->addColumn($this->lng->txt("filename"));
32 
33  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
34  $this->setRowTemplate("tpl.iim_overlays_row.html", "Services/COPage");
35 
36  $this->addMultiCommand("confirmDeleteOverlays", $lng->txt("delete"));
37  }
38 
44  function getOverlays()
45  {
46  $ov = array();
47  $files = $this->mob->getFilesOfDirectory("overlays");
48  foreach ($files as $f)
49  {
50  $ov[] = array("filename" => $f);
51  }
52  return $ov;
53  }
54 
55 
59  protected function fillRow($a_set)
60  {
61  global $lng;
62 
63  $this->tpl->setVariable("FILENAME", $a_set["filename"]);
64  $piname = pathinfo($a_set["filename"]);
65  $th_path = ilObjMediaObject::getThumbnailPath($this->mob->getId(),
66  basename($a_set["filename"], ".".$piname['extension']).".png");
67  if (!is_file($th_path))
68  {
69  $this->mob->makeThumbnail("overlays/".$a_set["filename"],
70  basename($a_set["filename"], ".".$piname['extension']).".png");
71  }
72  if (is_file($th_path))
73  {
74  $this->tpl->setVariable("THUMB", ilUtil::img($th_path));
75  }
76  }
77 
78 }
79 ?>