ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilRendererTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once("Services/Table/classes/class.ilTable2GUI.php");
5 require_once("Services/Preview/classes/class.ilPreviewRenderer.php");
6 require_once("Services/Preview/classes/class.ilFilePreviewRenderer.php");
7 
17 {
25  function __construct($a_parent_obj, $a_parent_cmd)
26  {
27  global $ilCtrl, $lng;
28 
29  parent::__construct($a_parent_obj, $a_parent_cmd);
30 
31  // general properties
32  $this->setRowTemplate("tpl.renderer_row.html", "Services/Preview");
33  $this->setLimit(9999);
34  $this->setEnableHeader(true);
35  $this->disable("footer");
36  $this->setExternalSorting(true);
37  $this->setEnableTitle(true);
38  $this->setTitle($lng->txt("loaded_preview_renderers"));
39 
40  $this->addColumn($lng->txt("name"));
41  $this->addColumn($lng->txt("type"));
42  $this->addColumn($lng->txt("renderer_supported_repo_types"));
43  $this->addColumn($lng->txt("renderer_supported_file_types"));
44  }
45 
50  protected function fillRow($renderer)
51  {
52  global $lng, $ilCtrl, $ilAccess;
53 
54  $name = $renderer->getName();
55  $type = $lng->txt("renderer_type_" . ($renderer->isPlugin() ? "plugin" : "builtin"));
56 
57  $repo_types = array();
58  foreach ($renderer->getSupportedRepositoryTypes() as $repo_type)
59  $repo_types[] = $lng->txt($repo_type);
60 
61  // supports files?
62  $file_types = "";
63  if ($renderer instanceof ilFilePreviewRenderer)
64  {
65  $file_types = implode(", ", $renderer->getSupportedFileFormats());
66  }
67 
68  // fill template
69  $this->tpl->setVariable("TXT_NAME", $name);
70  $this->tpl->setVariable("TXT_TYPE", $type);
71  $this->tpl->setVariable("TXT_REPO_TYPES", implode(", ", $repo_types));
72  $this->tpl->setVariable("TXT_FILE_TYPES", $file_types);
73  }
74 }
75 ?>
setExternalSorting($a_val)
Set external sorting.
Abstract parent class for all file preview renderer classes.
Displays an overview of all loaded preview renderers.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
__construct($a_parent_obj, $a_parent_cmd)
Creates a new ilRendererTableGUI instance.
Class ilTable2GUI.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
disable($a_module_name)
diesables particular modules of table
global $lng
Definition: privfeed.php:17
setEnableHeader($a_enableheader)
Set Enable Header.
setEnableTitle($a_enabletitle)
Set Enable Title.
fillRow($renderer)
Standard Version of Fill Row.
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.
setLimit($a_limit=0, $a_default_limit=0)