ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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 
4 include_once("./Services/Utilities/classes/class.ilDOMUtil.php");
5 
17 {
18  var $dom;
19  var $hier_id;
20  var $purpose;
22 
23  function ilMediaAliasItem(&$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  $par_arr = array();
374  for($i=0; $i < count($par_nodes); $i++)
375  {
376  $par_node =& $par_nodes[$i];
377  $par_node->unlink_node($par_node);
378  }
379 
380  if (is_array($a_par_array))
381  {
382  foreach($a_par_array as $par => $val)
383  {
384  $attributes = array ("Name" => $par, "Value" => $val);
385  ilDOMUtil::addElementToList($this->dom, $this->item_node,
386  "Parameter", array("MapArea"), "", $attributes);
387  /* $par_node =& $this->dom->create_element("Parameter");
388  $par_node =& $this->item_node->append_child($par_node);
389  $par_node->set_attribute("Name", $par);
390  $par_node->set_attribute("Value", $val); */
391  }
392  }
393  }
394 
399  {
400  $par_nodes = $this->getParameterNodes($this->hier_id, $this->purpose,
401  $this->getPcId());
402  $par_arr = array();
403  for($i=0; $i < count($par_nodes); $i++)
404  {
405  $par_node =& $par_nodes[$i];
406  $par_arr[] = $par_node->get_attribute("Name")."=\"".$par_node->get_attribute("Value")."\"";
407  }
408  return implode($par_arr, ", ");
409  }
410 
414  function getParameters()
415  {
416  $par_nodes = $this->getParameterNodes($this->hier_id, $this->purpose,
417  $this->getPcId());
418  $par_arr = array();
419  for($i=0; $i < count($par_nodes); $i++)
420  {
421  $par_node =& $par_nodes[$i];
422  $par_arr[$par_node->get_attribute("Name")] =
423  $par_node->get_attribute("Value");
424  }
425  return $par_arr;
426  }
427 
431  function getParameter($a_name)
432  {
433  }
434 
440  function definesParameters()
441  {
442  $par_nodes = $this->getParameterNodes($this->hier_id, $this->purpose,
443  $this->getPcId());
444  if (count($par_nodes) > 0)
445  {
446  return true;
447  }
448  return false;
449  }
450 
454  function deriveParameters()
455  {
456  $par_nodes = $this->getParameterNodes($this->hier_id, $this->purpose,
457  $this->getPcId());
458  if (count($par_nodes) > 0)
459  {
460  for($i=0; $i < count($par_nodes); $i++)
461  {
462  $par_node =& $par_nodes[$i];
463  $par_node->unlink_node($par_node);
464  }
465  }
466  }
467 
468 
472  function getMapAreas()
473  {
474  $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
475  $this->getPcId());
476  $maparea_arr = array();
477  for($i=0; $i < count($ma_nodes); $i++)
478  {
479  $maparea_node = $ma_nodes[$i];
480  $childs = $maparea_node->child_nodes();
481  $link = array();
482  if ($childs[0]->node_name() == "ExtLink")
483  {
484  $link = array("LinkType" => "ExtLink",
485  "Href" => $childs[0]->get_attribute("Href"),
486  "Title" => $childs[0]->get_content());
487  }
488  if ($childs[0]->node_name() == "IntLink")
489  {
490  $link = array("LinkType" => "IntLink",
491  "Target" => $childs[0]->get_attribute("Target"),
492  "Type" => $childs[0]->get_attribute("Type"),
493  "TargetFrame" => $childs[0]->get_attribute("TargetFame"),
494  "Title" => $childs[0]->get_content());
495  }
496  $maparea_arr[] = array(
497  "Nr" => $i + 1,
498  "Shape" => $maparea_node->get_attribute("Shape"),
499  "Coords" => $maparea_node->get_attribute("Coords"),
500  "HighlightMode" => $maparea_node->get_attribute("HighlightMode"),
501  "HighlightClass" => $maparea_node->get_attribute("HighlightClass"),
502  "Id" => $maparea_node->get_attribute("Id"),
503  "Link" => $link);
504  }
505 
506  return $maparea_arr;
507  }
508 
512  function setAreaTitle($a_nr, $a_title)
513  {
514  $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
515  $this->getPcId());
516  if (is_object($ma_nodes[$a_nr - 1]))
517  {
518  $childs = $ma_nodes[$a_nr - 1]->child_nodes();
519  if (is_object($childs[0]) &&
520  ($childs[0]->node_name() == "IntLink" || $childs[0]->node_name() == "ExtLink"))
521  {
522  $childs[0]->set_content($a_title);
523  }
524  }
525  }
526 
530  function setAreaIntLink($a_nr, $a_type, $a_target, $a_target_frame)
531  {
532  $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
533  $this->getPcId());
534  if (is_object($ma_nodes[$a_nr - 1]))
535  {
536  $title = $this->getTitleOfArea($a_nr);
537  ilDOMUtil::deleteAllChildsByName($ma_nodes[$a_nr - 1], array("IntLink", "ExtLink"));
538  $attributes = array("Type" => $a_type, "Target" => $a_target,
539  "TargetFrame" => $a_target_frame);
540  ilDOMUtil::setFirstOptionalElement($this->dom, $ma_nodes[$a_nr - 1], "IntLink",
541  array(""), $title, $attributes);
542  }
543  }
544 
548  function setAreaExtLink($a_nr, $a_href)
549  {
550  $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
551  $this->getPcId());
552  if (is_object($ma_nodes[$a_nr - 1]))
553  {
554  $title = $this->getTitleOfArea($a_nr);
555  ilDOMUtil::deleteAllChildsByName($ma_nodes[$a_nr - 1], array("IntLink", "ExtLink"));
556  $attributes = array("Href" => $a_href);
557  ilDOMUtil::setFirstOptionalElement($this->dom, $ma_nodes[$a_nr - 1], "ExtLink",
558  array(""), $title, $attributes);
559  }
560  }
561 
565  function setShape($a_nr, $a_shape_type, $a_coords)
566  {
567  $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
568  $this->getPcId());
569  if (is_object($ma_nodes[$a_nr - 1]))
570  {
571  $ma_nodes[$a_nr - 1]->set_attribute("Shape", $a_shape_type);
572  $ma_nodes[$a_nr - 1]->set_attribute("Coords", $a_coords);
573  }
574  }
575 
579  function setAreaHighlightMode($a_nr, $a_mode)
580  {
581  $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
582  $this->getPcId());
583  if (is_object($ma_nodes[$a_nr - 1]))
584  {
585  $ma_nodes[$a_nr - 1]->set_attribute("HighlightMode", $a_mode);
586  }
587  }
588 
592  function setAreaHighlightClass($a_nr, $a_class)
593  {
594  $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
595  $this->getPcId());
596  if (is_object($ma_nodes[$a_nr - 1]))
597  {
598  $ma_nodes[$a_nr - 1]->set_attribute("HighlightClass", $a_class);
599  }
600  }
601 
605  function addMapArea($a_shape_type, $a_coords, $a_title,
606  $a_link, $a_id = "")
607  {
608  $attributes = array("Shape" => $a_shape_type,
609  "Coords" => $a_coords, "Id" => $a_id);
610 
611  $ma_node = ilDOMUtil::addElementToList($this->dom, $this->item_node,
612  "MapArea", array(), "", $attributes);
613 
614  if ($a_link["LinkType"] == "int" || $a_link["LinkType"] == "IntLink")
615  {
616  $attributes = array("Type" => $a_link["Type"],
617  "TargetFrame" => $a_link["TargetFrame"],
618  "Target" => $a_link["Target"]);
619  ilDOMUtil::setFirstOptionalElement($this->dom, $ma_node, "IntLink",
620  array(""), $a_title, $attributes);
621  }
622  if ($a_link["LinkType"] == "ext" || $a_link["LinkType"] == "ExtLink")
623  {
624  $attributes = array("Href" => $a_link["Href"]);
625  ilDOMUtil::setFirstOptionalElement($this->dom, $ma_node, "ExtLink",
626  array(""), $a_title, $attributes);
627  }
628  }
629 
633  function deleteMapArea($a_nr)
634  {
635  $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
636  $this->getPcId());
637 
638  if (is_object($ma_nodes[$a_nr - 1]))
639  {
640  $ma_nodes[$a_nr - 1]->unlink_node($ma_nodes[$a_nr - 1]);
641  }
642  }
643 
647  function deleteMapAreaById($a_id)
648  {
649  $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
650  $this->getPcId());
651  foreach ($ma_nodes as $node)
652  {
653  if ($node->get_attribute("Id") == $a_id)
654  {
655  $node->unlink_node($node);
656  }
657  }
658  }
659 
663  function deleteAllMapAreas()
664  {
665  $xpc = xpath_new_context($this->dom);
666  $path = "//PageContent[@HierId = '".$this->hier_id."']/".$this->parent_node_name."/MediaAliasItem[@Purpose='".$this->purpose."']/MapArea";
667  $res =& xpath_eval($xpc, $path);
668  for ($i = 0; $i < count($res->nodeset); $i++)
669  {
670  $res->nodeset[$i]->unlink_node($res->nodeset[$i]);
671  }
672  }
673 
677  function getLinkTypeOfArea($a_nr)
678  {
679  $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
680  $this->getPcId());
681  if (is_object($ma_nodes[$a_nr - 1]))
682  {
683  $childs = $ma_nodes[$a_nr - 1]->child_nodes();
684  if ($childs[0]->node_name() == "IntLink")
685  {
686  return "int";
687  }
688  if ($childs[0]->node_name() == "ExtLink")
689  {
690  return "ext";
691  }
692  }
693  }
694 
698  function getTypeOfArea($a_nr)
699  {
700  $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
701  $this->getPcId());
702  if (is_object($ma_nodes[$a_nr - 1]))
703  {
704  $childs = $ma_nodes[$a_nr - 1]->child_nodes();
705  return $childs[0]->get_attribute("Type");
706  }
707  }
708 
712  function getTargetOfArea($a_nr)
713  {
714  $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
715  $this->getPcId());
716  if (is_object($ma_nodes[$a_nr - 1]))
717  {
718  $childs = $ma_nodes[$a_nr - 1]->child_nodes();
719  return $childs[0]->get_attribute("Target");
720  }
721  }
722 
726  function getTargetFrameOfArea($a_nr)
727  {
728  $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
729  $this->getPcId());
730  if (is_object($ma_nodes[$a_nr - 1]))
731  {
732  $childs = $ma_nodes[$a_nr - 1]->child_nodes();
733  return $childs[0]->get_attribute("TargetFrame");
734  }
735  }
736 
740  function getHrefOfArea($a_nr)
741  {
742  $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
743  $this->getPcId());
744  if (is_object($ma_nodes[$a_nr - 1]))
745  {
746  $childs = $ma_nodes[$a_nr - 1]->child_nodes();
747  return $childs[0]->get_attribute("Href");
748  }
749  }
750 
754  function getTitleOfArea($a_nr)
755  {
756  $ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
757  $this->getPcId());
758  if (is_object($ma_nodes[$a_nr - 1]))
759  {
760  $childs = $ma_nodes[$a_nr - 1]->child_nodes();
761  return $childs[0]->get_content();
762  }
763  }
764 
768  function delete()
769  {
770  if (is_object($this->item_node))
771  {
772  $this->item_node->unlink_node($this->item_node);
773  }
774  }
775 
782  function makeMapWorkCopy($a_st_item, $a_area_nr = 0, $a_exclude = false,
783  $a_output_new_area, $a_area_type, $a_coords)
784  {
785  global $lng;
786 
787  if (!$a_st_item->copyOriginal())
788  {
789  return false;
790  }
791  $a_st_item->buildMapWorkImage();
792 
793  // determine ratios (first see whether the instance has w/h defined)
794  $width = $this->getWidth();
795  $height = $this->getHeight();
796 
797  // if instance has no size, use object w/h
798  if ($width == 0 && $height == 0)
799  {
800  $width = $a_st_item->getWidth();
801  $height = $a_st_item->getHeight();
802  }
803  $size = @getimagesize($a_st_item->getMapWorkCopyName());
804  $x_ratio = 1;
805  if ($size[0] > 0 && $width > 0)
806  {
807  $x_ratio = $width / $size[0];
808  }
809  $y_ratio = 1;
810  if ($size[1] > 0 && $height > 0)
811  {
812  $y_ratio = $height / $size[1];
813  }
814 
815  // draw map areas
816  $areas = $this->getMapAreas();
817  for ($i=0; $i < count($areas); $i++)
818  {
819  if ( ((($i+1) == $a_area_nr) && !$a_exclude) ||
820  ((($i+1) != $a_area_nr) && $a_exclude) ||
821  ($a_area_nr == 0)
822  )
823  {
824  $area = new ilMapArea();
825  $area->setShape($areas[$i]["Shape"]);
826  $area->setCoords($areas[$i]["Coords"]);
827  $area->draw($a_st_item->getMapWorkImage(), $a_st_item->color1, $a_st_item->color2, true,
828  $x_ratio, $y_ratio);
829  }
830  }
831 
832  if ($a_output_new_area)
833  {
834  $area = new ilMapArea();
835  $area->setShape($a_area_type);
836  $area->setCoords($a_coords);
837  $area->draw($a_st_item->getMapWorkImage(), $a_st_item->color1, $a_st_item->color2, false,
838  $x_ratio, $y_ratio);
839  }
840 
841  $a_st_item->saveMapWorkImage();
842 
843  return true;
844  }
845 
846 }
847 ?>
setPcId($a_pcid)
Set PC Id.
$size
Definition: RandomTest.php:79
setCaption($a_caption)
Set Caption.
xpath_new_context($dom_document)
getMAItemNode($a_hier_id, $a_purpose, $a_pc_id="", $a_sub_element="")
insert()
inserts new node in dom
setAreaExtLink($a_nr, $a_href)
Set link of area to an external one.
addMapArea($a_shape_type, $a_coords, $a_title, $a_link, $a_id="")
Add a new area to the map.
getTargetOfArea($a_nr)
Get target (only interna link.
getParameter($a_name)
get a single parameter
definesTextRepresentation()
check if alias item defines own TextRepresentation or derives TextRepresentation from object ...
deleteAllMapAreas()
Delete all map areas.
xpath_eval($xpath_context, $eval_str, $contextnode=null)
deriveSize()
derive size from object (-> width and height attributes are removed from layout element) ...
Class ilMediaAliasItem.
getLinkTypeOfArea($a_nr)
Get link type.
ilMediaAliasItem(&$a_dom, $a_hier_id, $a_purpose, $a_pc_id="", $a_parent_node_name="MediaObject")
deriveCaption()
derive caption from object (-> caption element is removed from media alias item)
getTypeOfArea($a_nr)
Get type (only interna link.
deriveTextRepresentation()
derive TextRepresentation from object (-> TextRepresentation element is removed from media alias item...
definesCaption()
check if alias item defines own caption or derives caption from object
definesSize()
check if alias item defines own size or derives size from object
setShape($a_nr, $a_shape_type, $a_coords)
Set shape and coords of single area.
setHeight($a_height)
Set Height.
setAreaHighlightMode($a_nr, $a_mode)
Set highlight mode single area.
deleteMapAreaById($a_id)
Delete map areas by id.
getTextRepresentation()
Get TextRepresentation.
getParameterString()
Get all parameters as string.
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. ...
setAreaTitle($a_nr, $a_title)
Set title of area.
getParameters()
Get all parameters as array.
setAreaHighlightClass($a_nr, $a_class)
Set highlight class single area.
deleteMapArea($a_nr)
Delete a sinlge map area.
setAreaIntLink($a_nr, $a_type, $a_target, $a_target_frame)
Set link of area to an internal one.
getTargetFrameOfArea($a_nr)
Get target frame (only interna link.
deriveParameters()
derive parameters from object (-> all parameter elements are removed from media alias item) ...
Class ilMapArea.
global $lng
Definition: privfeed.php:40
$path
Definition: index.php:22
exists()
check if item node exists
deleteAllChildsByName(&$a_parent, $a_node_names)
delete all childs of a node by names in $a_node_names
getMapAreaNodes($a_hier_id, $a_purpose, $a_pc_id="")
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...
setWidth($a_width)
Set width.
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
getParameterNodes($a_hier_id, $a_purpose, $a_pc_id="")
setParameters($a_par_array)
set parameter
getTitleOfArea($a_nr)
Get title.
getMapAreas()
Get all map areas.
setTextRepresentation($a_text_representation)
Set TextRepresentation.
getHrefOfArea($a_nr)
Get href (only external link)
definesParameters()
check if alias item defines own parameters or derives parameters from object