ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
4require_once("Services/Table/classes/class.ilTable2GUI.php");
5require_once("Services/Preview/classes/class.ilPreviewRenderer.php");
6require_once("Services/Preview/classes/class.ilFilePreviewRenderer.php");
7
17{
25 public function __construct($a_parent_obj, $a_parent_cmd)
26 {
27 global $DIC;
28 $ilCtrl = $DIC['ilCtrl'];
29 $lng = $DIC['lng'];
30
31 parent::__construct($a_parent_obj, $a_parent_cmd);
32
33 // general properties
34 $this->setRowTemplate("tpl.renderer_row.html", "Services/Preview");
35 $this->setLimit(9999);
36 $this->setEnableHeader(true);
37 $this->disable("footer");
38 $this->setExternalSorting(true);
39 $this->setEnableTitle(true);
40 $this->setTitle($lng->txt("loaded_preview_renderers"));
41
42 $this->addColumn($lng->txt("name"));
43 $this->addColumn($lng->txt("type"));
44 $this->addColumn($lng->txt("renderer_supported_repo_types"));
45 $this->addColumn($lng->txt("renderer_supported_file_types"));
46 }
47
52 protected function fillRow($renderer)
53 {
54 global $DIC;
55 $lng = $DIC['lng'];
56 $ilCtrl = $DIC['ilCtrl'];
57 $ilAccess = $DIC['ilAccess'];
58
59 $name = $renderer->getName();
60 $type = $lng->txt("renderer_type_" . ($renderer->isPlugin() ? "plugin" : "builtin"));
61
62 $repo_types = array();
63 foreach ($renderer->getSupportedRepositoryTypes() as $repo_type) {
64 $repo_types[] = $lng->txt($repo_type);
65 }
66
67 // supports files?
68 $file_types = "";
69 if ($renderer instanceof ilFilePreviewRenderer) {
70 $file_types = implode(", ", $renderer->getSupportedFileFormats());
71 }
72
73 // fill template
74 $this->tpl->setVariable("TXT_NAME", $name);
75 $this->tpl->setVariable("TXT_TYPE", $type);
76 $this->tpl->setVariable("TXT_REPO_TYPES", implode(", ", $repo_types));
77 $this->tpl->setVariable("TXT_FILE_TYPES", $file_types);
78 }
79}
An exception for terminatinating execution or to throw for unit testing.
Abstract parent class for all file preview renderer classes.
Displays an overview of all loaded preview renderers.
fillRow($renderer)
Standard Version of Fill Row.
__construct($a_parent_obj, $a_parent_cmd)
Creates a new ilRendererTableGUI instance.
Class ilTable2GUI.
setEnableHeader($a_enableheader)
Set Enable Header.
setExternalSorting($a_val)
Set external sorting.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setEnableTitle($a_enabletitle)
Set Enable Title.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setLimit($a_limit=0, $a_default_limit=0)
set max.
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.
disable($a_module_name)
diesables particular modules of table
global $ilCtrl
Definition: ilias.php:18
if($format !==null) $name
Definition: metadata.php:230
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$type
$DIC
Definition: xapitoken.php:46