ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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  protected $ctrl;
21 
25  protected $access;
26 
30  public function __construct($a_parent_obj, $a_parent_cmd, $a_mob)
31  {
32  global $DIC;
33 
34  $this->ctrl = $DIC->ctrl();
35  $this->lng = $DIC->language();
36  $this->access = $DIC->access();
37  $ilCtrl = $DIC->ctrl();
38  $lng = $DIC->language();
39  $ilAccess = $DIC->access();
40  $lng = $DIC->language();
41 
42  parent::__construct($a_parent_obj, $a_parent_cmd);
43  $this->mob = $a_mob;
44  $this->setData($this->getOverlays());
45  $this->setTitle($lng->txt("cont_overlay_images"));
46 
47  $this->addColumn("", "", "1", true);
48  $this->addColumn($this->lng->txt("thumbnail"), "", "20px");
49  $this->addColumn($this->lng->txt("filename"));
50 
51  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
52  $this->setRowTemplate("tpl.iim_overlays_row.html", "Services/COPage");
53 
54  $this->addMultiCommand("confirmDeleteOverlays", $lng->txt("delete"));
55  }
56 
62  public function getOverlays()
63  {
64  $ov = array();
65  $files = $this->mob->getFilesOfDirectory("overlays");
66  foreach ($files as $f) {
67  $ov[] = array("filename" => $f);
68  }
69  return $ov;
70  }
71 
72 
76  protected function fillRow($a_set)
77  {
78  $lng = $this->lng;
79 
80  $this->tpl->setVariable("FILENAME", $a_set["filename"]);
81  $piname = pathinfo($a_set["filename"]);
83  $this->mob->getId(),
84  basename($a_set["filename"], "." . $piname['extension']) . ".png"
85  );
86  if (!is_file($th_path)) {
87  $this->mob->makeThumbnail(
88  "overlays/" . $a_set["filename"],
89  basename($a_set["filename"], "." . $piname['extension']) . ".png"
90  );
91  }
92  if (is_file($th_path)) {
93  $this->tpl->setVariable("THUMB", ilUtil::img($th_path));
94  }
95  }
96 }
$files
Definition: metarefresh.php:49
global $DIC
Definition: saml.php:7
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.
static img($a_src, $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
TableGUI class for interactive image overlays.
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.