3require_once 
"Services/ADT/classes/Bridges/class.ilADTSearchBridgeSingle.php";
 
   20        if ($value !== 
null) {
 
   41            include_once(
"./Services/Maps/classes/class.ilMapUtil.php");
 
   43            $adt->setLatitude($def[
"latitude"]);
 
   44            $adt->setLongitude($def[
"longitude"]);
 
   45            $adt->setZoom($def[
"zoom"]);
 
   52        if (!$default && !
$adt->isNull()) {
 
   53            $optional->setChecked(
true);
 
   57        $loc->setLongitude(
$adt->getLongitude());
 
   58        $loc->setLatitude(
$adt->getLatitude());
 
   59        $loc->setZoom(
$adt->getZoom());
 
   60        $optional->addSubItem($loc);
 
   64        $rad->setSuffix(
$lng->txt(
"form_location_radius_km"));
 
   65        $rad->setValue($this->radius);
 
   66        $rad->setRequired(
true);
 
   67        $optional->addSubItem($rad);
 
   74        return (
bool) $a_post[
"tgl"];
 
   83            $tgl->setChecked(
true);
 
   86            $item->setLongitude($post[
"longitude"]);
 
   87            $item->setLatitude($post[
"latitude"]);
 
   88            $item->setZoom($post[
"zoom"]);
 
   90            $this->radius = (int) $post[
"rad"];
 
   92            $this->
getADT()->setLongitude($post[
"longitude"]);
 
   93            $this->
getADT()->setLatitude($post[
"latitude"]);
 
   94            $this->
getADT()->setZoom($post[
"zoom"]);
 
   97            $this->force_valid = 
true;
 
   99            $this->
getADT()->setLongitude(
null);
 
  100            $this->
getADT()->setLatitude(
null);
 
  101            $this->
getADT()->setZoom(
null);
 
  102            $this->radius = 
null;
 
  108        return (parent::isValid() && ((
int) $this->radius || (
bool) $this->force_valid));
 
  124        $earth_radius = 6371;
 
  127        $max_lat = $a_latitude + rad2deg($a_radius / $earth_radius);
 
  128        $min_lat = $a_latitude - rad2deg($a_radius / $earth_radius);
 
  129        $max_long = $a_longitude + rad2deg($a_radius / $earth_radius / cos(deg2rad($a_latitude)));
 
  130        $min_long = $a_longitude - rad2deg($a_radius / $earth_radius / cos(deg2rad($a_latitude)));
 
  133            "lat" => array(
"min" => $min_lat, 
"max" => $max_lat)
 
  134            ,
"long" => array(
"min" => $min_long, 
"max" => $max_long)
 
  151            $res[] = $a_element_id . 
"_lat >= " . 
$ilDB->quote($box[
"lat"][
"min"], 
"float");
 
  152            $res[] = $a_element_id . 
"_lat <= " . 
$ilDB->quote($box[
"lat"][
"max"], 
"float");
 
  153            $res[] = $a_element_id . 
"_long >= " . 
$ilDB->quote($box[
"long"][
"min"], 
"float");
 
  154            $res[] = $a_element_id . 
"_long <= " . 
$ilDB->quote($box[
"long"][
"max"], 
"float");
 
  156            return "(" . implode(
" AND ", 
$res) . 
")";
 
  166            return serialize(array(
 
  167                "lat" => $this->
getADT()->getLatitude()
 
  168                ,
"long" => $this->
getADT()->getLongitude()
 
  169                ,
"zoom" => $this->
getADT()->getZoom()
 
  170                ,
"radius" => (
int) $this->radius
 
  177        $a_value = unserialize($a_value);
 
  178        if (is_array($a_value)) {
 
  179            $this->
getADT()->setLatitude($a_value[
"lat"]);
 
  180            $this->
getADT()->setLongitude($a_value[
"long"]);
 
  181            $this->
getADT()->setZoom($a_value[
"zoom"]);
 
  182            $this->radius = (int) $a_value[
"radius"];
 
An exception for terminatinating execution or to throw for unit testing.
ADT definition base class.
getSQLCondition($a_element_id)
Get SQL condition for current value(s)
getSerializedValue()
Get current value(s) in serialized form (for easy persisting)
addToForm()
Add ADT-specific fields to form.
setSerializedValue($a_value)
Set current value(s) in serialized form (for easy persisting)
getBoundingBox($a_latitude, $a_longitude, $a_radius)
Get bounding box for location circum search.
loadFilter()
Load filter value(s) into ADT.
shouldBeImportedFromPost($a_post)
Check if incoming values should be imported at all.
isValidADTDefinition(ilADTDefinition $a_adt_def)
Check if given ADT definition is valid.
importFromPost(array $a_post=null)
Import values from (search) form request POST data.
readFilter()
Load value(s) from filter store (in session)
extractPostValues(array $a_post=null)
Extract data from (post) values.
addToElementId($a_add)
Add sub-element.
addToParentElement(ilFormPropertyGUI $a_field)
Add form field to parent element.
getElementId()
Get element id.
static getDefaultSettings()
Get default longitude, latitude and zoom.
foreach($_POST as $key=> $value) $res