ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilADTLocationPresentationBridge.php
Go to the documentation of this file.
1<?php
2
3require_once "Services/ADT/classes/Bridges/class.ilADTPresentationBridge.php";
4
6{
7 protected $width; // [mixed]
8 protected $height; // [mixed]
9
10 protected function isValidADT(ilADT $a_adt)
11 {
12 return ($a_adt instanceof ilADTLocation);
13 }
14
15 public function setSize($a_width, $a_height)
16 {
17 $this->width = $a_width;
18 $this->height = $a_height;
19 }
20
21 public function getHTML()
22 {
23 if(!$this->getADT()->isNull())
24 {
25 include_once("./Services/Maps/classes/class.ilMapUtil.php");
26 $map_gui = ilMapUtil::getMapGUI();
27 $map_gui->setMapId("map_".uniqid()) // :TODO: sufficient entropy?
28 ->setLatitude($this->getADT()->getLatitude())
29 ->setLongitude($this->getADT()->getLongitude())
30 ->setZoom($this->getADT()->getZoom())
31 ->setEnableTypeControl(true)
32 ->setEnableLargeMapControl(true)
33 ->setEnableUpdateListener(false)
34 ->setEnableCentralMarker(true);
35
36 if($this->width)
37 {
38 $map_gui->setWidth($this->width);
39 }
40 if($this->height)
41 {
42 $map_gui->setHeight($this->height);
43 }
44
45 return $this->decorate($map_gui->getHtml());
46 }
47 }
48
49 public function getList()
50 {
51 if(!$this->getADT()->isNull())
52 {
53 // :TODO: probably does not make much sense
54 return $this->getADT()->getLatitude()."&deg;/".$this->getADT()->getLongitude()."&deg;";
55 }
56 }
57
58 public function getSortable()
59 {
60 if(!$this->getADT()->isNull())
61 {
62 // :TODO: probably does not make much sense
63 return $this->getADT()->getLatitude().";".$this->getADT()->getLongitude();
64 }
65 }
66}
67
68?>
isValidADT(ilADT $a_adt)
Check if given ADT is valid.
ADT presentation bridge base class.
ADT base class.
Definition: class.ilADT.php:12
static getMapGUI()
Get an instance of the GUI class.