ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilADTLocationPresentationBridge Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilADTLocationPresentationBridge:
+ Collaboration diagram for ilADTLocationPresentationBridge:

Public Member Functions

 setSize (string $a_width, string $a_height)
 Set size in strings of int + unit, e.g. More...
 
 getHTML ()
 
 getList ()
 
 getSortable ()
 
- Public Member Functions inherited from ilADTPresentationBridge
 __construct (ilADT $a_adt)
 
 getADT ()
 
 getList ()
 
 getHTML ()
 
 getSortable ()
 Get sortable value presentation. More...
 
 setDecoratorCallBack (?array $a_callback)
 Takes as input an array consisting of the object that the method that should be called back to belongs to, and a string with the name of the method. More...
 

Protected Member Functions

 isValidADT (ilADT $a_adt)
 
- Protected Member Functions inherited from ilADTPresentationBridge
 isValidADT (ilADT $a_adt)
 
 setADT (ilADT $a_adt)
 
 decorate ($a_value)
 Decorate value. More...
 

Protected Attributes

string $width = '100%'
 
string $height = '200px'
 
- Protected Attributes inherited from ilADTPresentationBridge
ilADT $adt
 
 $decorator
 
ilLanguage $lng
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

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

Member Function Documentation

◆ getHTML()

ilADTLocationPresentationBridge::getHTML ( )

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

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

40  : string
41  {
42  if (!$this->getADT()->isNull()) {
43  $map_gui = ilMapUtil::getMapGUI();
44  $map_gui->setMapId("map_" . uniqid()) // :TODO: sufficient entropy?
45  ->setLatitude((string) $this->getADT()->getLatitude())
46  ->setLongitude((string) $this->getADT()->getLongitude())
47  ->setZoom($this->getADT()->getZoom())
48  ->setEnableTypeControl(true)
49  ->setEnableLargeMapControl(true)
50  ->setEnableUpdateListener(false)
51  ->setEnableCentralMarker(true);
52 
53  if ($this->width) {
54  $map_gui->setWidth($this->width);
55  }
56  if ($this->height) {
57  $map_gui->setHeight($this->height);
58  }
59 
60  return $this->decorate($map_gui->getHtml());
61  }
62  return '';
63  }
decorate($a_value)
Decorate value.
static getMapGUI()
Get an instance of the GUI class.
+ Here is the call graph for this function:

◆ getList()

ilADTLocationPresentationBridge::getList ( )

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

References ilADTPresentationBridge\getADT().

65  : string
66  {
67  if (!$this->getADT()->isNull()) {
68  // :TODO: probably does not make much sense
69  return $this->getADT()->getLatitude() . "°/" . $this->getADT()->getLongitude() . "°";
70  }
71  return '';
72  }
+ Here is the call graph for this function:

◆ getSortable()

ilADTLocationPresentationBridge::getSortable ( )

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

References ilADTPresentationBridge\getADT().

75  {
76  if (!$this->getADT()->isNull()) {
77  // :TODO: probably does not make much sense
78  return $this->getADT()->getLatitude() . ";" . $this->getADT()->getLongitude();
79  }
80  return '';
81  }
+ Here is the call graph for this function:

◆ isValidADT()

ilADTLocationPresentationBridge::isValidADT ( ilADT  $a_adt)
protected

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

26  : bool
27  {
28  return ($a_adt instanceof ilADTLocation);
29  }

◆ setSize()

ilADTLocationPresentationBridge::setSize ( string  $a_width,
string  $a_height 
)

Set size in strings of int + unit, e.g.

10em, 250px, 50%

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

34  : void
35  {
36  $this->width = $a_width;
37  $this->height = $a_height;
38  }

Field Documentation

◆ $height

string ilADTLocationPresentationBridge::$height = '200px'
protected

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

◆ $width

string ilADTLocationPresentationBridge::$width = '100%'
protected

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


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