ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilADTLocationPresentationBridge.php
Go to the documentation of this file.
1 <?php
2 
3 require_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 }
decorate($a_value)
Decorate value.
ADT base class.
Definition: class.ilADT.php:11
static getMapGUI()
Get an instance of the GUI class.
ADT presentation bridge base class.