ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilLocationInputGUI Class Reference

This class represents a location property in a property form. More...

+ Inheritance diagram for ilLocationInputGUI:
+ Collaboration diagram for ilLocationInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor.
 setLatitude ($a_latitude)
 Set Latitude.
 getLatitude ()
 Get Latitude.
 setLongitude ($a_longitude)
 Set Longitude.
 getLongitude ()
 Get Longitude.
 setZoom ($a_zoom)
 Set Zoom.
 getZoom ()
 Get Zoom.
 setValueByArray ($a_values)
 Set value by array.
 checkInput ()
 Check input, strip slashes etc.
 insert (&$a_tpl)
 Insert property html.
- Public Member Functions inherited from ilFormPropertyGUI
 getType ()
 Get Type.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setPostVar ($a_postvar)
 Set Post Variable.
 getPostVar ()
 Get Post Variable.
 getFieldId ()
 Get Post Variable.
 setInfo ($a_info)
 Set Information Text.
 getInfo ()
 Get Information Text.
 setAlert ($a_alert)
 Set Alert Text.
 getAlert ()
 Get Alert Text.
 setRequired ($a_required)
 Set Required.
 getRequired ()
 Get Required.
 setDisabled ($a_disabled)
 Set Disabled.
 getDisabled ()
 Get Disabled.
 getSubForm ()
 Get sub form html.
 getSubformMode ()

Protected Attributes

 $latitude
 $longitude
 $zoom
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 $title
 $postvar
 $info
 $alert
 $required = false

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type.

Detailed Description

This class represents a location property in a property form.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 31 of file class.ilLocationInputGUI.php.

Constructor & Destructor Documentation

