ILIAS  release_8 Revision v8.24
class.ilPCIIMOverlaysTableGUI.php
Go to the documentation of this file.
1<?php
2
25{
28
29 public function __construct(
30 object $a_parent_obj,
31 string $a_parent_cmd,
32 $a_mob
33 ) {
34 global $DIC;
35
36 $this->ctrl = $DIC->ctrl();
37 $this->lng = $DIC->language();
38 $this->access = $DIC->access();
39 $ilCtrl = $DIC->ctrl();
40 $lng = $DIC->language();
41 $ilAccess = $DIC->access();
42 $lng = $DIC->language();
43
44 parent::__construct($a_parent_obj, $a_parent_cmd);
45 $this->mob = $a_mob;
46 $this->setData($this->getOverlays());
47 $this->setTitle($lng->txt("cont_overlay_images"));
48
49 $this->addColumn("", "", "1", true);
50 $this->addColumn($this->lng->txt("thumbnail"), "", "20px");
51 $this->addColumn($this->lng->txt("filename"));
52
53 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
54 $this->setRowTemplate("tpl.iim_overlays_row.html", "Services/COPage");
55
56 $this->addMultiCommand("confirmDeleteOverlays", $lng->txt("delete"));
57 }
58
59 public function getOverlays(): array
60 {
61 $ov = array();
62 $files = $this->mob->getFilesOfDirectory("overlays");
63 foreach ($files as $f) {
64 $ov[] = array("filename" => $f);
65 }
66 return $ov;
67 }
68
69 protected function fillRow(array $a_set): void
70 {
72
73 $this->tpl->setVariable("FILENAME", $a_set["filename"]);
74 $piname = pathinfo($a_set["filename"]);
76 $this->mob->getId(),
77 basename($a_set["filename"], "." . $piname['extension']) . ".png"
78 );
79 if (!is_file($th_path)) {
80 $this->mob->makeThumbnail(
81 "overlays/" . $a_set["filename"],
82 basename($a_set["filename"], "." . $piname['extension']) . ".png"
83 );
84 }
85 if (is_file($th_path)) {
86 $this->tpl->setVariable("THUMB", ilUtil::img($th_path));
87 }
88 }
89}
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getThumbnailPath(int $a_mob_id, string $a_thumbname)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
fillRow(array $a_set)
Standard Version of Fill Row.
__construct(object $a_parent_obj, string $a_parent_cmd, $a_mob)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
addMultiCommand(string $a_cmd, string $a_text)
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setData(array $a_data)
Set table data.
ilLanguage $lng
static img(string $a_src, ?string $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc