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"),
"title",
"");
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"));
82 $st_item =& $this->media_object->getMediaItem(
"Standard");
86 include_once(
"./Services/MediaObjects/classes/class.ilMapArea.php");
87 for ($i=1; $i<=$max; $i++)
89 $area =
new ilMapArea($st_item->getId(), $i);
90 $areas[] = array(
"nr" => $i,
"area" => $area,
"title" => $area->getTitle());
104 $area = $a_set[
"area"];
106 $this->tpl->setVariable(
"CHECKBOX",
107 ilUtil::formCheckBox(
"",
"area[]", $i));
108 $this->tpl->setVariable(
"VAR_NAME",
"name_".$i);
109 $this->tpl->setVariable(
"VAL_NAME", $area->getTitle());
110 $this->tpl->setVariable(
"VAL_SHAPE", $area->getShape());
111 $this->tpl->setVariable(
"VAL_COORDS",
112 implode(explode(
",", $area->getCoords()),
", "));
113 switch ($area->getLinkType())
116 $this->tpl->setVariable(
"VAL_LINK", $area->getHRef());
120 $link_str = $this->parent_obj->getMapAreaLinkString($area->getTarget(),
121 $area->getType(), $area->getTargetFrame());
122 $this->tpl->setVariable(
"VAL_LINK", $link_str);