ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 ?>
$files
Definition: add-vimline.php:18
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
static getThumbnailPath($a_mob_id, $a_thumbname)
Get thumbnail path.
addMultiCommand($a_cmd, $a_text)
Add Command button.
__construct($a_parent_obj, $a_parent_cmd, $a_mob)
Constructor.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
TableGUI class for interactive image overlays.
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
global $lng
Definition: privfeed.php:17
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.