39 string $a_parent_node_name =
"MediaObject" 43 $this->
lng = $DIC->language();
45 $this->parent_node_name = $a_parent_node_name;
46 $this->hier_id = $a_hier_id;
47 $this->purpose = $a_purpose;
60 string $a_sub_element =
"" 64 $path =
"//PageContent[@PCID = '" . $a_pc_id .
"']/" . $this->parent_node_name .
"/MediaAliasItem[@Purpose='$a_purpose']" . $a_sub_element;
66 if (count(
$res->nodeset) == 1) {
67 return $res->nodeset[0];
72 $path =
"//PageContent[@HierId = '" . $a_hier_id .
"']/" . $this->parent_node_name .
"/MediaAliasItem[@Purpose='$a_purpose']" . $a_sub_element;
74 if (count(
$res->nodeset) > 0) {
75 return $res->nodeset[0];
87 $path =
"//PageContent[@PCID = '" . $a_pc_id .
"']/" . $this->parent_node_name .
"/MediaAliasItem[@Purpose='$a_purpose']/Parameter";
89 if (count(
$res->nodeset) > 0) {
95 $path =
"//PageContent[@HierId = '" . $a_hier_id .
"']/" . $this->parent_node_name .
"/MediaAliasItem[@Purpose='$a_purpose']/Parameter";
97 if (count(
$res->nodeset) > 0) {
109 if ($a_pc_id !=
"") {
110 $path =
"//PageContent[@PCID = '" . $a_pc_id .
"']/" . $this->parent_node_name .
"/MediaAliasItem[@Purpose='$a_purpose']/MapArea";
112 if (count(
$res->nodeset) > 0) {
113 return $res->nodeset;
118 $path =
"//PageContent[@HierId = '" . $a_hier_id .
"']/" . $this->parent_node_name .
"/MediaAliasItem[@Purpose='$a_purpose']/MapArea";
120 if (count(
$res->nodeset) > 0) {
121 return $res->nodeset;
128 $this->pcid = $a_pcid;
141 if (is_object($this->item_node)) {
156 if (count(
$res->nodeset) > 0) {
157 $obj_node =
$res->nodeset[0];
158 $item_node = $this->dom->create_element(
"MediaAliasItem");
171 array(
"Caption",
"TextRepresentation",
"Parameter",
"MapArea"),
173 array(
"Width" => $a_width),
187 if (is_object($layout_node)) {
188 return $layout_node->get_attribute(
"Width");
205 if (is_object($layout_node)) {
206 return $layout_node->has_attribute(
"Width");
222 if (is_object($layout_node)) {
223 if ($layout_node->has_attribute(
"Width")) {
224 $layout_node->remove_attribute(
"Width");
226 if ($layout_node->has_attribute(
"Height")) {
227 $layout_node->remove_attribute(
"Height");
238 array(
"Caption",
"TextRepresentation",
"Parameter",
"MapArea"),
240 array(
"Height" => $a_height),
254 if (is_object($layout_node)) {
255 return $layout_node->get_attribute(
"Height");
266 array(
"TextRepresentation",
"Parameter",
"MapArea"),
268 array(
"Align" =>
"bottom")
280 if (is_object($caption_node)) {
281 return $caption_node->get_content();
298 if (is_object($caption_node)) {
315 if (is_object($caption_node)) {
316 $caption_node->unlink_node($caption_node);
321 string $a_text_representation
326 "TextRepresentation",
327 array(
"Parameter",
"MapArea"),
328 $a_text_representation,
339 "/TextRepresentation" 341 if (is_object($text_representation_node)) {
342 return $text_representation_node->get_content();
357 "/TextRepresentation" 359 if (is_object($text_representation_node)) {
374 "/TextRepresentation" 376 if (is_object($text_representation_node)) {
377 $text_representation_node->unlink_node($text_representation_node);
387 array(
"Caption",
"TextRepresentation",
"Parameter",
"MapArea"),
389 array(
"HorizontalAlign" => $a_halign),
403 if (is_object($layout_node)) {
404 return $layout_node->get_attribute(
"HorizontalAlign");
416 for (
$i = 0;
$i < count($par_nodes);
$i++) {
417 $par_node = $par_nodes[
$i];
418 $par_node->unlink_node($par_node);
421 if (is_array($a_par_array)) {
422 foreach ($a_par_array as $par => $val) {
424 $attributes = array(
"Name" => $par,
"Value" => $val);
449 for (
$i = 0;
$i < count($par_nodes);
$i++) {
450 $par_node = $par_nodes[
$i];
451 $par_arr[] = $par_node->get_attribute(
"Name") .
"=\"" . $par_node->get_attribute(
"Value") .
"\"";
453 return implode(
", ", $par_arr);
467 for (
$i = 0;
$i < count($par_nodes);
$i++) {
468 $par_node = $par_nodes[
$i];
469 $par_arr[$par_node->get_attribute(
"Name")] =
470 $par_node->get_attribute(
"Value");
486 if (count($par_nodes) > 0) {
502 if (count($par_nodes) > 0) {
503 for (
$i = 0;
$i < count($par_nodes);
$i++) {
504 $par_node = $par_nodes[
$i];
505 $par_node->unlink_node($par_node);
521 $maparea_arr = array();
522 for (
$i = 0;
$i < count($ma_nodes);
$i++) {
523 $maparea_node = $ma_nodes[
$i];
524 $childs = $maparea_node->child_nodes();
526 if ($childs[0]->node_name() ==
"ExtLink") {
527 $link = array(
"LinkType" =>
"ExtLink",
528 "Href" => $childs[0]->get_attribute(
"Href"),
529 "Title" => $childs[0]->get_content());
531 if ($childs[0]->node_name() ==
"IntLink") {
532 $link = array(
"LinkType" =>
"IntLink",
533 "Target" => $childs[0]->get_attribute(
"Target"),
534 "Type" => $childs[0]->get_attribute(
"Type"),
535 "TargetFrame" => $childs[0]->get_attribute(
"TargetFame"),
536 "Title" => $childs[0]->get_content());
538 $maparea_arr[] = array(
540 "Shape" => $maparea_node->get_attribute(
"Shape"),
541 "Coords" => $maparea_node->get_attribute(
"Coords"),
542 "HighlightMode" => $maparea_node->get_attribute(
"HighlightMode"),
543 "HighlightClass" => $maparea_node->get_attribute(
"HighlightClass"),
544 "Id" => $maparea_node->get_attribute(
"Id"),
560 if (is_object($ma_nodes[$a_nr - 1])) {
561 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
562 if (is_object($childs[0]) &&
563 ($childs[0]->node_name() ==
"IntLink" || $childs[0]->node_name() ==
"ExtLink")) {
564 $childs[0]->set_content($a_title);
576 string $a_target_frame
583 if (is_object($ma_nodes[$a_nr - 1])) {
586 $attributes = array(
"Type" => $a_type,
"Target" => $a_target,
587 "TargetFrame" => $a_target_frame);
590 $ma_nodes[$a_nr - 1],
611 if (is_object($ma_nodes[$a_nr - 1])) {
617 $ma_nodes[$a_nr - 1],
631 string $a_shape_type,
639 if (is_object($ma_nodes[$a_nr - 1])) {
640 $ma_nodes[$a_nr - 1]->set_attribute(
"Shape", $a_shape_type);
641 $ma_nodes[$a_nr - 1]->set_attribute(
"Coords", $a_coords);
657 if (is_object($ma_nodes[$a_nr - 1])) {
658 $ma_nodes[$a_nr - 1]->set_attribute(
"HighlightMode", $a_mode);
674 if (is_object($ma_nodes[$a_nr - 1])) {
675 $ma_nodes[$a_nr - 1]->set_attribute(
"HighlightClass", $a_class);
683 string $a_shape_type,
690 "Coords" => $a_coords,
"Id" => $a_id);
701 if ($a_link[
"LinkType"] ==
"int" || $a_link[
"LinkType"] ==
"IntLink") {
703 "TargetFrame" => $a_link[
"TargetFrame"],
704 "Target" => $a_link[
"Target"]);
714 if ($a_link[
"LinkType"] ==
"ext" || $a_link[
"LinkType"] ==
"ExtLink") {
738 if (is_object($ma_nodes[$a_nr - 1])) {
739 $ma_nodes[$a_nr - 1]->unlink_node($ma_nodes[$a_nr - 1]);
754 foreach ($ma_nodes as $node) {
755 if ($node->get_attribute(
"Id") == $a_id) {
756 $node->unlink_node($node);
767 $path =
"//PageContent[@HierId = '" . $this->hier_id .
"']/" . $this->parent_node_name .
"/MediaAliasItem[@Purpose='" . $this->purpose .
"']/MapArea";
769 for (
$i = 0;
$i < count(
$res->nodeset);
$i++) {
784 if (is_object($ma_nodes[$a_nr - 1])) {
785 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
786 if ($childs[0]->node_name() ==
"IntLink") {
789 if ($childs[0]->node_name() ==
"ExtLink") {
806 if (is_object($ma_nodes[$a_nr - 1])) {
807 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
808 return $childs[0]->get_attribute(
"Type");
823 if (is_object($ma_nodes[$a_nr - 1])) {
824 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
825 return $childs[0]->get_attribute(
"Target");
840 if (is_object($ma_nodes[$a_nr - 1])) {
841 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
842 return $childs[0]->get_attribute(
"TargetFrame");
857 if (is_object($ma_nodes[$a_nr - 1])) {
858 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
859 return $childs[0]->get_attribute(
"Href");
874 if (is_object($ma_nodes[$a_nr - 1])) {
875 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
876 return $childs[0]->get_content();
884 public function delete():
void 886 if (is_object($this->item_node)) {
887 $this->item_node->unlink_node($this->item_node);
900 bool $a_output_new_area,
912 if ($width == 0 && $height == 0) {
918 if ($size[0] > 0 && $width > 0) {
919 $x_ratio = $width / $size[0];
922 if ($size[1] > 0 && $height > 0) {
923 $y_ratio = $height / $size[1];
928 for (
$i = 0;
$i < count($areas);
$i++) {
929 if ((((
$i + 1) == $a_area_nr) && !$a_exclude) ||
930 (((
$i + 1) != $a_area_nr) && $a_exclude) ||
934 $area->setShape($areas[
$i][
"Shape"]);
935 $area->setCoords($areas[$i][
"Coords"]);
947 if ($a_output_new_area) {
949 $area->setShape($a_area_type);
950 $area->setCoords($a_coords);
xpath_eval(php4DOMXPath $xpath_context, string $eval_str, $contextnode=null)
static setFirstOptionalElement(php4DOMDocument $doc, php4DOMElement $parent_node, string $a_node_name, array $a_successors, string $a_content, array $a_attributes, bool $a_remove_childs=true)
searches for an element $a_node_name within the childs of $parent_node if no node is found...
static addElementToList(php4DOMDocument $doc, php4DOMElement $parent_node, string $a_node_name, array $a_successors, string $a_content, array $a_attributes)
Places a new node $a_node_name directly before nodes with names of $a_successors. ...
set_attribute($name, $value)
static deleteAllChildsByName(php4DOMElement $a_parent, array $a_node_names)
delete all childs of a node by names in $a_node_names
xpath_new_context($dom_document)