ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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. More...
 
 setLatitude ($a_latitude)
 Set Latitude. More...
 
 getLatitude ()
 Get Latitude. More...
 
 setLongitude ($a_longitude)
 Set Longitude. More...
 
 getLongitude ()
 Get Longitude. More...
 
 setZoom ($a_zoom)
 Set Zoom. More...
 
 getZoom ()
 Get Zoom. More...
 
 setAddress ($a_address)
 Set Address. More...
 
 getAddress ()
 Get Address. More...
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert (&$a_tpl)
 Insert property html. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 
 removeProhibitedCharacters ($a_text)
 Remove prohibited characters see #19159. More...
 

Protected Attributes

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

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

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

◆ __construct()

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.

45 {
46 parent::__construct($a_title, $a_postvar);
47 $this->setType("location");
48 }
setType($a_type)
Set Type.

References ilFormPropertyGUI\setType().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

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.

148 {
149 global $lng;
150
151 $_POST[$this->getPostVar()]["latitude"] =
152 ilUtil::stripSlashes($_POST[$this->getPostVar()]["latitude"]);
153 $_POST[$this->getPostVar()]["longitude"] =
154 ilUtil::stripSlashes($_POST[$this->getPostVar()]["longitude"]);
155 if ($this->getRequired() &&
156 (trim($_POST[$this->getPostVar()]["latitude"]) == "" || trim($_POST[$this->getPostVar()]["longitude"]) == ""))
157 {
158 $this->setAlert($lng->txt("msg_input_is_required"));
159
160 return false;
161 }
162 return true;
163 }
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST['username']
Definition: cron.php:12
global $lng
Definition: privfeed.php:40

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

+ Here is the call graph for this function:

◆ getAddress()

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:

◆ getLatitude()

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:

◆ getLongitude()

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:

◆ getZoom()

ilLocationInputGUI::getZoom ( )

Get Zoom.

Returns
int Zoom

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

106 {
107 return $this->zoom;
108 }

References $zoom.

Referenced by insert().

+ Here is the caller graph for this function:

◆ insert()

ilLocationInputGUI::insert ( $a_tpl)

Insert property html.

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

170 {
171 global $lng;
172
173 $lng->loadLanguageModule("maps");
174 $tpl = new ilTemplate("tpl.prop_location.html", true, true, "Services/Form");
175 $tpl->setVariable("POST_VAR", $this->getPostVar());
176 $tpl->setVariable("TXT_ZOOM", $lng->txt("maps_zoom_level"));
177 $tpl->setVariable("TXT_LATITUDE", $lng->txt("maps_latitude"));
178 $tpl->setVariable("TXT_LONGITUDE", $lng->txt("maps_longitude"));
179 $tpl->setVariable("TXT_ADDR", $lng->txt("address"));
180 $tpl->setVariable("LOC_DESCRIPTION", $lng->txt("maps_std_location_desc"));
181
182 $lat = is_numeric($this->getLatitude())
183 ? $this->getLatitude()
184 : 0;
185 $long = is_numeric($this->getLongitude())
186 ? $this->getLongitude()
187 : 0;
188 $tpl->setVariable("PROPERTY_VALUE_LAT", $lat);
189 $tpl->setVariable("PROPERTY_VALUE_LONG", $long);
190 for($i = 0; $i <= 18; $i++)
191 {
192 $levels[$i] = $i;
193 }
194 $tpl->setVariable("ZOOM_SELECT",
195 ilUtil::formSelect($this->getZoom(), $this->getPostVar()."[zoom]",
196 $levels, false, true, 0, "", array("id" => "map_".$this->getPostVar()."_zoom",
197 "onchange" => "ilUpdateMap('"."map_".$this->getPostVar()."');")));
198 $tpl->setVariable("MAP_ID", "map_".$this->getPostVar());
199 $tpl->setVariable("ID", $this->getPostVar());
200 $tpl->setVariable("TXT_LOOKUP", $lng->txt("maps_lookup_address"));
201 $tpl->setVariable("TXT_ADDRESS", $this->getAddress());
202
203 include_once("./Services/Maps/classes/class.ilMapUtil.php");
204 $map_gui = ilMapUtil::getMapGUI();
205 $map_gui->setMapId("map_".$this->getPostVar())
206 ->setLatitude($lat)
207 ->setLongitude($long)
208 ->setZoom($this->getZoom())
209 ->setEnableTypeControl(true)
210 ->setEnableLargeMapControl(true)
211 ->setEnableUpdateListener(true)
212 ->setEnableCentralMarker(true);
213
214 $tpl->setVariable("MAP", $map_gui->getHtml());
215
216 $a_tpl->setCurrentBlock("prop_generic");
217 $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
218 $a_tpl->parseCurrentBlock();
219 }
global $tpl
Definition: ilias.php:8
static getMapGUI()
Get an instance of the GUI class.
special template class to simplify handling of ITX/PEAR
static formSelect($selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.

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

+ Here is the call graph for this function:

◆ setAddress()

ilLocationInputGUI::setAddress (   $a_address)

Set Address.

Parameters
string$a_AddressAddress

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

116 {
117 $this->address = $a_address;
118 }

◆ setLatitude()

ilLocationInputGUI::setLatitude (   $a_latitude)

Set Latitude.

Parameters
real$a_latitudeLatitude

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

56 {
57 $this->latitude = $a_latitude;
58 }

Referenced by setValueByArray().

+ Here is the caller graph for this function:

◆ setLongitude()

ilLocationInputGUI::setLongitude (   $a_longitude)

Set Longitude.

Parameters
real$a_longitudeLongitude

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

76 {
77 $this->longitude = $a_longitude;
78 }

Referenced by setValueByArray().

+ Here is the caller graph for this function:

◆ setValueByArray()

ilLocationInputGUI::setValueByArray (   $a_values)

Set value by array.

Parameters
array$a_valuesvalue array

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

136 {
137 $this->setLatitude($a_values[$this->getPostVar()]["latitude"]);
138 $this->setLongitude($a_values[$this->getPostVar()]["longitude"]);
139 $this->setZoom($a_values[$this->getPostVar()]["zoom"]);
140 }
setLatitude($a_latitude)
Set Latitude.
setLongitude($a_longitude)
Set Longitude.

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

+ Here is the call graph for this function:

◆ setZoom()

ilLocationInputGUI::setZoom (   $a_zoom)

Set Zoom.

Parameters
int$a_zoomZoom

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

96 {
97 $this->zoom = $a_zoom;
98 }

Referenced by setValueByArray().

+ Here is the caller graph for this function:

Field Documentation

◆ $address

ilLocationInputGUI::$address
protected

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

Referenced by getAddress().

◆ $latitude

ilLocationInputGUI::$latitude
protected

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

Referenced by getLatitude().

◆ $longitude

ilLocationInputGUI::$longitude
protected

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

Referenced by getLongitude().

◆ $zoom

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: