ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilPCImageMapTableGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5include_once("Services/Table/classes/class.ilTable2GUI.php");
6include_once("Services/MediaObjects/classes/class.ilImageMapTableGUI.php");
7
17{
21 protected $ctrl;
22
26 protected $access;
27
28
32 public function __construct(
33 $a_parent_obj,
34 $a_parent_cmd,
35 $a_pc_media_object,
36 $a_parent_node_name
37 ) {
38 global $DIC;
39
40 $this->ctrl = $DIC->ctrl();
41 $this->lng = $DIC->language();
42 $this->access = $DIC->access();
43
44 $this->parent_node_name = $a_parent_node_name;
45 $this->pc_media_object = $a_pc_media_object;
46 parent::__construct($a_parent_obj, $a_parent_cmd, $a_pc_media_object->getMediaObject());
47 }
48
52 public function getItems()
53 {
54 $std_alias_item = new ilMediaAliasItem(
55 $this->pc_media_object->dom,
56 $this->pc_media_object->hier_id,
57 "Standard",
58 $this->pc_media_object->getPcId(),
59 $this->parent_node_name
60 );
61 $areas = $std_alias_item->getMapAreas();
62
63 foreach ($areas as $k => $a) {
64 $areas[$k]["title"] = $a["Link"]["Title"];
65 }
66 $areas = ilUtil::sortArray($areas, "title", "asc", false, true);
67 $this->setData($areas);
68 }
69
74 protected function fillRow($a_set)
75 {
78 $ilAccess = $this->access;
79
80 $i = $a_set["Nr"];
81 $this->tpl->setVariable(
82 "CHECKBOX",
83 ilUtil::formCheckBox("", "area[]", $i)
84 );
85 $this->tpl->setVariable("VAR_NAME", "name_" . $i);
86 $this->tpl->setVariable("VAL_NAME", trim($a_set["Link"]["Title"]));
87 $this->tpl->setVariable("VAL_SHAPE", $a_set["Shape"]);
88
89 $this->tpl->setVariable(
90 "VAL_HIGHL_MODE",
92 $a_set["HighlightMode"],
93 "hl_mode_" . $i,
94 $this->highl_modes,
95 false,
96 true
97 )
98 );
99 $this->tpl->setVariable(
100 "VAL_HIGHL_CLASS",
102 $a_set["HighlightClass"],
103 "hl_class_" . $i,
104 $this->highl_classes,
105 false,
106 true
107 )
108 );
109
110 $this->tpl->setVariable(
111 "VAL_COORDS",
112 implode(explode(",", $a_set["Coords"]), ", ")
113 );
114 switch ($a_set["Link"]["LinkType"]) {
115 case "ExtLink":
116 $this->tpl->setVariable("VAL_LINK", $a_set["Link"]["Href"]);
117 break;
118
119 case "IntLink":
120 $link_str = $this->parent_obj->getMapAreaLinkString(
121 $a_set["Link"]["Target"],
122 $a_set["Link"]["Type"],
123 $a_set["Link"]["TargetFrame"]
124 );
125 $this->tpl->setVariable("VAL_LINK", $link_str);
126 break;
127 }
128 }
129}
An exception for terminatinating execution or to throw for unit testing.
TableGUI class for image map editor.
Class ilMediaAliasItem.
TableGUI class for pc image map editor.
__construct( $a_parent_obj, $a_parent_cmd, $a_pc_media_object, $a_parent_node_name)
Constructor.
fillRow($a_set)
Standard Version of Fill Row.
getItems()
Get items of current folder.
setData($a_data)
set table data @access public
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static formSelect( $selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
$i
Definition: disco.tpl.php:19
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7