ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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{
21 protected $lng;
22
23 public $dom;
24 public $hier_id;
25 public $purpose;
26 public $item_node;
27
28 public function __construct(
29 &$a_dom,
30 $a_hier_id,
31 $a_purpose,
32 $a_pc_id = "",
33 $a_parent_node_name = "MediaObject"
34 ) {
35 global $DIC;
36
37 $this->lng = $DIC->language();
38 $this->dom = $a_dom;
39 $this->parent_node_name = $a_parent_node_name;
40 $this->hier_id = $a_hier_id;
41 $this->purpose = $a_purpose;
42 $this->setPcId($a_pc_id);
43 $this->item_node = $this->getMAItemNode(
44 $this->hier_id,
45 $this->purpose,
46 $this->getPcId()
47 );
48 }
49
50 public function getMAItemNode($a_hier_id, $a_purpose, $a_pc_id = "", $a_sub_element = "")
51 {
52 if ($a_pc_id != "") {
53 $xpc = xpath_new_context($this->dom);
54 $path = "//PageContent[@PCID = '" . $a_pc_id . "']/" . $this->parent_node_name . "/MediaAliasItem[@Purpose='$a_purpose']" . $a_sub_element;
55 $res = xpath_eval($xpc, $path);
56 if (count($res->nodeset) == 1) {
57 return $res->nodeset[0];
58 }
59 }
60
61 $xpc = xpath_new_context($this->dom);
62 $path = "//PageContent[@HierId = '" . $a_hier_id . "']/" . $this->parent_node_name . "/MediaAliasItem[@Purpose='$a_purpose']" . $a_sub_element;
63 $res = xpath_eval($xpc, $path);
64 if (count($res->nodeset) > 0) {
65 return $res->nodeset[0];
66 }
67 }
68
69 public function getParameterNodes($a_hier_id, $a_purpose, $a_pc_id = "")
70 {
71 if ($a_pc_id != "") {
72 $xpc = xpath_new_context($this->dom);
73 $path = "//PageContent[@PCID = '" . $a_pc_id . "']/" . $this->parent_node_name . "/MediaAliasItem[@Purpose='$a_purpose']/Parameter";
74 $res = xpath_eval($xpc, $path);
75 if (count($res->nodeset) > 0) {
76 return $res->nodeset;
77 }
78 return array();
79 }
80
81 $xpc = xpath_new_context($this->dom);
82 $path = "//PageContent[@HierId = '" . $a_hier_id . "']/" . $this->parent_node_name . "/MediaAliasItem[@Purpose='$a_purpose']/Parameter";
83 $res = xpath_eval($xpc, $path);
84 if (count($res->nodeset) > 0) {
85 return $res->nodeset;
86 }
87 }
88
89 public function getMapAreaNodes($a_hier_id, $a_purpose, $a_pc_id = "")
90 {
91 if ($a_pc_id != "") {
92 $xpc = xpath_new_context($this->dom);
93 $path = "//PageContent[@PCID = '" . $a_pc_id . "']/" . $this->parent_node_name . "/MediaAliasItem[@Purpose='$a_purpose']/MapArea";
94 $res = xpath_eval($xpc, $path);
95 if (count($res->nodeset) > 0) {
96 return $res->nodeset;
97 }
98 return array();
99 }
100
101 $xpc = xpath_new_context($this->dom);
102 $path = "//PageContent[@HierId = '" . $a_hier_id . "']/" . $this->parent_node_name . "/MediaAliasItem[@Purpose='$a_purpose']/MapArea";
103 $res = xpath_eval($xpc, $path);
104 if (count($res->nodeset) > 0) {
105 return $res->nodeset;
106 }
107 return array();
108 }
109
115 public function setPcId($a_pcid)
116 {
117 $this->pcid = $a_pcid;
118 }
119
125 public function getPcId()
126 {
127 return $this->pcid;
128 }
129
135 public function exists()
136 {
137 if (is_object($this->item_node)) {
138 return true;
139 } else {
140 return false;
141 }
142 }
143
147 public function insert()
148 {
149 $xpc = xpath_new_context($this->dom);
150 $path = "//PageContent[@HierId = '" . $this->hier_id . "']/" . $this->parent_node_name;
151 $res = xpath_eval($xpc, $path);
152 if (count($res->nodeset) > 0) {
153 $obj_node = $res->nodeset[0];
154 $item_node = $this->dom->create_element("MediaAliasItem");
155 $item_node = $obj_node->append_child($item_node);
156 $item_node->set_attribute("Purpose", $this->purpose);
157 $this->item_node = $item_node;
158 }
159 }
160
164 public function setWidth($a_width)
165 {
167 $this->dom,
168 $this->item_node,
169 "Layout",
170 array("Caption", "TextRepresentation", "Parameter", "MapArea"),
171 "",
172 array("Width" => $a_width),
173 false
174 );
175 }
176
177
181 public function getWidth()
182 {
183 $layout_node = $this->getMAItemNode(
184 $this->hier_id,
185 $this->purpose,
186 $this->getPcId(),
187 "/Layout"
188 );
189 if (is_object($layout_node)) {
190 return $layout_node->get_attribute("Width");
191 }
192 }
193
199 public function definesSize()
200 {
201 $layout_node = $this->getMAItemNode(
202 $this->hier_id,
203 $this->purpose,
204 $this->getPcId(),
205 "/Layout"
206 );
207 if (is_object($layout_node)) {
208 return $layout_node->has_attribute("Width");
209 }
210 return false;
211 }
212
216 public function deriveSize()
217 {
218 $layout_node = $this->getMAItemNode(
219 $this->hier_id,
220 $this->purpose,
221 $this->getPcId(),
222 "/Layout"
223 );
224 if (is_object($layout_node)) {
225 if ($layout_node->has_attribute("Width")) {
226 $layout_node->remove_attribute("Width");
227 }
228 if ($layout_node->has_attribute("Height")) {
229 $layout_node->remove_attribute("Height");
230 }
231 }
232 }
233
237 public function setHeight($a_height)
238 {
240 $this->dom,
241 $this->item_node,
242 "Layout",
243 array("Caption", "TextRepresentation", "Parameter", "MapArea"),
244 "",
245 array("Height" => $a_height),
246 false
247 );
248 }
249
250
254 public function getHeight()
255 {
256 $layout_node = $this->getMAItemNode(
257 $this->hier_id,
258 $this->purpose,
259 $this->getPcId(),
260 "/Layout"
261 );
262 if (is_object($layout_node)) {
263 return $layout_node->get_attribute("Height");
264 }
265 }
266
267
271 public function setCaption($a_caption)
272 {
274 $this->dom,
275 $this->item_node,
276 "Caption",
277 array("TextRepresentation", "Parameter", "MapArea"),
278 $a_caption,
279 array("Align" => "bottom")
280 );
281 }
282
283
287 public function getCaption()
288 {
289 $caption_node = $this->getMAItemNode(
290 $this->hier_id,
291 $this->purpose,
292 $this->getPcId(),
293 "/Caption"
294 );
295 if (is_object($caption_node)) {
296 return $caption_node->get_content();
297 }
298 }
299
305 public function definesCaption()
306 {
307 $caption_node = $this->getMAItemNode(
308 $this->hier_id,
309 $this->purpose,
310 $this->getPcId(),
311 "/Caption"
312 );
313 if (is_object($caption_node)) {
314 return true;
315 }
316 return false;
317 }
318
322 public function deriveCaption()
323 {
324 $caption_node = $this->getMAItemNode(
325 $this->hier_id,
326 $this->purpose,
327 $this->getPcId(),
328 "/Caption"
329 );
330 if (is_object($caption_node)) {
331 $caption_node->unlink_node($caption_node);
332 }
333 }
334
338 public function setTextRepresentation($a_text_representation)
339 {
341 $this->dom,
342 $this->item_node,
343 "TextRepresentation",
344 array("Parameter", "MapArea"),
345 $a_text_representation,
346 array()
347 );
348 }
349
353 public function getTextRepresentation()
354 {
355 $text_representation_node = $this->getMAItemNode(
356 $this->hier_id,
357 $this->purpose,
358 $this->getPcId(),
359 "/TextRepresentation"
360 );
361 if (is_object($text_representation_node)) {
362 return $text_representation_node->get_content();
363 }
364 }
365
372 {
373 $text_representation_node = $this->getMAItemNode(
374 $this->hier_id,
375 $this->purpose,
376 $this->getPcId(),
377 "/TextRepresentation"
378 );
379 if (is_object($text_representation_node)) {
380 return true;
381 }
382 return false;
383 }
384
388 public function deriveTextRepresentation()
389 {
390 $text_representation_node = $this->getMAItemNode(
391 $this->hier_id,
392 $this->purpose,
393 $this->getPcId(),
394 "/TextRepresentation"
395 );
396 if (is_object($text_representation_node)) {
397 $text_representation_node->unlink_node($text_representation_node);
398 }
399 }
400
401 public function setHorizontalAlign($a_halign)
402 {
404 $this->dom,
405 $this->item_node,
406 "Layout",
407 array("Caption", "TextRepresentation", "Parameter", "MapArea"),
408 "",
409 array("HorizontalAlign" => $a_halign),
410 false
411 );
412 }
413
414
415 public function getHorizontalAlign()
416 {
417 $layout_node = $this->getMAItemNode(
418 $this->hier_id,
419 $this->purpose,
420 $this->getPcId(),
421 "/Layout"
422 );
423 if (is_object($layout_node)) {
424 return $layout_node->get_attribute("HorizontalAlign");
425 }
426 }
427
431 public function setParameters($a_par_array)
432 {
433 $par_nodes = $this->getParameterNodes(
434 $this->hier_id,
435 $this->purpose,
436 $this->getPcId()
437 );
438 for ($i = 0; $i < count($par_nodes); $i++) {
439 $par_node = $par_nodes[$i];
440 $par_node->unlink_node($par_node);
441 }
442
443 include_once("./Services/MediaObjects/classes/class.ilMediaItem.php");
444 if (is_array($a_par_array)) {
445 foreach ($a_par_array as $par => $val) {
446 if (ilMediaItem::checkParameter($par, $val)) {
447 $attributes = array("Name" => $par, "Value" => $val);
449 $this->dom,
450 $this->item_node,
451 "Parameter",
452 array("MapArea"),
453 "",
455 );
456 }
457 }
458 }
459 }
460
464 public function getParameterString()
465 {
466 $par_nodes = $this->getParameterNodes(
467 $this->hier_id,
468 $this->purpose,
469 $this->getPcId()
470 );
471 $par_arr = array();
472 for ($i = 0; $i < count($par_nodes); $i++) {
473 $par_node = $par_nodes[$i];
474 $par_arr[] = $par_node->get_attribute("Name") . "=\"" . $par_node->get_attribute("Value") . "\"";
475 }
476 return implode($par_arr, ", ");
477 }
478
482 public function getParameters()
483 {
484 $par_nodes = $this->getParameterNodes(
485 $this->hier_id,
486 $this->purpose,
487 $this->getPcId()
488 );
489 $par_arr = array();
490 for ($i = 0; $i < count($par_nodes); $i++) {
491 $par_node = $par_nodes[$i];
492 $par_arr[$par_node->get_attribute("Name")] =
493 $par_node->get_attribute("Value");
494 }
495 return $par_arr;
496 }
497
501 public function getParameter($a_name)
502 {
503 }
504
510 public function definesParameters()
511 {
512 $par_nodes = $this->getParameterNodes(
513 $this->hier_id,
514 $this->purpose,
515 $this->getPcId()
516 );
517 if (count($par_nodes) > 0) {
518 return true;
519 }
520 return false;
521 }
522
526 public function deriveParameters()
527 {
528 $par_nodes = $this->getParameterNodes(
529 $this->hier_id,
530 $this->purpose,
531 $this->getPcId()
532 );
533 if (count($par_nodes) > 0) {
534 for ($i = 0; $i < count($par_nodes); $i++) {
535 $par_node = $par_nodes[$i];
536 $par_node->unlink_node($par_node);
537 }
538 }
539 }
540
541
545 public function getMapAreas()
546 {
547 $ma_nodes = $this->getMapAreaNodes(
548 $this->hier_id,
549 $this->purpose,
550 $this->getPcId()
551 );
552 $maparea_arr = array();
553 for ($i = 0; $i < count($ma_nodes); $i++) {
554 $maparea_node = $ma_nodes[$i];
555 $childs = $maparea_node->child_nodes();
556 $link = array();
557 if ($childs[0]->node_name() == "ExtLink") {
558 $link = array("LinkType" => "ExtLink",
559 "Href" => $childs[0]->get_attribute("Href"),
560 "Title" => $childs[0]->get_content());
561 }
562 if ($childs[0]->node_name() == "IntLink") {
563 $link = array("LinkType" => "IntLink",
564 "Target" => $childs[0]->get_attribute("Target"),
565 "Type" => $childs[0]->get_attribute("Type"),
566 "TargetFrame" => $childs[0]->get_attribute("TargetFame"),
567 "Title" => $childs[0]->get_content());
568 }
569 $maparea_arr[] = array(
570 "Nr" => $i + 1,
571 "Shape" => $maparea_node->get_attribute("Shape"),
572 "Coords" => $maparea_node->get_attribute("Coords"),
573 "HighlightMode" => $maparea_node->get_attribute("HighlightMode"),
574 "HighlightClass" => $maparea_node->get_attribute("HighlightClass"),
575 "Id" => $maparea_node->get_attribute("Id"),
576 "Link" => $link);
577 }
578
579 return $maparea_arr;
580 }
581
585 public function setAreaTitle($a_nr, $a_title)
586 {
587 $ma_nodes = $this->getMapAreaNodes(
588 $this->hier_id,
589 $this->purpose,
590 $this->getPcId()
591 );
592 if (is_object($ma_nodes[$a_nr - 1])) {
593 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
594 if (is_object($childs[0]) &&
595 ($childs[0]->node_name() == "IntLink" || $childs[0]->node_name() == "ExtLink")) {
596 $childs[0]->set_content($a_title);
597 }
598 }
599 }
600
604 public function setAreaIntLink($a_nr, $a_type, $a_target, $a_target_frame)
605 {
606 $ma_nodes = $this->getMapAreaNodes(
607 $this->hier_id,
608 $this->purpose,
609 $this->getPcId()
610 );
611 if (is_object($ma_nodes[$a_nr - 1])) {
612 $title = $this->getTitleOfArea($a_nr);
613 ilDOMUtil::deleteAllChildsByName($ma_nodes[$a_nr - 1], array("IntLink", "ExtLink"));
614 $attributes = array("Type" => $a_type, "Target" => $a_target,
615 "TargetFrame" => $a_target_frame);
617 $this->dom,
618 $ma_nodes[$a_nr - 1],
619 "IntLink",
620 array(""),
621 $title,
623 );
624 }
625 }
626
630 public function setAreaExtLink($a_nr, $a_href)
631 {
632 $ma_nodes = $this->getMapAreaNodes(
633 $this->hier_id,
634 $this->purpose,
635 $this->getPcId()
636 );
637 if (is_object($ma_nodes[$a_nr - 1])) {
638 $title = $this->getTitleOfArea($a_nr);
639 ilDOMUtil::deleteAllChildsByName($ma_nodes[$a_nr - 1], array("IntLink", "ExtLink"));
640 $attributes = array("Href" => $a_href);
642 $this->dom,
643 $ma_nodes[$a_nr - 1],
644 "ExtLink",
645 array(""),
646 $title,
648 );
649 }
650 }
651
655 public function setShape($a_nr, $a_shape_type, $a_coords)
656 {
657 $ma_nodes = $this->getMapAreaNodes(
658 $this->hier_id,
659 $this->purpose,
660 $this->getPcId()
661 );
662 if (is_object($ma_nodes[$a_nr - 1])) {
663 $ma_nodes[$a_nr - 1]->set_attribute("Shape", $a_shape_type);
664 $ma_nodes[$a_nr - 1]->set_attribute("Coords", $a_coords);
665 }
666 }
667
671 public function setAreaHighlightMode($a_nr, $a_mode)
672 {
673 $ma_nodes = $this->getMapAreaNodes(
674 $this->hier_id,
675 $this->purpose,
676 $this->getPcId()
677 );
678 if (is_object($ma_nodes[$a_nr - 1])) {
679 $ma_nodes[$a_nr - 1]->set_attribute("HighlightMode", $a_mode);
680 }
681 }
682
686 public function setAreaHighlightClass($a_nr, $a_class)
687 {
688 $ma_nodes = $this->getMapAreaNodes(
689 $this->hier_id,
690 $this->purpose,
691 $this->getPcId()
692 );
693 if (is_object($ma_nodes[$a_nr - 1])) {
694 $ma_nodes[$a_nr - 1]->set_attribute("HighlightClass", $a_class);
695 }
696 }
697
701 public function addMapArea(
702 $a_shape_type,
703 $a_coords,
704 $a_title,
705 $a_link,
706 $a_id = ""
707 ) {
708 $attributes = array("Shape" => $a_shape_type,
709 "Coords" => $a_coords, "Id" => $a_id);
710
712 $this->dom,
713 $this->item_node,
714 "MapArea",
715 array(),
716 "",
718 );
719
720 if ($a_link["LinkType"] == "int" || $a_link["LinkType"] == "IntLink") {
721 $attributes = array("Type" => $a_link["Type"],
722 "TargetFrame" => $a_link["TargetFrame"],
723 "Target" => $a_link["Target"]);
725 $this->dom,
726 $ma_node,
727 "IntLink",
728 array(""),
729 $a_title,
731 );
732 }
733 if ($a_link["LinkType"] == "ext" || $a_link["LinkType"] == "ExtLink") {
734 $attributes = array("Href" => $a_link["Href"]);
736 $this->dom,
737 $ma_node,
738 "ExtLink",
739 array(""),
740 $a_title,
742 );
743 }
744 }
745
749 public function deleteMapArea($a_nr)
750 {
751 $ma_nodes = $this->getMapAreaNodes(
752 $this->hier_id,
753 $this->purpose,
754 $this->getPcId()
755 );
756
757 if (is_object($ma_nodes[$a_nr - 1])) {
758 $ma_nodes[$a_nr - 1]->unlink_node($ma_nodes[$a_nr - 1]);
759 }
760 }
761
765 public function deleteMapAreaById($a_id)
766 {
767 $ma_nodes = $this->getMapAreaNodes(
768 $this->hier_id,
769 $this->purpose,
770 $this->getPcId()
771 );
772 foreach ($ma_nodes as $node) {
773 if ($node->get_attribute("Id") == $a_id) {
774 $node->unlink_node($node);
775 }
776 }
777 }
778
782 public function deleteAllMapAreas()
783 {
784 $xpc = xpath_new_context($this->dom);
785 $path = "//PageContent[@HierId = '" . $this->hier_id . "']/" . $this->parent_node_name . "/MediaAliasItem[@Purpose='" . $this->purpose . "']/MapArea";
786 $res = xpath_eval($xpc, $path);
787 for ($i = 0; $i < count($res->nodeset); $i++) {
788 $res->nodeset[$i]->unlink_node($res->nodeset[$i]);
789 }
790 }
791
795 public function getLinkTypeOfArea($a_nr)
796 {
797 $ma_nodes = $this->getMapAreaNodes(
798 $this->hier_id,
799 $this->purpose,
800 $this->getPcId()
801 );
802 if (is_object($ma_nodes[$a_nr - 1])) {
803 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
804 if ($childs[0]->node_name() == "IntLink") {
805 return "int";
806 }
807 if ($childs[0]->node_name() == "ExtLink") {
808 return "ext";
809 }
810 }
811 }
812
816 public function getTypeOfArea($a_nr)
817 {
818 $ma_nodes = $this->getMapAreaNodes(
819 $this->hier_id,
820 $this->purpose,
821 $this->getPcId()
822 );
823 if (is_object($ma_nodes[$a_nr - 1])) {
824 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
825 return $childs[0]->get_attribute("Type");
826 }
827 }
828
832 public function getTargetOfArea($a_nr)
833 {
834 $ma_nodes = $this->getMapAreaNodes(
835 $this->hier_id,
836 $this->purpose,
837 $this->getPcId()
838 );
839 if (is_object($ma_nodes[$a_nr - 1])) {
840 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
841 return $childs[0]->get_attribute("Target");
842 }
843 }
844
848 public function getTargetFrameOfArea($a_nr)
849 {
850 $ma_nodes = $this->getMapAreaNodes(
851 $this->hier_id,
852 $this->purpose,
853 $this->getPcId()
854 );
855 if (is_object($ma_nodes[$a_nr - 1])) {
856 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
857 return $childs[0]->get_attribute("TargetFrame");
858 }
859 }
860
864 public function getHrefOfArea($a_nr)
865 {
866 $ma_nodes = $this->getMapAreaNodes(
867 $this->hier_id,
868 $this->purpose,
869 $this->getPcId()
870 );
871 if (is_object($ma_nodes[$a_nr - 1])) {
872 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
873 return $childs[0]->get_attribute("Href");
874 }
875 }
876
880 public function getTitleOfArea($a_nr)
881 {
882 $ma_nodes = $this->getMapAreaNodes(
883 $this->hier_id,
884 $this->purpose,
885 $this->getPcId()
886 );
887 if (is_object($ma_nodes[$a_nr - 1])) {
888 $childs = $ma_nodes[$a_nr - 1]->child_nodes();
889 return $childs[0]->get_content();
890 }
891 }
892
896 public function delete()
897 {
898 if (is_object($this->item_node)) {
899 $this->item_node->unlink_node($this->item_node);
900 }
901 }
902
909 public function makeMapWorkCopy(
910 $a_st_item,
911 $a_area_nr = 0,
912 $a_exclude = false,
913 $a_output_new_area,
914 $a_area_type,
915 $a_coords
916 ) {
918
919 if (!$a_st_item->copyOriginal()) {
920 return false;
921 }
922 $a_st_item->buildMapWorkImage();
923
924 // determine ratios (first see whether the instance has w/h defined)
925 $width = $this->getWidth();
926 $height = $this->getHeight();
927
928 // if instance has no size, use object w/h
929 if ($width == 0 && $height == 0) {
930 $width = $a_st_item->getWidth();
931 $height = $a_st_item->getHeight();
932 }
933 $size = @getimagesize($a_st_item->getMapWorkCopyName());
934 $x_ratio = 1;
935 if ($size[0] > 0 && $width > 0) {
936 $x_ratio = $width / $size[0];
937 }
938 $y_ratio = 1;
939 if ($size[1] > 0 && $height > 0) {
940 $y_ratio = $height / $size[1];
941 }
942
943 // draw map areas
944 $areas = $this->getMapAreas();
945 for ($i = 0; $i < count($areas); $i++) {
946 if (((($i + 1) == $a_area_nr) && !$a_exclude) ||
947 ((($i + 1) != $a_area_nr) && $a_exclude) ||
948 ($a_area_nr == 0)
949 ) {
950 $area = new ilMapArea();
951 $area->setShape($areas[$i]["Shape"]);
952 $area->setCoords($areas[$i]["Coords"]);
953 $area->draw(
954 $a_st_item->getMapWorkImage(),
955 $a_st_item->color1,
956 $a_st_item->color2,
957 true,
958 $x_ratio,
959 $y_ratio
960 );
961 }
962 }
963
964 if ($a_output_new_area) {
965 $area = new ilMapArea();
966 $area->setShape($a_area_type);
967 $area->setCoords($a_coords);
968 $area->draw(
969 $a_st_item->getMapWorkImage(),
970 $a_st_item->color1,
971 $a_st_item->color2,
972 false,
973 $x_ratio,
974 $y_ratio
975 );
976 }
977
978 $a_st_item->saveMapWorkImage();
979
980 return true;
981 }
982}
$size
Definition: RandomTest.php:84
$path
Definition: aliased.php:25
An exception for terminatinating execution or to throw for unit testing.
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 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 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="")
addMapArea( $a_shape_type, $a_coords, $a_title, $a_link, $a_id="")
Add a new area to the map.
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.
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)
$i
Definition: disco.tpl.php:19
if(array_key_exists('yes', $_REQUEST)) $attributes
Definition: getconsent.php:85
xpath_eval($xpath_context, $eval_str, $contextnode=null)
xpath_new_context($dom_document)
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$a_type
Definition: workflow.php:92