ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilADTLocationPresentationBridge Class Reference
+ Inheritance diagram for ilADTLocationPresentationBridge:
+ Collaboration diagram for ilADTLocationPresentationBridge:

Public Member Functions

 setSize ($a_width, $a_height)
 
 getHTML ()
 Get HTML presentation. More...
 
 getList ()
 Get list presentation. More...
 
 getSortable ()
 Get sortable value presentation. More...
 
- Public Member Functions inherited from ilADTPresentationBridge
 __construct (ilADT $a_adt)
 Constructor. More...
 
 getADT ()
 Get ADT. More...
 
 getList ()
 Get list presentation. More...
 
 getHTML ()
 Get HTML presentation. More...
 
 getSortable ()
 Get sortable value presentation. More...
 
 setDecoratorCallBack ($a_callback)
 Set decorator callback. More...
 

Protected Member Functions

 isValidADT (ilADT $a_adt)
 Check if given ADT is valid. More...
 
- Protected Member Functions inherited from ilADTPresentationBridge
 isValidADT (ilADT $a_adt)
 Check if given ADT is valid. More...
 
 setADT (ilADT $a_adt)
 Set ADT. More...
 
 decorate ($a_value)
 Decorate value. More...
 

Protected Attributes

 $width
 
 $height
 
- Protected Attributes inherited from ilADTPresentationBridge
 $adt
 
 $decorator
 

Detailed Description

Definition at line 5 of file class.ilADTLocationPresentationBridge.php.

Member Function Documentation

◆ getHTML()

ilADTLocationPresentationBridge::getHTML ( )

Get HTML presentation.

Returns
string

Reimplemented from ilADTPresentationBridge.

Definition at line 21 of file class.ilADTLocationPresentationBridge.php.

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 }
static getMapGUI()
Get an instance of the GUI class.

References ilADTPresentationBridge\decorate(), ilADTPresentationBridge\getADT(), and ilMapUtil\getMapGUI().

+ Here is the call graph for this function:

◆ getList()

ilADTLocationPresentationBridge::getList ( )

Get list presentation.

Returns
string

Reimplemented from ilADTPresentationBridge.

Definition at line 49 of file class.ilADTLocationPresentationBridge.php.

50 {
51 if(!$this->getADT()->isNull())
52 {
53 // :TODO: probably does not make much sense
54 return $this->getADT()->getLatitude()."°/".$this->getADT()->getLongitude()."°";
55 }
56 }

References ilADTPresentationBridge\getADT().

+ Here is the call graph for this function:

◆ getSortable()

ilADTLocationPresentationBridge::getSortable ( )

Get sortable value presentation.

Returns
mixed

Reimplemented from ilADTPresentationBridge.

Definition at line 58 of file class.ilADTLocationPresentationBridge.php.

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 }

References ilADTPresentationBridge\getADT().

+ Here is the call graph for this function:

◆ isValidADT()

ilADTLocationPresentationBridge::isValidADT ( ilADT  $a_adt)
protected

Check if given ADT is valid.

:TODO: This could be avoided with type-specifc constructors :TODO: bridge base class?

Parameters
ilADT$a_adt

Reimplemented from ilADTPresentationBridge.

Definition at line 10 of file class.ilADTLocationPresentationBridge.php.

11 {
12 return ($a_adt instanceof ilADTLocation);
13 }

◆ setSize()

ilADTLocationPresentationBridge::setSize (   $a_width,
  $a_height 
)

Definition at line 15 of file class.ilADTLocationPresentationBridge.php.

16 {
17 $this->width = $a_width;
18 $this->height = $a_height;
19 }

Field Documentation

◆ $height

ilADTLocationPresentationBridge::$height
protected

Definition at line 8 of file class.ilADTLocationPresentationBridge.php.

◆ $width

ilADTLocationPresentationBridge::$width
protected

Definition at line 7 of file class.ilADTLocationPresentationBridge.php.


The documentation for this class was generated from the following file: