24 require_once(
"./Services/COPage/classes/class.ilPageContent.php");
55 $this->map_node =& $a_node->first_child();
64 function create(&$a_pg_obj, $a_hier_id, $a_pc_id =
"")
69 $this->map_node =& $this->dom->create_element(
"Map");
70 $this->map_node =& $this->node->append_child($this->map_node);
71 $this->map_node->set_attribute(
"Latitude",
"0");
72 $this->map_node->set_attribute(
"Longitude",
"0");
73 $this->map_node->set_attribute(
"Zoom",
"3");
85 $this->map_node->set_attribute(
"Latitude", $a_lat);
89 if ($this->map_node->has_attribute(
"Latitude"))
91 $this->map_node->remove_attribute(
"Latitude");
103 if (is_object($this->map_node))
105 return $this->map_node->get_attribute(
"Latitude");
118 $this->map_node->set_attribute(
"Longitude", $a_long);
122 if ($this->map_node->has_attribute(
"Longitude"))
124 $this->map_node->remove_attribute(
"Longitude");
136 if (is_object($this->map_node))
138 return $this->map_node->get_attribute(
"Longitude");
151 $this->map_node->set_attribute(
"Zoom", $a_zoom);
155 if ($this->map_node->has_attribute(
"Zoom"))
157 $this->map_node->remove_attribute(
"Zoom");
169 if (is_object($this->map_node))
171 return $this->map_node->get_attribute(
"Zoom");
182 function setLayout($a_width, $a_height, $a_horizontal_align)
184 if (is_object($this->map_node))
186 ilDomUtil::setFirstOptionalElement($this->dom, $this->map_node,
187 "Layout", array(
"MapCaption"),
"", array(
"Width" => $a_width,
188 "Height" => $a_height,
"HorizontalAlign" => $a_horizontal_align));
199 if (is_object($this->map_node))
201 $childs = $this->map_node->child_nodes();
202 foreach($childs as $child)
204 if ($child->node_name() ==
"Layout")
206 return $child->get_attribute(
"Width");
219 if (is_object($this->map_node))
221 $childs = $this->map_node->child_nodes();
222 foreach($childs as $child)
224 if ($child->node_name() ==
"Layout")
226 return $child->get_attribute(
"Height");
239 if (is_object($this->map_node))
241 $childs = $this->map_node->child_nodes();
242 foreach($childs as $child)
244 if ($child->node_name() ==
"Layout")
246 return $child->get_attribute(
"HorizontalAlign");
259 if (is_object($this->map_node))
261 ilDomUtil::setFirstOptionalElement($this->dom, $this->map_node,
262 "MapCaption", array(), $a_caption, array());
273 if (is_object($this->map_node))
275 $childs = $this->map_node->child_nodes();
276 foreach($childs as $child)
278 if ($child->node_name() ==
"MapCaption")
280 return $child->get_content();
288 $a_text = str_replace(chr(13).chr(10),
"<br />",$a_text);
289 $a_text = str_replace(chr(13),
"<br />", $a_text);
290 $a_text = str_replace(chr(10),
"<br />", $a_text);
297 $a_text = str_replace(
"<br />",
"\n", $a_text);
298 $a_text = str_replace(
"<br/>",
"\n", $a_text);