24 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
40 function __construct($a_parent_obj, $a_parent_cmd, $a_media_object)
45 $this->media_object = $a_media_object;
48 $this->
addColumn($this->lng->txt(
"cont_name"),
"",
"");
49 $this->
addColumn($this->lng->txt(
"cont_shape"),
"",
"");
50 $this->
addColumn($this->lng->txt(
"cont_coords"),
"",
"");
51 $this->
addColumn($this->lng->txt(
"cont_link"),
"",
"");
54 $this->
setRowTemplate(
"tpl.image_map_table_row.html",
"Services/MediaObjects");
60 $this->
addMultiCommand(
"editShapeRectangle", $lng->txt(
"cont_edit_shape_rectangle"));
61 $this->
addMultiCommand(
"editShapeCircle", $lng->txt(
"cont_edit_shape_circle"));
62 $this->
addMultiCommand(
"editShapePolygon", $lng->txt(
"cont_edit_shape_polygon"));
67 $this->
addCommandButton(
"updateAreas", $this->lng->txt(
"cont_update_names"));
69 $this->
addCommandButton(
"addRectangle", $this->lng->txt(
"cont_add_rectangle"));
81 $st_item =& $this->media_object->getMediaItem(
"Standard");
85 include_once(
"./Services/MediaObjects/classes/class.ilMapArea.php");
86 for ($i=1; $i<=$max; $i++)
88 $area =
new ilMapArea($st_item->getId(), $i);
89 $areas[] = array(
"nr" => $i,
"area" => $area);
103 $area = $a_set[
"area"];
105 $this->tpl->setVariable(
"CHECKBOX",
106 ilUtil::formCheckBox(
"",
"area[]", $i));
107 $this->tpl->setVariable(
"VAR_NAME",
"name_".$i);
108 $this->tpl->setVariable(
"VAL_NAME", $area->getTitle());
109 $this->tpl->setVariable(
"VAL_SHAPE", $area->getShape());
110 $this->tpl->setVariable(
"VAL_COORDS",
111 implode(explode(
",", $area->getCoords()),
", "));
112 switch ($area->getLinkType())
115 $this->tpl->setVariable(
"VAL_LINK", $area->getHRef());
119 $link_str = $this->parent_obj->getMapAreaLinkString($area->getTarget(),
120 $area->getType(), $area->getTargetFrame());
121 $this->tpl->setVariable(
"VAL_LINK", $link_str);