ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 include_once("./Services/Maps/classes/class.ilMapUtil.php");
25 $map_gui = ilMapUtil::getMapGUI();
26 $map_gui->setMapId("map_" . uniqid()) // :TODO: sufficient entropy?
27 ->setLatitude($this->getADT()->getLatitude())
28 ->setLongitude($this->getADT()->getLongitude())
29 ->setZoom($this->getADT()->getZoom())
30 ->setEnableTypeControl(true)
31 ->setEnableLargeMapControl(true)
32 ->setEnableUpdateListener(false)
33 ->setEnableCentralMarker(true);
34
35 if ($this->width) {
36 $map_gui->setWidth($this->width);
37 }
38 if ($this->height) {
39 $map_gui->setHeight($this->height);
40 }
41
42 return $this->decorate($map_gui->getHtml());
43 }
44 }
45
46 public function getList()
47 {
48 if (!$this->getADT()->isNull()) {
49 // :TODO: probably does not make much sense
50 return $this->getADT()->getLatitude() . "&deg;/" . $this->getADT()->getLongitude() . "&deg;";
51 }
52 }
53
54 public function getSortable()
55 {
56 if (!$this->getADT()->isNull()) {
57 // :TODO: probably does not make much sense
58 return $this->getADT()->getLatitude() . ";" . $this->getADT()->getLongitude();
59 }
60 }
61}
An exception for terminatinating execution or to throw for unit testing.
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.