ILIAS  eassessment Revision 61809
 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.
 setAddress ($a_address)
 Set Address.
 getAddress ()
 Get Address.
 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
executeCommand ()
 Execute command.
 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.
 setParentForm ($a_parentform)
 Set Parent Form.
 getParentForm ()
 Get Parent Form.
 setParent ($a_val)
 Set Parent GUI object.
 getParent ()
 Get Parent GUI object.
 getSubForm ()
 Get sub form html.
 hideSubForm ()
 Sub form hidden on init?
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders)
 getHiddenTitle ()
 Get hidden title.
 getItemByPostVar ($a_post_var)
 Get item by post var.
 serializeData ()
 serialize data
 unserializeData ($a_data)
 unserialize data
 writeToSession ()
 Write to session.
 clearFromSession ()
 Clear session value.
 readFromSession ()
 Read from session.
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties)

Protected Attributes

 $latitude
 $longitude
 $zoom
 $address
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 $title
 $postvar
 $info
 $alert
 $required = false
 $parentgui
 $parentform
 $hidden_title = ""

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 44 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 147 of file class.ilLocationInputGUI.php.

References $_POST, $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()]["latitude"]) == "" || trim($_POST[$this->getPostVar()]["longitude"]) == ""))
{
$this->setAlert($lng->txt("msg_input_is_required"));
return false;
}
return true;
}

+ Here is the call graph for this function:

ilLocationInputGUI::getAddress ( )

Get Address.

Returns
string Address

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

References $address.

Referenced by insert().

{
}

+ Here is the caller graph for this function:

ilLocationInputGUI::getLatitude ( )

Get Latitude.

Returns
real Latitude

Definition at line 65 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 85 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 105 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 169 of file class.ilLocationInputGUI.php.

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

{
global $lng;
$lng->loadLanguageModule("gmaps");
$tpl = new ilTemplate("tpl.prop_location.html", true, true, "Services/Form");
$tpl->setVariable("POST_VAR", $this->getPostVar());
$tpl->setVariable("TXT_ZOOM", $lng->txt("gmaps_zoom_level"));
$tpl->setVariable("TXT_LATITUDE", $lng->txt("gmaps_latitude"));
$tpl->setVariable("TXT_LONGITUDE", $lng->txt("gmaps_longitude"));
$tpl->setVariable("TXT_ADDR", $lng->txt("address"));
$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;
$tpl->setVariable("PROPERTY_VALUE_LAT", $lat);
$tpl->setVariable("PROPERTY_VALUE_LONG", $long);
for($i = 0; $i <= 18; $i++)
{
$levels[$i] = $i;
}
$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()."');")));
$tpl->setVariable("MAP_ID", "map_".$this->getPostVar());
$tpl->setVariable("ID", $this->getPostVar());
$tpl->setVariable("TXT_LOOKUP", $lng->txt("gmaps_lookup_address"));
$tpl->setVariable("TXT_ADDRESS", $this->getAddress());
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);
$tpl->setVariable("MAP", $map_gui->getHtml());
$a_tpl->setCurrentBlock("prop_generic");
$a_tpl->setVariable("PROP_GENERIC", $tpl->get());
$a_tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilLocationInputGUI::setAddress (   $a_address)

Set Address.

Parameters
string$a_AddressAddress

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

{
$this->address = $a_address;
}
ilLocationInputGUI::setLatitude (   $a_latitude)

Set Latitude.

Parameters
real$a_latitudeLatitude

Definition at line 55 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 75 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 135 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 95 of file class.ilLocationInputGUI.php.

Referenced by setValueByArray().

{
$this->zoom = $a_zoom;
}

+ Here is the caller graph for this function:

Field Documentation

ilLocationInputGUI::$address
protected

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

Referenced by getAddress().

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: