/**
  * Determines the request method and selects the appropriate data result.
  *
  * @param  array $arrInput Fragments from request uri
  * @return mixed           JSON data
  */
 public function generate(array $arrInput)
 {
     // Only allow GET requests
     if (strtoupper($_SERVER['REQUEST_METHOD']) != 'GET') {
         \HttpResultHelper::MethodNotAllowed();
     }
     // A map id is required
     if (count($arrInput) < 1 && !is_numeric($arrInput[0])) {
         \HttpResultHelper::BadRequest();
     }
     $intProfileId = intval($arrInput[0]);
     $arrParams = array();
     $strParams = "";
     foreach ($_GET as $key => $value) {
         if (\Input::get($key)) {
             $arrParams[$key] = \Input::get($key);
             if (strlen($strParams) > 0) {
                 $strParams .= "&";
             }
             if ($key == "loc_to" || $key == "loc_from") {
                 $strParams .= "loc=" . \Input::get($key);
             } else {
                 $strParams .= $key . "=" . \Input::get($key);
             }
         }
     }
     return $this->getRoutingResponse($intProfileId, $strParams);
 }
 public function generate(array $arrInput)
 {
     // Only allow GET requests
     if (strtoupper($_SERVER['REQUEST_METHOD']) != 'GET') {
         \HttpResultHelper::MethodNotAllowed();
     }
     // A map id is required
     if (count($arrInput) < 1 && !is_numeric($arrInput[0])) {
         \HttpResultHelper::BadRequest();
     }
     return json_encode($this->getLayerData(intval($arrInput[0]), true));
 }
 /**
  * Determines the request method and selects the appropriate data result.
  *
  * @param  array $arrInput Fragments from request uri
  * @return mixed           JSON data
  */
 public function generate(array $arrInput)
 {
     // Only allow GET requests
     if (strtoupper($_SERVER['REQUEST_METHOD']) != 'GET') {
         \HttpResultHelper::MethodNotAllowed();
     }
     // A profile id is required
     if (count($arrInput) < 1 && !is_numeric($arrInput[0])) {
         \HttpResultHelper::BadRequest();
     }
     $intProfileId = intval($arrInput[0]);
     return json_encode($this->getEditorConfigForProfile($intProfileId));
 }
 /**
  * Determines the request method and selects the appropriate data result.
  *
  * @param  array $arrInput Fragments from request uri
  * @return mixed           JSON data
  */
 public function generate(array $arrInput)
 {
     // Only allow GET requests
     if (strtoupper($_SERVER['REQUEST_METHOD']) != 'GET') {
         \HttpResultHelper::MethodNotAllowed();
     }
     // A map id is required
     /*if (count($arrInput) < 1 && !is_numeric($arrInput[0])) {
           \HttpResultHelper::BadRequest();
       }*/
     $arrIds = \Input::get('ids');
     if (count($arrIds) < 1) {
         \HttpResultHelper::BadRequest();
     }
     return json_encode($this->getStyleData($arrIds));
 }
