ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilPCImageMapTableGUI.php
Go to the documentation of this file.
1<?php
2
25{
26 protected string $parent_node_name;
28
29 public function __construct(
30 object $a_parent_obj,
31 string $a_parent_cmd,
32 ilPCMediaObject $a_pc_media_object,
33 string $a_parent_node_name
34 ) {
35 global $DIC;
36
37 $this->ctrl = $DIC->ctrl();
38 $this->lng = $DIC->language();
39 $this->access = $DIC->access();
40
41 $this->parent_node_name = $a_parent_node_name;
42 $this->pc_media_object = $a_pc_media_object;
43 parent::__construct($a_parent_obj, $a_parent_cmd, $a_pc_media_object->getMediaObject());
44 }
45
46 public function getItems(): void
47 {
48 $std_alias_item = new ilMediaAliasItem(
49 $this->pc_media_object->getDomDoc(),
50 $this->pc_media_object->hier_id,
51 "Standard",
52 $this->pc_media_object->getPCId(),
53 $this->parent_node_name
54 );
55 $areas = $std_alias_item->getMapAreas();
56
57 foreach ($areas as $k => $a) {
58 $areas[$k]["title"] = $a["Link"]["Title"];
59 }
60 $areas = ilArrayUtil::sortArray($areas, "title", "asc", false, true);
61 $this->setData($areas);
62 }
63
64 protected function fillRow(array $a_set): void
65 {
66 $i = $a_set["Nr"];
67 $this->tpl->setVariable(
68 "CHECKBOX",
70 );
71 $this->tpl->setVariable("VAR_NAME", "name_" . $i);
72 $this->tpl->setVariable("VAL_NAME", trim($a_set["Link"]["Title"]));
73 $this->tpl->setVariable("VAL_SHAPE", $a_set["Shape"]);
74
75 $this->tpl->setVariable(
76 "VAL_HIGHL_MODE",
78 $a_set["HighlightMode"],
79 "hl_mode_" . $i,
80 $this->highl_modes,
81 false,
82 true
83 )
84 );
85 $this->tpl->setVariable(
86 "VAL_HIGHL_CLASS",
88 $a_set["HighlightClass"],
89 "hl_class_" . $i,
90 $this->highl_classes,
91 false,
92 true
93 )
94 );
95
96 $this->tpl->setVariable(
97 "VAL_COORDS",
98 implode(", ", explode(",", $a_set["Coords"]))
99 );
100 switch ($a_set["Link"]["LinkType"]) {
101 case "ExtLink":
102 $this->tpl->setVariable("VAL_LINK", $a_set["Link"]["Href"]);
103 break;
104
105 case "IntLink":
106 $link_str = $this->parent_obj->getMapAreaLinkString(
107 $a_set["Link"]["Target"],
108 $a_set["Link"]["Type"],
109 $a_set["Link"]["TargetFrame"]
110 );
111 $this->tpl->setVariable("VAL_LINK", $link_str);
112 break;
113 }
114 }
115}
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static formCheckbox(bool $checked, string $varname, string $value, bool $disabled=false)
static formSelect( $selected, string $varname, array $options, bool $multiple=false, bool $direct_text=false, int $size=0, string $style_class="", array $attribs=[], bool $disabled=false)
Builds a select form field with options and shows the selected option first.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(object $a_parent_obj, string $a_parent_cmd, ilPCMediaObject $a_pc_media_object, string $a_parent_node_name)
fillRow(array $a_set)
Standard Version of Fill Row.
Class ilPCMediaObject Media content object (see ILIAS DTD)
setData(array $a_data)
Set table data.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
global $DIC
Definition: shib_login.php:26