5 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
6 include_once(
"Services/MediaObjects/classes/class.ilImageMapTableGUI.php");
22 function __construct($a_parent_obj, $a_parent_cmd, $a_pc_media_object,
27 $this->
setId(
"cont_iim_tr");
29 $this->parent_node_name = $a_parent_node_name;
30 $this->pc_media_object = $a_pc_media_object;
31 $this->mob = $this->pc_media_object->getMediaObject();
33 $this->areas =
array();
34 foreach ($this->pc_media_object->getStandardAliasItem()->getMapAreas() as $a)
36 $this->area[$a[
"Id"]] = $a;
39 $this->ov_files = $this->mob->getFilesOfDirectory(
"overlays");
40 $this->ov_options =
array(
"" => $lng->txt(
"please_select"));
41 foreach ($this->ov_files as $of)
43 $this->ov_options[$of] = $of;
45 $this->popups = $this->pc_media_object->getPopups();
46 $this->pop_options =
array(
"" => $lng->txt(
"please_select"));
47 foreach ($this->popups as $k => $p)
49 $this->pop_options[$p[
"nr"]] = $p[
"title"];
51 parent::__construct($a_parent_obj, $a_parent_cmd, $a_pc_media_object->getMediaObject());
52 $this->
setRowTemplate(
"tpl.iim_trigger_row.html",
"Services/COPage");
61 $this->
addColumn($this->lng->txt(
"title"),
"Title",
"");
62 $this->
addColumn($this->lng->txt(
"type"),
"",
"");
63 $this->
addColumn($this->lng->txt(
"cont_coords"),
"",
"");
64 $this->
addColumn($this->lng->txt(
"cont_overlay_image"),
"",
"");
65 $this->
addColumn($this->lng->txt(
"cont_content_popup"),
"",
"");
66 $this->
addColumn($this->lng->txt(
"actions"),
"",
"");
82 $this->
addCommandButton(
"updateTrigger", $lng->txt(
"save"),
"",
"update_tr_button");
92 $triggers = $this->pc_media_object->getTriggers();
110 if ($a_set[
"Overlay"] !=
"")
112 $this->tpl->setCurrentBlock(
"cmd");
113 $this->tpl->setVariable(
"CMD_ID",
"ov_".$i);
114 $this->tpl->setVariable(
"HREF_CMD",
"#");
115 $this->tpl->setVariable(
"CMD_CLASS",
"ov_cmd");
116 $this->tpl->setVariable(
"TXT_CMD", $lng->txt(
"cont_edit_overlay_position"));
117 $this->tpl->parseCurrentBlock();
121 if ($a_set[
"PopupNr"] !=
"")
123 $this->tpl->setCurrentBlock(
"cmd");
124 $this->tpl->setVariable(
"CMD_ID",
"pop_".$i);
125 $this->tpl->setVariable(
"HREF_CMD",
"#");
126 $this->tpl->setVariable(
"CMD_CLASS",
"pop_cmd");
127 $this->tpl->setVariable(
"TXT_CMD", $lng->txt(
"cont_edit_popup_position"));
128 $this->tpl->parseCurrentBlock();
133 $this->tpl->setCurrentBlock(
"coords");
134 $this->tpl->setVariable(
"VAL_COORDS",
135 implode(explode(
",", $this->area[$a_set[
"Nr"]][
"Coords"]),
", "));
136 $this->tpl->parseCurrentBlock();
138 $this->tpl->setVariable(
"TYPE",
139 $lng->txt(
"cont_".$this->area[$a_set[
"Nr"]][
"Shape"]));
144 $this->tpl->setCurrentBlock(
"cmd");
145 $this->tpl->setVariable(
"CMD_ID",
"mark_".$i);
146 $this->tpl->setVariable(
"HREF_CMD",
"#");
147 $this->tpl->setVariable(
"CMD_CLASS",
"mark_cmd");
148 $this->tpl->setVariable(
"TXT_CMD", $lng->txt(
"cont_edit_marker_position"));
149 $this->tpl->parseCurrentBlock();
152 $this->tpl->setCurrentBlock(
"marker_pos");
153 $this->tpl->setVariable(
"VAR_MARK_POS",
"markpos[".$i.
"]");
154 $this->tpl->setVariable(
"ID_MARK_POS",
"markpos_".$i);
155 $this->tpl->setVariable(
"VAL_MARK_POS", $a_set[
"MarkerX"].
",".$a_set[
"MarkerY"]);
156 $this->tpl->setVariable(
"TXT_MLEFT", $lng->txt(
"cont_left"));
157 $this->tpl->setVariable(
"TXT_MTOP", $lng->txt(
"cont_top"));
158 $this->tpl->parseCurrentBlock();
160 $this->tpl->setVariable(
"TYPE", $lng->txt(
"cont_marker"));
163 $this->tpl->setVariable(
"CHECKBOX",
164 ilUtil::formCheckBox(
"",
"tr[]", $i));
165 $this->tpl->setVariable(
"VAR_NAME",
"title[".$i.
"]");
166 $this->tpl->setVariable(
"VAL_NAME", $a_set[
"Title"]);
169 $this->tpl->setVariable(
"VAR_POS",
"ovpos[".$i.
"]");
170 $this->tpl->setVariable(
"ID_OV_POS",
"ovpos_".$i);
171 $this->tpl->setVariable(
"ID_POP_POS",
"poppos_".$i);
172 $this->tpl->setVariable(
"VAR_POP_POS",
"poppos[".$i.
"]");
173 $this->tpl->setVariable(
"VAR_POP_SIZE",
"popsize[".$i.
"]");
174 $this->tpl->setVariable(
"VAL_POS", $a_set[
"OverlayX"].
",".$a_set[
"OverlayY"]);
175 $this->tpl->setVariable(
"VAL_POP_POS", $a_set[
"PopupX"].
",".$a_set[
"PopupY"]);
176 $this->tpl->setVariable(
"VAL_POP_SIZE", $a_set[
"PopupWidth"].
",".$a_set[
"PopupHeight"]);
177 $this->tpl->setVariable(
"TXT_IMG", $lng->txt(
"image"));
178 $this->tpl->setVariable(
"TXT_TITLE", $lng->txt(
"title"));
179 $this->tpl->setVariable(
"TXT_LEFT", $lng->txt(
"cont_left"));
180 $this->tpl->setVariable(
"TXT_TOP", $lng->txt(
"cont_top"));
181 $this->tpl->setVariable(
"TXT_WIDTH", $lng->txt(
"cont_width"));
182 $this->tpl->setVariable(
"TXT_HEIGHT", $lng->txt(
"cont_height"));
183 $this->tpl->setVariable(
"OVERLAY_IMAGE",
185 $this->tpl->setVariable(
"CONTENT_POPUP",
186 ilUtil::formSelect($a_set[
"PopupNr"],
"pop[".$i.
"]", $this->pop_options,
false,
true));
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
initColumns()
Init columns.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
__construct($a_parent_obj, $a_parent_cmd, $a_pc_media_object, $a_parent_node_name)
Constructor.
TableGUI class for pc image map editor.
fillRow($a_set)
Standard Version of Fill Row.
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.
getItems()
Get items of current folder.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
initActions()
Init actions.
TableGUI class for image map editor.
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.