Esempio n. 5
0
 public function generate(array $arrInput)
 {
     // Only allow GET requests
     if (strtoupper($_SERVER['REQUEST_METHOD']) != 'GET') {
         \HttpResultHelper::MethodNotAllowed();
     }
     // A map id is required
     if (count($arrInput) < 1 && !is_numeric($arrInput[0])) {
         \HttpResultHelper::BadRequest();
     }
     $this->import('FrontendUser', 'User');
     $intParentId = intval($arrInput[0]);
     $arrLayers = $this->getLayerList($intParentId);
     if (sizeof($this->arrReassignedLayer) > 0) {
         foreach ($arrLayers as $index => $layer) {
             $strLayerName = $layer['name'];
             if (array_key_exists($strLayerName, $this->arrReassignedLayer)) {
                 foreach ($this->arrReassignedLayer[$strLayerName] as $reassignedLayer) {
                     if (is_array($arrLayers[$index]['content'])) {
                         $arrLayers[$index]['content'][] = $reassignedLayer;
                     } else {
                         $arrLayers[$index]['content'] = array($reassignedLayer);
                     }
                 }
             }
             if ($layer['hasChilds']) {
                 foreach ($layer['childs'] as $childIndex => $childLayer) {
                     $strChildLayerName = $childLayer['name'];
                     if (array_key_exists($strChildLayerName, $this->arrReassignedLayer)) {
                         foreach ($this->arrReassignedLayer[$strChildLayerName] as $reassignedLayer) {
                             if (is_array($arrLayers[$index]['childs'][$childIndex]['content'])) {
                                 $arrLayers[$index]['childs'][$childIndex]['content'][] = $reassignedLayer;
                             } else {
                                 $arrLayers[$index]['childs'][$childIndex]['content'] = array($reassignedLayer);
                             }
                         }
                     }
                 }
             }
         }
     }
     $this->arrConfig['countAll'] = sizeof($arrLayers);
     $return = array('config' => $this->arrConfig, 'layer' => $arrLayers, 'foreignLayers' => $this->checkAndFetchMissingLinkedLayers($arrLayers));
     return json_encode($return);
 }
 /**
  * Determines the request method and selects the appropriate data result.
  *
  * @param  array $arrInput Fragments from request uri
  * @return mixed           JSON data
  */
 public function generate(array $arrInput)
 {
     // Only allow GET requests
     if (strtoupper($_SERVER['REQUEST_METHOD']) != 'GET') {
         \HttpResultHelper::MethodNotAllowed();
     }
     // A profile id is required
     if (count($arrInput) < 1 && !is_numeric($arrInput[0])) {
         \HttpResultHelper::BadRequest();
     }
     $intProfileId = intval($arrInput[0]);
     $arrParams = array();
     foreach ($_GET as $key => $value) {
         if (\Input::get($key)) {
             $arrParams[$key] = \Input::get($key);
         }
     }
     return $this->getNominatimResponse($intProfileId, $arrParams);
 }
 public function generate(array $arrInput)
 {
     // Only allow GET requests
     if (strtoupper($_SERVER['REQUEST_METHOD']) != 'GET') {
         \HttpResultHelper::MethodNotAllowed();
     }
     // A map id is required
     if (count($arrInput) < 1 && !is_numeric($arrInput[0])) {
         \HttpResultHelper::BadRequest();
     }
     $intProfileId = intval($arrInput[0]);
     $blnProfileBaselayerFilter = false;
     $mapsProfileModel = \C4gMapProfilesModel::findById($intProfileId);
     if ($mapsProfileModel !== null) {
         if ($mapsProfileModel->baselayers) {
             $blnProfileBaselayerFilter = true;
             $arrProfileBaselayerFilter = deserialize($mapsProfileModel->baselayers, true);
         }
     }
     $arrLayers = $this->getBaseLayerList($blnProfileBaselayerFilter ? $arrProfileBaselayerFilter : false);
     $this->arrConfig['countAll'] = sizeof($arrLayers);
     return json_encode(array('config' => $this->arrConfig, 'baselayer' => $arrLayers));
 }
 /**
  * Determines the request method and selects the appropriate data result.
  *
  * @param  array $arrInput Fragments from request uri
  * @return mixed           JSON data
  */
 public function generate(array $arrInput)
 {
     // Only allow GET requests
     if (strtoupper($_SERVER['REQUEST_METHOD']) != 'GET') {
         \HttpResultHelper::MethodNotAllowed();
     }
     // A map id is required
     if (count($arrInput) < 1) {
         \HttpResultHelper::BadRequest();
     }
     //$arrIds = \Input::get('ids');
     /*if (count($arrIds) < 1) {
           \HttpResultHelper::BadRequest();
       }*/
     if (strpos($arrInput[0], ":") !== false) {
         $arrInputExploded = explode(':', $arrInput[0]);
         $strTable = $arrInputExploded[0];
         $intId = $arrInputExploded[1];
     } else {
         \HttpResultHelper::BadRequest();
     }
     return json_encode($this->getInfoWindowContent($strTable, $intId));
 }