ilLocationInputGUI::__construct (   $a_title = "",
  $a_postvar = "" 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilFormPropertyGUI.

Definition at line 43 of file class.ilLocationInputGUI.php.

References ilFormPropertyGUI\setType().

{
parent::__construct($a_title, $a_postvar);
$this->setType("location");
}

+ Here is the call graph for this function:

Member Function Documentation

ilLocationInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Reimplemented from ilFormPropertyGUI.

Definition at line 126 of file class.ilLocationInputGUI.php.

References $lng, ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilFormPropertyGUI\setAlert(), and ilUtil\stripSlashes().

{
global $lng;
$_POST[$this->getPostVar()]["latitude"] =
ilUtil::stripSlashes($_POST[$this->getPostVar()]["latitude"]);
$_POST[$this->getPostVar()]["longitude"] =
ilUtil::stripSlashes($_POST[$this->getPostVar()]["longitude"]);
if ($this->getRequired() &&
(trim($_POST[$this->getPostVar()]) == "" || trim($_POST[$this->getPostVar()]) == ""))
{
$this->setAlert($lng->txt("msg_input_is_required"));
return false;
}
return true;
}

+ Here is the call graph for this function:

ilLocationInputGUI::getLatitude ( )

Get Latitude.

Returns
real Latitude

Definition at line 64 of file class.ilLocationInputGUI.php.

References $latitude.

Referenced by insert().

{
}

+ Here is the caller graph for this function:

ilLocationInputGUI::getLongitude ( )

Get Longitude.

Returns
real Longitude

Definition at line 84 of file class.ilLocationInputGUI.php.

References $longitude.

Referenced by insert().

{
}

+ Here is the caller graph for this function:

ilLocationInputGUI::getZoom ( )

Get Zoom.

Returns
int Zoom

Definition at line 104 of file class.ilLocationInputGUI.php.

References $zoom.

Referenced by insert().

{
return $this->zoom;
}

+ Here is the caller graph for this function:

ilLocationInputGUI::insert ( $a_tpl)

Insert property html.

Definition at line 148 of file class.ilLocationInputGUI.php.

References $lng, $tpl, ilUtil\formSelect(), getLatitude(), getLongitude(), ilFormPropertyGUI\getPostVar(), and getZoom().

{
global $tpl, $lng;
$lng->loadLanguageModule("gmaps");
$a_tpl->setCurrentBlock("prop_location");
$a_tpl->setVariable("POST_VAR", $this->getPostVar());
$a_tpl->setVariable("TXT_ZOOM", $lng->txt("gmaps_zoom_level"));
$a_tpl->setVariable("LOC_DESCRIPTION", $lng->txt("gmaps_std_location_desc"));
$lat = is_numeric($this->getLatitude())
? $this->getLatitude()
: 0;
$long = is_numeric($this->getLongitude())
? $this->getLongitude()
: 0;
$a_tpl->setVariable("PROPERTY_VALUE_LAT", $lat);
$a_tpl->setVariable("PROPERTY_VALUE_LONG", $long);
for($i = 0; $i <= 18; $i++)
{
$levels[$i] = $i;
}
$a_tpl->setVariable("ZOOM_SELECT",
ilUtil::formSelect($this->getZoom(), $this->getPostVar()."[zoom]",
$levels, false, true, 0, "", array("id" => "map_".$this->getPostVar()."_zoom",
"onchange" => "ilUpdateMap('"."map_".$this->getPostVar()."');")));
$a_tpl->setVariable("MAP_ID", "map_".$this->getPostVar());
include_once("./Services/GoogleMaps/classes/class.ilGoogleMapGUI.php");
$map_gui = new ilGoogleMapGUI();
$map_gui->setMapId("map_".$this->getPostVar());
$map_gui->setLatitude($lat);
$map_gui->setLongitude($long);
$map_gui->setZoom($this->getZoom());
$map_gui->setEnableTypeControl(true);
$map_gui->setEnableLargeMapControl(true);
$map_gui->setEnableUpdateListener(true);
$map_gui->setEnableCentralMarker(true);
$a_tpl->setVariable("MAP", $map_gui->getHtml());
$a_tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilLocationInputGUI::setLatitude (   $a_latitude)

Set Latitude.

Parameters
real$a_latitudeLatitude

Definition at line 54 of file class.ilLocationInputGUI.php.

Referenced by ilObjExternalToolsSettingsGUI\editGoogleMapsObject(), ilObjGroupGUI\editMapSettingsObject(), ilObjCourseGUI\editMapSettingsObject(), setValueByArray(), and ilPersonalProfileGUI\showLocation().

{
$this->latitude = $a_latitude;
}

+ Here is the caller graph for this function:

ilLocationInputGUI::setLongitude (   $a_longitude)

Set Longitude.

Parameters
real$a_longitudeLongitude

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

Referenced by setValueByArray().

{
$this->longitude = $a_longitude;
}

+ Here is the caller graph for this function:

ilLocationInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

Definition at line 114 of file class.ilLocationInputGUI.php.

References ilFormPropertyGUI\getPostVar(), setLatitude(), setLongitude(), and setZoom().

{
$this->setLatitude($a_values[$this->getPostVar()]["latitude"]);
$this->setLongitude($a_values[$this->getPostVar()]["longitude"]);
$this->setZoom($a_values[$this->getPostVar()]["zoom"]);
}

+ Here is the call graph for this function:

ilLocationInputGUI::setZoom (   $a_zoom)

Set Zoom.

Parameters
int$a_zoomZoom

Definition at line 94 of file class.ilLocationInputGUI.php.

Referenced by setValueByArray().

{
$this->zoom = $a_zoom;
}

+ Here is the caller graph for this function:

Field Documentation

ilLocationInputGUI::$latitude
protected

Definition at line 33 of file class.ilLocationInputGUI.php.

Referenced by getLatitude().

ilLocationInputGUI::$longitude
protected

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

Referenced by getLongitude().

ilLocationInputGUI::$zoom
protected

Definition at line 35 of file class.ilLocationInputGUI.php.

Referenced by getZoom().


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