ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilMediaAliasItem.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/Utilities/classes/class.ilDOMUtil.php");
5
17{
18 var $dom;
22
23 function __construct(&$a_dom, $a_hier_id, $a_purpose, $a_pc_id = "",
24 $a_parent_node_name = "MediaObject")
25 {
26 $this->dom = $a_dom;
27 $this->parent_node_name = $a_parent_node_name;
28 $this->hier_id = $a_hier_id;
29 $this->purpose = $a_purpose;
30 $this->setPcId($a_pc_id);
31 $this->item_node = $this->getMAItemNode($this->hier_id, $this->purpose,
32 $this->getPcId());
33 }
34
35 function getMAItemNode($a_hier_id, $a_purpose, $a_pc_id = "", $a_sub_element = "")
36 {
37 if ($a_pc_id != "")
38 {
39 $xpc = xpath_new_context($this->dom);
40 $path = "//PageContent[@PCID = '".$a_pc_id."']/".$this->parent_node_name."/MediaAliasItem[@Purpose='$a_purpose']".$a_sub_element;
41 $res = xpath_eval($xpc, $path);
42 if (count($res->nodeset) == 1)
43 {
44 return $res->nodeset[0];
45 }
46 }
47
48 $xpc = xpath_new_context($this->dom);
49 $path = "//PageContent[@HierId = '".$a_hier_id."']/".$this->parent_node_name."/MediaAliasItem[@Purpose='$a_purpose']".$a_sub_element;
50 $res = xpath_eval($xpc, $path);
51 if (count($res->nodeset) > 0)
52 {
53 return $res->nodeset[0];
54 }
55 }
56
57 function getParameterNodes($a_hier_id, $a_purpose, $a_pc_id = "")
58 {
59 if ($a_pc_id != "")
60 {
61 $xpc = xpath_new_context($this->dom);
62 $path = "//PageContent[@PCID = '".$a_pc_id."']/".$this->parent_node_name."/MediaAliasItem[@Purpose='$a_purpose']/Parameter";
63 $res = xpath_eval($xpc, $path);
64 if (count($res->nodeset) > 0)
65 {
66 return $res->nodeset;
67 }
68 return array();
69 }
70
71 $xpc = xpath_new_context($this->dom);
72 $path = "//PageContent[@HierId = '".$a_hier_id."']/".$this->parent_node_name."/MediaAliasItem[@Purpose='$a_purpose']/Parameter";
73 $res = xpath_eval($xpc, $path);
74 if (count($res->nodeset) > 0)
75 {
76 return $res->nodeset;
77 }
78 }
79
80 function getMapAreaNodes($a_hier_id, $a_purpose, $a_pc_id = "")
81 {
82 if ($a_pc_id != "")
83 {
84 $xpc = xpath_new_context($this->dom);
85 $path = "//PageContent[@PCID = '".$a_pc_id."']/".$this->parent_node_name."/MediaAliasItem[@Purpose='$a_purpose']/MapArea";
86 $res = xpath_eval($xpc, $path);
87 if (count($res->nodeset) > 0)
88 {
89 return $res->nodeset;
90 }
91 return array();
92 }
93
94 $xpc = xpath_new_context($this->dom);
95 $path = "//PageContent[@HierId = '".$a_hier_id."']/".$this->parent_node_name."/MediaAliasItem[@Purpose='$a_purpose']/MapArea";
96 $res = xpath_eval($xpc, $path);
97 if (count($res->nodeset) > 0)
98 {
99 return $res->nodeset;
100 }
101 }
102
108 function setPcId($a_pcid)
109 {
110 $this->pcid = $a_pcid;
111 }
112
118 function getPcId()
119 {
120 return $this->pcid;
121 }
122
128 function exists()
129 {
130 if (is_object($this->item_node))
131 {
132 return true;
133 }
134 else
135 {
136 return false;
137 }
138 }
139
143 function insert()
144 {
145 $xpc = xpath_new_context($this->dom);
146 $path = "//PageContent[@HierId = '".$this->hier_id."']/".$this->parent_node_name;
147 $res = xpath_eval($xpc, $path);
148 if (count($res->nodeset) > 0)
149 {
150 $obj_node = $res->nodeset[0];
151 $item_node = $this->dom->create_element("MediaAliasItem");
152 $item_node = $obj_node->append_child($item_node);
153 $item_node->set_attribute("Purpose", $this->purpose);
154 $this->item_node = $item_node;
155 }
156 }
157
161 function setWidth($a_width)
162 {
163 ilDOMUtil::setFirstOptionalElement($this->dom, $this->item_node, "Layout",
164 array("Caption", "TextRepresentation", "Parameter", "MapArea"),
165 "", array("Width" => $a_width), false);
166 }
167
168
172 function getWidth()
173 {
174 $layout_node = $this->getMAItemNode($this->hier_id, $this->purpose,
175 $this->getPcId(), "/Layout");
176 if (is_object($layout_node))
177 {
178 return $layout_node->get_attribute("Width");
179 }
180 }
181
187 function definesSize()
188 {
189 $layout_node = $this->getMAItemNode($this->hier_id, $this->purpose,
190 $this->getPcId(), "/Layout");
191 if (is_object($layout_node))
192 {
193 return $layout_node->has_attribute("Width");
194 }
195 return false;
196 }
197
201 function deriveSize()
202 {
203 $layout_node = $this->getMAItemNode($this->hier_id, $this->purpose,
204 $this->getPcId(), "/Layout");
205 if (is_object($layout_node))
206 {
207 if ($layout_node->has_attribute("Width"))
208 {
209 $layout_node->remove_attribute("Width");
210 }
211 if ($layout_node->has_attribute("Height"))
212 {
213 $layout_node->remove_attribute("Height");
214 }
215 }
216 }
217
221 function setHeight($a_height)
222 {
223 ilDOMUtil::setFirstOptionalElement($this->dom, $this->item_node, "Layout",
224 array("Caption", "TextRepresentation", "Parameter", "MapArea"),
225 "", array("Height" => $a_height), false);
226 }
227
228
232 function getHeight()
233 {
234 $layout_node = $this->getMAItemNode($this->hier_id, $this->purpose,
235 $this->getPcId(), "/Layout");
236 if (is_object($layout_node))
237 {
238 return $layout_node->get_attribute("Height");
239 }
240 }
241
242
246 function setCaption($a_caption)
247 {
248 ilDOMUtil::setFirstOptionalElement($this->dom, $this->item_node, "Caption",
249 array("TextRepresentation", "Parameter", "MapArea"),
250 $a_caption, array("Align" => "bottom"));
251 }
252
253
257 function getCaption()
258 {
259 $caption_node = $this->getMAItemNode($this->hier_id, $this->purpose,
260 $this->getPcId(), "/Caption");
261 if (is_object($caption_node))
262 {
263 return $caption_node->get_content();
264 }
265 }
266
272 function definesCaption()
273 {
274 $caption_node = $this->getMAItemNode($this->hier_id, $this->purpose,
275 $this->getPcId(), "/Caption");
276 if (is_object($caption_node))
277 {
278 return true;
279 }
280 return false;
281 }
282
286 function deriveCaption()
287 {
288 $caption_node = $this->getMAItemNode($this->hier_id, $this->purpose,
289 $this->getPcId(), "/Caption");
290 if (is_object($caption_node))
291 {
292 $caption_node->unlink_node($caption_node);
293 }
294 }
295
299 function setTextRepresentation($a_text_representation)
300 {
301 ilDOMUtil::setFirstOptionalElement($this->dom, $this->item_node, "TextRepresentation",
302 array("Parameter", "MapArea"),
303 $a_text_representation, array());
304 }
305
310 {
311 $text_representation_node = $this->getMAItemNode($this->hier_id, $this->purpose,
312 $this->getPcId(), "/TextRepresentation");
313 if (is_object($text_representation_node))
314 {
315 return $text_representation_node->get_content();
316 }
317 }
318
325 {
326 $text_representation_node = $this->getMAItemNode($this->hier_id, $this->purpose,
327 $this->getPcId(), "/TextRepresentation");
328 if (is_object($text_representation_node))
329 {
330 return true;
331 }
332 return false;
333 }
334
339 {
340 $text_representation_node = $this->getMAItemNode($this->hier_id, $this->purpose,
341 $this->getPcId(), "/TextRepresentation");
342 if (is_object($text_representation_node))
343 {
344 $text_representation_node->unlink_node($text_representation_node);
345 }
346 }
347
348 function setHorizontalAlign($a_halign)
349 {
350 ilDOMUtil::setFirstOptionalElement($this->dom, $this->item_node, "Layout",
351 array("Caption", "TextRepresentation", "Parameter", "MapArea"),
352 "", array("HorizontalAlign" => $a_halign), false);
353 }
354
355
357 {
358 $layout_node = $this->getMAItemNode($this->hier_id, $this->purpose,
359 $this->getPcId(), "/Layout");
360 if (is_object($layout_node))
361 {
362 return $layout_node->get_attribute("HorizontalAlign");
363 }
364 }
365
369 function setParameters($a_par_array)
370 {
371 $par_nodes = $this->getParameterNodes($this->hier_id, $this->purpose,
372 $this->getPcId());
373 for($i=0; $i < count($par_nodes); $i++)
374 {
375 $par_node = $par_nodes[$i];
376 $par_node->unlink_node($par_node);
377 }
378
379 include_once("./Services/MediaObjects/classes/class.ilMediaItem.php");
380 if (is_array($a_par_array))
381 {
382 foreach($a_par_array as $par => $val)
383 {
384 if (ilMediaItem::checkParameter($par, $val))
385 {
386 $attributes = array("Name" => $par, "Value" => $val);
387 ilDOMUtil::addElementToList($this->dom, $this->item_node,
388 "Parameter", array("MapArea"), "", $attributes);
389 }
390 }
391 }
392 }
393
398 {
399 $par_nodes = $this->getParameterNodes($this->hier_id, $this->purpose,
400 $this->getPcId());
401 $par_arr = array();
402 for($i=0; $i < count($par_nodes); $i++)
403 {
404 $par_node = $par_nodes[$i];
405 $par_arr[] = $par_node->get_attribute("Name")."=\"".$par_node->get_attribute("Value")."\"";
406 }
407 return implode($par_arr, ", ");
408 }
409
413 function getParameters()
414 {
415 $par_nodes = $this->getParameterNodes($this->hier_id, $this->purpose,
416 $this->getPcId());
417 $par_arr = array();
418 for($i=0; $i < count($par_nodes); $i++)
419 {
420 $par_node = $par_nodes[$i];
421 $par_arr[$par_node->get_attribute("Name")] =
422 $par_node->get_attribute("Value");
423 }
424 return $par_arr;
425 }
426
430 function getParameter($a_name)
431 {
432 }
433
440 {
441 $par_nodes = $this->getParameterNodes($this->hier_id, $this->purpose,
442 $this->getPcId());
443 if (count($par_nodes) > 0)
444 {
445 return true;
446 }
447 return false;
448 }
449
454 {
455 $par_nodes = $this->getParameterNodes($this->hier_id, $this->purpose,
456 $this->getPcId());
457 if (count($par_nodes) > 0)
458 {
459 for($i=0; $i < count($par_nodes); $i++)
460 {
461 $par_node = $par_nodes[$i];
462 $par_node->unlink_node($par_node);
463 }
464 }
465 }
466
467
471 function getMapAreas()
472 {
473 $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
474 $this->getPcId());
475 $maparea_arr = array();
476 for($i=0; $i < count($ma_nodes); $i++)
477 {
478 $maparea_node = $ma_nodes[$i];
479 $childs = $maparea_node->child_nodes();
480 $link = array();
481 if ($childs[0]->node_name() == "ExtLink")
482 {
483 $link = array("LinkType" => "ExtLink",
484 "Href" => $childs[0]->get_attribute("Href"),
485 "Title" => $childs[0]->get_content());
486 }
487 if ($childs[0]->node_name() == "IntLink")
488 {
489 $link = array("LinkType" => "IntLink",
490 "Target" => $childs[0]->get_attribute("Target"),
491 "Type" => $childs[0]->get_attribute("Type"),
492 "TargetFrame" => $childs[0]->get_attribute("TargetFame"),
493 "Title" => $childs[0]->get_content());
494 }
495 $maparea_arr[] = array(
496 "Nr" => $i + 1,
497 "Shape" => $maparea_node->get_attribute("Shape"),
498 "Coords" => $maparea_node->get_attribute("Coords"),
499 "HighlightMode" => $maparea_node->get_attribute("HighlightMode"),
500 "HighlightClass" => $maparea_node->get_attribute("HighlightClass"),
501 "Id" => $maparea_node->get_attribute("Id"),
502 "Link" => $link);
503 }
504
505 return $maparea_arr;
506 }
507
511 function setAreaTitle($a_nr, $a_title)
512 {
513 $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
514 $this->getPcId());
515 if (is_object($ma_nodes[$a_nr - 1]))
516 {
517 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
518 if (is_object($childs[0]) &&
519 ($childs[0]->node_name() == "IntLink" || $childs[0]->node_name() == "ExtLink"))
520 {
521 $childs[0]->set_content($a_title);
522 }
523 }
524 }
525
529 function setAreaIntLink($a_nr, $a_type, $a_target, $a_target_frame)
530 {
531 $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
532 $this->getPcId());
533 if (is_object($ma_nodes[$a_nr - 1]))
534 {
535 $title = $this->getTitleOfArea($a_nr);
536 ilDOMUtil::deleteAllChildsByName($ma_nodes[$a_nr - 1], array("IntLink", "ExtLink"));
537 $attributes = array("Type" => $a_type, "Target" => $a_target,
538 "TargetFrame" => $a_target_frame);
539 ilDOMUtil::setFirstOptionalElement($this->dom, $ma_nodes[$a_nr - 1], "IntLink",
540 array(""), $title, $attributes);
541 }
542 }
543
547 function setAreaExtLink($a_nr, $a_href)
548 {
549 $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
550 $this->getPcId());
551 if (is_object($ma_nodes[$a_nr - 1]))
552 {
553 $title = $this->getTitleOfArea($a_nr);
554 ilDOMUtil::deleteAllChildsByName($ma_nodes[$a_nr - 1], array("IntLink", "ExtLink"));
555 $attributes = array("Href" => $a_href);
556 ilDOMUtil::setFirstOptionalElement($this->dom, $ma_nodes[$a_nr - 1], "ExtLink",
557 array(""), $title, $attributes);
558 }
559 }
560
564 function setShape($a_nr, $a_shape_type, $a_coords)
565 {
566 $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
567 $this->getPcId());
568 if (is_object($ma_nodes[$a_nr - 1]))
569 {
570 $ma_nodes[$a_nr - 1]->set_attribute("Shape", $a_shape_type);
571 $ma_nodes[$a_nr - 1]->set_attribute("Coords", $a_coords);
572 }
573 }
574
578 function setAreaHighlightMode($a_nr, $a_mode)
579 {
580 $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
581 $this->getPcId());
582 if (is_object($ma_nodes[$a_nr - 1]))
583 {
584 $ma_nodes[$a_nr - 1]->set_attribute("HighlightMode", $a_mode);
585 }
586 }
587
591 function setAreaHighlightClass($a_nr, $a_class)
592 {
593 $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
594 $this->getPcId());
595 if (is_object($ma_nodes[$a_nr - 1]))
596 {
597 $ma_nodes[$a_nr - 1]->set_attribute("HighlightClass", $a_class);
598 }
599 }
600
604 function addMapArea($a_shape_type, $a_coords, $a_title,
605 $a_link, $a_id = "")
606 {
607 $attributes = array("Shape" => $a_shape_type,
608 "Coords" => $a_coords, "Id" => $a_id);
609
610 $ma_node = ilDOMUtil::addElementToList($this->dom, $this->item_node,
611 "MapArea", array(), "", $attributes);
612
613 if ($a_link["LinkType"] == "int" || $a_link["LinkType"] == "IntLink")
614 {
615 $attributes = array("Type" => $a_link["Type"],
616 "TargetFrame" => $a_link["TargetFrame"],
617 "Target" => $a_link["Target"]);
618 ilDOMUtil::setFirstOptionalElement($this->dom, $ma_node, "IntLink",
619 array(""), $a_title, $attributes);
620 }
621 if ($a_link["LinkType"] == "ext" || $a_link["LinkType"] == "ExtLink")
622 {
623 $attributes = array("Href" => $a_link["Href"]);
624 ilDOMUtil::setFirstOptionalElement($this->dom, $ma_node, "ExtLink",
625 array(""), $a_title, $attributes);
626 }
627 }
628
632 function deleteMapArea($a_nr)
633 {
634 $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
635 $this->getPcId());
636
637 if (is_object($ma_nodes[$a_nr - 1]))
638 {
639 $ma_nodes[$a_nr - 1]->unlink_node($ma_nodes[$a_nr - 1]);
640 }
641 }
642
646 function deleteMapAreaById($a_id)
647 {
648 $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
649 $this->getPcId());
650 foreach ($ma_nodes as $node)
651 {
652 if ($node->get_attribute("Id") == $a_id)
653 {
654 $node->unlink_node($node);
655 }
656 }
657 }
658
663 {
664 $xpc = xpath_new_context($this->dom);
665 $path = "//PageContent[@HierId = '".$this->hier_id."']/".$this->parent_node_name."/MediaAliasItem[@Purpose='".$this->purpose."']/MapArea";
666 $res = xpath_eval($xpc, $path);
667 for ($i = 0; $i < count($res->nodeset); $i++)
668 {
669 $res->nodeset[$i]->unlink_node($res->nodeset[$i]);
670 }
671 }
672
676 function getLinkTypeOfArea($a_nr)
677 {
678 $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
679 $this->getPcId());
680 if (is_object($ma_nodes[$a_nr - 1]))
681 {
682 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
683 if ($childs[0]->node_name() == "IntLink")
684 {
685 return "int";
686 }
687 if ($childs[0]->node_name() == "ExtLink")
688 {
689 return "ext";
690 }
691 }
692 }
693
697 function getTypeOfArea($a_nr)
698 {
699 $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
700 $this->getPcId());
701 if (is_object($ma_nodes[$a_nr - 1]))
702 {
703 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
704 return $childs[0]->get_attribute("Type");
705 }
706 }
707
711 function getTargetOfArea($a_nr)
712 {
713 $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
714 $this->getPcId());
715 if (is_object($ma_nodes[$a_nr - 1]))
716 {
717 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
718 return $childs[0]->get_attribute("Target");
719 }
720 }
721
725 function getTargetFrameOfArea($a_nr)
726 {
727 $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
728 $this->getPcId());
729 if (is_object($ma_nodes[$a_nr - 1]))
730 {
731 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
732 return $childs[0]->get_attribute("TargetFrame");
733 }
734 }
735
739 function getHrefOfArea($a_nr)
740 {
741 $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
742 $this->getPcId());
743 if (is_object($ma_nodes[$a_nr - 1]))
744 {
745 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
746 return $childs[0]->get_attribute("Href");
747 }
748 }
749
753 function getTitleOfArea($a_nr)
754 {
755 $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
756 $this->getPcId());
757 if (is_object($ma_nodes[$a_nr - 1]))
758 {
759 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
760 return $childs[0]->get_content();
761 }
762 }
763
767 function delete()
768 {
769 if (is_object($this->item_node))
770 {
771 $this->item_node->unlink_node($this->item_node);
772 }
773 }
774
781 function makeMapWorkCopy($a_st_item, $a_area_nr = 0, $a_exclude = false,
782 $a_output_new_area, $a_area_type, $a_coords)
783 {
784 global $lng;
785
786 if (!$a_st_item->copyOriginal())
787 {
788 return false;
789 }
790 $a_st_item->buildMapWorkImage();
791
792 // determine ratios (first see whether the instance has w/h defined)
793 $width = $this->getWidth();
794 $height = $this->getHeight();
795
796 // if instance has no size, use object w/h
797 if ($width == 0 && $height == 0)
798 {
799 $width = $a_st_item->getWidth();
800 $height = $a_st_item->getHeight();
801 }
802 $size = @getimagesize($a_st_item->getMapWorkCopyName());
803 $x_ratio = 1;
804 if ($size[0] > 0 && $width > 0)
805 {
806 $x_ratio = $width / $size[0];
807 }
808 $y_ratio = 1;
809 if ($size[1] > 0 && $height > 0)
810 {
811 $y_ratio = $height / $size[1];
812 }
813
814 // draw map areas
815 $areas = $this->getMapAreas();
816 for ($i=0; $i < count($areas); $i++)
817 {
818 if ( ((($i+1) == $a_area_nr) && !$a_exclude) ||
819 ((($i+1) != $a_area_nr) && $a_exclude) ||
820 ($a_area_nr == 0)
821 )
822 {
823 $area = new ilMapArea();
824 $area->setShape($areas[$i]["Shape"]);
825 $area->setCoords($areas[$i]["Coords"]);
826 $area->draw($a_st_item->getMapWorkImage(), $a_st_item->color1, $a_st_item->color2, true,
827 $x_ratio, $y_ratio);
828 }
829 }
830
831 if ($a_output_new_area)
832 {
833 $area = new ilMapArea();
834 $area->setShape($a_area_type);
835 $area->setCoords($a_coords);
836 $area->draw($a_st_item->getMapWorkImage(), $a_st_item->color1, $a_st_item->color2, false,
837 $x_ratio, $y_ratio);
838 }
839
840 $a_st_item->saveMapWorkImage();
841
842 return true;
843 }
844
845}
846?>
$size
Definition: RandomTest.php:79
$path
Definition: aliased.php:25
An exception for terminatinating execution or to throw for unit testing.
static addElementToList($doc, $parent_node, $a_node_name, $a_successors, $a_content, $a_attributes)
Places a new node $a_node_name directly before nodes with names of $a_successors.
static setFirstOptionalElement($doc, $parent_node, $a_node_name, $a_successors, $a_content, $a_attributes, $a_remove_childs=true)
searches for an element $a_node_name within the childs of $parent_node if no node is found,...
static deleteAllChildsByName($a_parent, $a_node_names)
delete all childs of a node by names in $a_node_names
Class ilMapArea.
Class ilMediaAliasItem.
getTargetFrameOfArea($a_nr)
Get target frame (only interna link.
setWidth($a_width)
Set width.
definesTextRepresentation()
check if alias item defines own TextRepresentation or derives TextRepresentation from object
setParameters($a_par_array)
set parameter
setCaption($a_caption)
Set Caption.
exists()
check if item node exists
getMapAreaNodes($a_hier_id, $a_purpose, $a_pc_id="")
setAreaTitle($a_nr, $a_title)
Set title of area.
deleteMapAreaById($a_id)
Delete map areas by id.
getLinkTypeOfArea($a_nr)
Get link type.
deleteMapArea($a_nr)
Delete a sinlge map area.
definesParameters()
check if alias item defines own parameters or derives parameters from object
setShape($a_nr, $a_shape_type, $a_coords)
Set shape and coords of single area.
setAreaHighlightClass($a_nr, $a_class)
Set highlight class single area.
setTextRepresentation($a_text_representation)
Set TextRepresentation.
getParameterString()
Get all parameters as string.
insert()
inserts new node in dom
setPcId($a_pcid)
Set PC Id.
__construct(&$a_dom, $a_hier_id, $a_purpose, $a_pc_id="", $a_parent_node_name="MediaObject")
definesSize()
check if alias item defines own size or derives size from object
getParameter($a_name)
get a single parameter
getHrefOfArea($a_nr)
Get href (only external link)
getTypeOfArea($a_nr)
Get type (only interna link.
getTextRepresentation()
Get TextRepresentation.
getMAItemNode($a_hier_id, $a_purpose, $a_pc_id="", $a_sub_element="")
setAreaIntLink($a_nr, $a_type, $a_target, $a_target_frame)
Set link of area to an internal one.
getTitleOfArea($a_nr)
Get title.
deriveSize()
derive size from object (-> width and height attributes are removed from layout element)
deriveParameters()
derive parameters from object (-> all parameter elements are removed from media alias item)
setHeight($a_height)
Set Height.
setAreaExtLink($a_nr, $a_href)
Set link of area to an external one.
setAreaHighlightMode($a_nr, $a_mode)
Set highlight mode single area.
getTargetOfArea($a_nr)
Get target (only interna link.
deleteAllMapAreas()
Delete all map areas.
deriveTextRepresentation()
derive TextRepresentation from object (-> TextRepresentation element is removed from media alias item...
makeMapWorkCopy($a_st_item, $a_area_nr=0, $a_exclude=false, $a_output_new_area, $a_area_type, $a_coords)
make map work copy of image
deriveCaption()
derive caption from object (-> caption element is removed from media alias item)
getParameters()
Get all parameters as array.
getParameterNodes($a_hier_id, $a_purpose, $a_pc_id="")
getMapAreas()
Get all map areas.
addMapArea($a_shape_type, $a_coords, $a_title, $a_link, $a_id="")
Add a new area to the map.
definesCaption()
check if alias item defines own caption or derives caption from object
static checkParameter($a_par, $a_val)
Check parameter (filter javascript related and other unsafe parameters/values)
xpath_eval($xpath_context, $eval_str, $contextnode=null)
xpath_new_context($dom_document)
global $lng
Definition: privfeed.php:17
$a_type
Definition: workflow.php:93