ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 ?>