45 $this->hier_id = $a_hier_id;
46 $this->purpose = $a_purpose;
49 $this->item_node = $this->
getMAItemNode($this->hier_id, $this->purpose,
54 function getMAItemNode($a_hier_id, $a_purpose, $a_pc_id =
"", $a_sub_element =
"")
59 $path =
"//PageContent[@PCID = '".$a_pc_id.
"']/MediaObject/MediaAliasItem[@Purpose='$a_purpose']".$a_sub_element;
61 if (count(
$res->nodeset) == 1)
63 return $res->nodeset[0];
68 $path =
"//PageContent[@HierId = '".$a_hier_id.
"']/MediaObject/MediaAliasItem[@Purpose='$a_purpose']".$a_sub_element;
70 if (count(
$res->nodeset) > 0)
72 return $res->nodeset[0];
81 $path =
"//PageContent[@PCID = '".$a_pc_id.
"']/MediaObject/MediaAliasItem[@Purpose='$a_purpose']/Parameter";
83 if (count(
$res->nodeset) > 0)
91 $path =
"//PageContent[@HierId = '".$a_hier_id.
"']/MediaObject/MediaAliasItem[@Purpose='$a_purpose']/Parameter";
93 if (count(
$res->nodeset) > 0)
104 $path =
"//PageContent[@PCID = '".$a_pc_id.
"']/MediaObject/MediaAliasItem[@Purpose='$a_purpose']/MapArea";
106 if (count(
$res->nodeset) > 0)
108 return $res->nodeset;
114 $path =
"//PageContent[@HierId = '".$a_hier_id.
"']/MediaObject/MediaAliasItem[@Purpose='$a_purpose']/MapArea";
116 if (count(
$res->nodeset) > 0)
118 return $res->nodeset;
129 $this->pcid = $a_pcid;
149 if (is_object($this->item_node))
165 $path =
"//PageContent[@HierId = '".$this->hier_id.
"']/MediaObject";
167 if (count(
$res->nodeset) > 0)
169 $obj_node =&
$res->nodeset[0];
170 $item_node =& $this->dom->create_element(
"MediaAliasItem");
172 $item_node->set_attribute(
"Purpose", $this->purpose);
183 array(
"Caption",
"Parameter",
"MapArea"),
184 "", array(
"Width" => $a_width),
false);
193 $layout_node = $this->
getMAItemNode($this->hier_id, $this->purpose,
195 if (is_object($layout_node))
197 return $layout_node->get_attribute(
"Width");
208 $layout_node = $this->
getMAItemNode($this->hier_id, $this->purpose,
210 if (is_object($layout_node))
212 return $layout_node->has_attribute(
"Width");
222 $layout_node = $this->
getMAItemNode($this->hier_id, $this->purpose,
224 if (is_object($layout_node))
226 if ($layout_node->has_attribute(
"Width"))
228 $layout_node->remove_attribute(
"Width");
230 if ($layout_node->has_attribute(
"Height"))
232 $layout_node->remove_attribute(
"Height");
243 array(
"Caption",
"Parameter",
"MapArea"),
244 "", array(
"Height" => $a_height),
false);
253 $layout_node = $this->
getMAItemNode($this->hier_id, $this->purpose,
255 if (is_object($layout_node))
257 return $layout_node->get_attribute(
"Height");
268 array(
"Parameter",
"MapArea"),
269 $a_caption, array(
"Align" =>
"bottom"));
278 $caption_node = $this->
getMAItemNode($this->hier_id, $this->purpose,
280 if (is_object($caption_node))
282 return $caption_node->get_content();
293 $caption_node = $this->
getMAItemNode($this->hier_id, $this->purpose,
295 if (is_object($caption_node))
307 $caption_node = $this->
getMAItemNode($this->hier_id, $this->purpose,
309 if (is_object($caption_node))
311 $caption_node->unlink_node($caption_node);
318 array(
"Caption",
"Parameter",
"MapArea"),
319 "", array(
"HorizontalAlign" => $a_halign),
false);
325 $layout_node = $this->
getMAItemNode($this->hier_id, $this->purpose,
327 if (is_object($layout_node))
329 return $layout_node->get_attribute(
"HorizontalAlign");
341 for($i=0; $i < count($par_nodes); $i++)
343 $par_node =& $par_nodes[$i];
344 $par_node->unlink_node($par_node);
347 if (is_array($a_par_array))
349 foreach($a_par_array as $par => $val)
351 $attributes = array (
"Name" => $par,
"Value" => $val);
353 "Parameter", array(
"MapArea"),
"", $attributes);
370 for($i=0; $i < count($par_nodes); $i++)
372 $par_node =& $par_nodes[$i];
373 $par_arr[] = $par_node->get_attribute(
"Name").
"=\"".$par_node->get_attribute(
"Value").
"\"";
375 return implode($par_arr,
", ");
395 if (count($par_nodes) > 0)
409 if (count($par_nodes) > 0)
411 for($i=0; $i < count($par_nodes); $i++)
413 $par_node =& $par_nodes[$i];
414 $par_node->unlink_node($par_node);
427 $maparea_arr = array();
428 for($i=0; $i < count($ma_nodes); $i++)
430 $maparea_node = $ma_nodes[$i];
431 $childs = $maparea_node->child_nodes();
433 if ($childs[0]->node_name() ==
"ExtLink")
435 $link = array(
"LinkType" =>
"ExtLink",
436 "Href" => $childs[0]->get_attribute(
"Href"),
437 "Title" => $childs[0]->get_content());
439 if ($childs[0]->node_name() ==
"IntLink")
441 $link = array(
"LinkType" =>
"IntLink",
442 "Target" => $childs[0]->get_attribute(
"Target"),
443 "Type" => $childs[0]->get_attribute(
"Type"),
444 "TargetFrame" => $childs[0]->get_attribute(
"TargetFame"),
445 "Title" => $childs[0]->get_content());
447 $maparea_arr[] = array(
449 "Shape" => $maparea_node->get_attribute(
"Shape"),
450 "Coords" => $maparea_node->get_attribute(
"Coords"),
464 if (is_object($ma_nodes[$a_nr - 1]))
466 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
467 if (is_object($childs[0]) &&
468 ($childs[0]->node_name() ==
"IntLink" || $childs[0]->node_name() ==
"ExtLink"))
470 $childs[0]->set_content($a_title);
482 if (is_object($ma_nodes[$a_nr - 1]))
486 $attributes = array(
"Type" => $a_type,
"Target" => $a_target,
487 "TargetFrame" => $a_target_frame);
489 array(
""),
$title, $attributes);
500 if (is_object($ma_nodes[$a_nr - 1]))
504 $attributes = array(
"Href" => $a_href);
506 array(
""),
$title, $attributes);
517 if (is_object($ma_nodes[$a_nr - 1]))
519 $ma_nodes[$a_nr - 1]->set_attribute(
"Shape", $a_shape_type);
520 $ma_nodes[$a_nr - 1]->set_attribute(
"Coords", $a_coords);
530 $attributes = array(
"Shape" => $a_shape_type,
531 "Coords" => $a_coords);
533 "MapArea", array(),
"", $attributes);
535 if ($a_link[
"LinkType"] ==
"int" || $a_link[
"LinkType"] ==
"IntLink")
537 $attributes = array(
"Type" => $a_link[
"Type"],
538 "TargetFrame" => $a_link[
"TargetFrame"],
539 "Target" => $a_link[
"Target"]);
541 array(
""), $a_title, $attributes);
543 if ($a_link[
"LinkType"] ==
"ext" || $a_link[
"LinkType"] ==
"ExtLink")
545 $attributes = array(
"Href" => $a_link[
"Href"]);
547 array(
""), $a_title, $attributes);
558 if (is_object($ma_nodes[$a_nr - 1]))
560 $ma_nodes[$a_nr - 1]->unlink_node($ma_nodes[$a_nr - 1]);
570 $path =
"//PageContent[@HierId = '".$this->hier_id.
"']/MediaObject/MediaAliasItem[@Purpose='".$this->purpose.
"']/MapArea";
572 for ($i = 0; $i < count(
$res->nodeset); $i++)
574 $res->nodeset[$i]->unlink_node(
$res->nodeset[$i]);
585 if (is_object($ma_nodes[$a_nr - 1]))
587 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
588 if ($childs[0]->node_name() ==
"IntLink")
592 if ($childs[0]->node_name() ==
"ExtLink")
606 if (is_object($ma_nodes[$a_nr - 1]))
608 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
609 return $childs[0]->get_attribute(
"Type");
620 if (is_object($ma_nodes[$a_nr - 1]))
622 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
623 return $childs[0]->get_attribute(
"Target");
634 if (is_object($ma_nodes[$a_nr - 1]))
636 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
637 return $childs[0]->get_attribute(
"TargetFrame");
648 if (is_object($ma_nodes[$a_nr - 1]))
650 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
651 return $childs[0]->get_attribute(
"Href");
662 if (is_object($ma_nodes[$a_nr - 1]))
664 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
665 return $childs[0]->get_content();
674 if (is_object($this->item_node))
676 $this->item_node->unlink_node($this->item_node);
687 $a_output_new_area, $a_area_type, $a_coords)
691 if (!$a_st_item->copyOriginal())
695 $a_st_item->buildMapWorkImage();
698 $size = @getimagesize($a_st_item->getMapWorkCopyName());
712 for ($i=0; $i < count($areas); $i++)
714 if ( ((($i+1) == $a_area_nr) && !$a_exclude) ||
715 ((($i+1) != $a_area_nr) && $a_exclude) ||
720 $area->setShape($areas[$i][
"Shape"]);
721 $area->setCoords($areas[$i][
"Coords"]);
722 $area->draw($a_st_item->getMapWorkImage(), $a_st_item->color1, $a_st_item->color2,
true,
727 if ($a_output_new_area)
730 $area->setShape($a_area_type);
731 $area->setCoords($a_coords);
732 $area->draw($a_st_item->getMapWorkImage(), $a_st_item->color1, $a_st_item->color2,
false,
736 $a_st_item->saveMapWorkImage();