<div class="form-group"> <label class="col-lg-1 control-label"><i class="fa fa-location-arrow"></i> {{Arrivée}}</label> <label class="col-lg-1 control-label">{{Géolocalisation}}</label> <div class="col-lg-2"> <select class="form-control eqLogicAttr configuration geolocend" id="geoloc" data-l1key="configuration" data-l2key="geolocend"> <option value="none">{{Manuel}}</option> <?php foreach (eqLogic::byType('geoloc') as $geoloc) { foreach (geolocCmd::byEqLogicId($geoloc->getId()) as $geoinfo) { if ($geoinfo->getConfiguration('mode') == 'fixe' || $geoinfo->getConfiguration('mode') == 'dynamic') { echo '<option value="normal|' . $geoinfo->getId() . '">' . $geoinfo->getHumanName(true) . '</option>'; } } } foreach (eqLogic::byType('geoloc_ios') as $geoloc) { foreach (geoloc_iosCmd::byEqLogicId($geoloc->getId()) as $geoinfo) { if (($geoinfo->getConfiguration('mode') == 'fixe' || $geoinfo->getConfiguration('mode') == 'dynamic') && $geoinfo->getName() != 'Refresh') { echo '<option value="ios|' . $geoinfo->getId() . '">' . $geoinfo->getHumanName(true) . '</option>'; } } } ?> </select> </div> <label class="col-lg-1 control-label hideend">{{Latitude}}</label> <div class="col-lg-2"> <input type="text" class="eqLogicAttr form-control hideend" data-l1key="configuration" data-l2key="latarrive" placeholder="{{48.856614}}"/> </div> <label class="col-lg-1 control-label hideend">{{Longitude}}</label> <div class="col-lg-2"> <input type="text" class="eqLogicAttr form-control hideend" data-l1key="configuration" data-l2key="lonarrive" placeholder="{{2.3522219000000177}}"/>
public function getPosition($_point = 'start') { $return = array(); $point = $_point == 'start' ? 'depart' : 'arrive'; if ($this->getConfiguration('geoloc' . $_point, '') == 'none') { $return['lat'] = $this->getConfiguration('lat' . $point); $return['lon'] = $this->getConfiguration('lon' . $point); } else { $geoloc = $this->getConfiguration('geoloc' . $_point, ''); $typeId = explode('|', $geoloc); if ($typeId[0] == 'ios') { $geolocCmd = geoloc_iosCmd::byId($typeId[1]); } else { $geolocCmd = geolocCmd::byId($typeId[1]); } $geoloctab = explode(',', $geolocCmd->execCmd(null, 0)); if (isset($geoloctab[0]) && isset($geoloctab[1])) { $return['lat'] = $geoloctab[0]; $return['lon'] = $geoloctab[1]; } else { throw new Exception(__('Position de départ invalide', __FILE__)); } } return $return; }