ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilStyleImageTableGUI.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_style_obj)
21  {
22  global $ilCtrl, $lng, $ilAccess, $lng, $rbacsystem;
23 
24  parent::__construct($a_parent_obj, $a_parent_cmd);
25 
26  $this->setTitle($lng->txt("sty_images"));
27  $this->style_obj = $a_style_obj;
28 
29  $this->addColumn("", "", "1"); // checkbox
30  $this->addColumn($this->lng->txt("thumbnail"), "", "1");
31  $this->addColumn($this->lng->txt("file"), "", "33%");
32  $this->addColumn($this->lng->txt("sty_width_height"), "", "33%");
33  $this->addColumn($this->lng->txt("size"), "", "33%");
34  $this->setEnableHeader(true);
35  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
36  $this->setRowTemplate("tpl.style_image_row.html", "Services/Style/Content");
37  $this->setSelectAllCheckbox("file");
38  $this->getItems();
39 
40  // action commands
41  if ($this->parent_obj->checkWrite())
42  {
43  $this->addMultiCommand("deleteImage", $lng->txt("delete"));
44  }
45 
46  //$this->addMultiCommand("editLink", $lng->txt("cont_set_link"));
47  //$this->addCommandButton("addImage", $this->lng->txt("sty_add_image"));
48 
49  $this->setEnableTitle(true);
50  }
51 
55  function getItems()
56  {
57  $this->setData($this->style_obj->getImages());
58  }
59 
63  protected function fillRow($a_set)
64  {
65  global $lng, $ilCtrl, $ilAccess;
66 
67  $thumbfile = $this->style_obj->getThumbnailsDirectory()."/".$a_set["entry"];
68  if (is_file($thumbfile))
69  {
70  $this->tpl->setCurrentBlock("thumbnail");
71  $this->tpl->setVariable("IMG_ALT", $a_set["entry"]);
72  $this->tpl->setVariable("IMG_SRC", $thumbfile);
73  $this->tpl->parseCurrentBlock();
74  }
75  $image_file = $this->style_obj->getImagesDirectory()."/".$a_set["entry"];
76  $image_size = @getimagesize($image_file);
77  {
78  if ($image_size[0] > 0 && $image_size[1] > 0)
79  {
80  $this->tpl->setVariable("VAL_WIDTH_HEIGHT",
81  $image_size[0]."px x ".$image_size[1]."px");
82  }
83  }
84 
85  $this->tpl->setVariable("VAL_FILENAME", $a_set["entry"]);
86  $this->tpl->setVariable("VAL_SIZE", $a_set["size"]);
87  $this->tpl->setVariable("FILE", $a_set["entry"]);
88  }
89 }
90 ?>
getItems()
Get items of current folder.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
addMultiCommand($a_cmd, $a_text)
Add Command button.
fillRow($a_set)
Fill table row.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
TableGUI class for style editor (image list)
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
global $lng
Definition: privfeed.php:17
__construct($a_parent_obj, $a_parent_cmd, $a_style_obj)
Constructor.
setEnableHeader($a_enableheader)
Set Enable Header.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setEnableTitle($a_enabletitle)
Set Enable Title.
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.