ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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{
18
22 function __construct($a_parent_obj, $a_parent_cmd, $a_pc_media_object,
23 $a_parent_node_name)
24 {
25 global $ilCtrl, $lng, $ilAccess, $lng;
26
27 $this->parent_node_name = $a_parent_node_name;
28 $this->pc_media_object = $a_pc_media_object;
29 parent::__construct($a_parent_obj, $a_parent_cmd, $a_pc_media_object->getMediaObject());
30 }
31
35 function getItems()
36 {
37 $std_alias_item = new ilMediaAliasItem($this->pc_media_object->dom,
38 $this->pc_media_object->hier_id, "Standard", $this->pc_media_object->getPcId(),
39 $this->parent_node_name);
40 $areas = $std_alias_item->getMapAreas();
41
42 foreach ($areas as $k => $a)
43 {
44 $areas[$k]["title"] = $a["Link"]["Title"];
45 }
46 $areas = ilUtil::sortArray($areas, "title", "asc", false, true);
47 $this->setData($areas);
48 }
49
54 protected function fillRow($a_set)
55 {
56 global $lng, $ilCtrl, $ilAccess;
57
58 $i = $a_set["Nr"];
59 $this->tpl->setVariable("CHECKBOX",
60 ilUtil::formCheckBox("", "area[]", $i));
61 $this->tpl->setVariable("VAR_NAME", "name_".$i);
62 $this->tpl->setVariable("VAL_NAME", $a_set["Link"]["Title"]);
63 $this->tpl->setVariable("VAL_SHAPE", $a_set["Shape"]);
64
65 $this->tpl->setVariable("VAL_HIGHL_MODE",
66 ilUtil::formSelect($a_set["HighlightMode"], "hl_mode_".$i,
67 $this->highl_modes, false, true));
68 $this->tpl->setVariable("VAL_HIGHL_CLASS",
69 ilUtil::formSelect($a_set["HighlightClass"], "hl_class_".$i,
70 $this->highl_classes, false, true));
71
72 $this->tpl->setVariable("VAL_COORDS",
73 implode(explode(",", $a_set["Coords"]), ", "));
74 switch ($a_set["Link"]["LinkType"])
75 {
76 case "ExtLink":
77 $this->tpl->setVariable("VAL_LINK", $a_set["Link"]["Href"]);
78 break;
79
80 case "IntLink":
81 $link_str = $this->parent_obj->getMapAreaLinkString($a_set["Link"]["Target"],
82 $a_set["Link"]["Type"], $a_set["Link"]["TargetFrame"]);
83 $this->tpl->setVariable("VAL_LINK", $link_str);
84 break;
85 }
86 }
87
88}
89?>
TableGUI class for image map editor.
Class ilMediaAliasItem.
TableGUI class for pc image map editor.
fillRow($a_set)
Standard Version of Fill Row.
__construct($a_parent_obj, $a_parent_cmd, $a_pc_media_object, $a_parent_node_name)
Constructor.
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.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40