Skip to content
Snippets Groups Projects
Select Git revision
6 results Searching

PrivateLayer.class.inc

Blame
  • PrivateLayer.class.inc 3.09 KiB
    <?php
    
    require_once 'Vmap4MapServer.class.inc';
    require_once dirname($_SERVER['SCRIPT_FILENAME']) . '/class/vitis_lib/Connection.class.inc';
    
    /**
     * \file PrivateLayer.class.inc
     * \class PrivateLayer
     *
     * \author Armand Bahi <armand.bahi@veremes.com>.
     *
     * \brief This file contains the PrivateLayer php class
     *
     * This class defines operation for one private layer
     * 
     */
    class PrivateLayer extends Vmap4MapServer {
    
        public $oError;
    
        /**
         * construct
         * @param type $aPath url of the request
         * @param type $aValues parameters of the request
         * @param type $properties properties
         * @param type $bShortcut false to reinit variables
         * @param type $oConnection connection object
         */
        function __construct($aPath, $aValues, $properties, $bShortcut = false, $oConnection = false) {
            parent::__construct($aPath, $aValues, $properties, $bShortcut, $oConnection);
            $this->aSelectedFields = Array("ms_layer_id", "name", "title", "coordsys_id", "source_id", "connection_id", "tableschema", "tablename", "tableidfield", "definition", "opacity", "active", "ms_layertype_id", "wmsservices", "wmsservices_label", "private_connection");
        }
    
        /**
         * get informations about private layer
         */
        function GET() {
            require $this->sRessourcesFile;
            $this->aFields = $this->getFields($this->aProperties['schema_vm4ms'], 'v_private_ms_layer', 'ms_layer_id');
            /*
              // Flux wms rattachés à la couche.
              if (in_array("wmsservices", $this->aSelectedFields)){
              $aParams['sSchemaVm4ms'] = array('value' => $this->aProperties['schema_vm4ms'], 'type' => 'schema_name');
              $aParams['ms_layer_id'] = array('value' => $this->aValues['my_vitis_id'], 'type' => 'number');
              $oPDOresult = $this->oConnection->oBd->executeWithParams($aSql['getPrivateLayerWmsServices'], $aParams);
    
              $sListWmsServiceId = "";
              $aListWmsServiceName = array();
              while($aLigne=$this->oConnection->oBd->ligneSuivante ($oPDOresult)) {
              if ($sListWmsServiceId == ""){
              $sListWmsServiceId = $aLigne["wmsservice_id"];
              }else{
              $sListWmsServiceId .= "|".$aLigne["wmsservice_id"];
              }
              $aListWmsServiceName[] = $aLigne["wmsservice_id"];
              }
              $oPDOresult=$this->oConnection->oBd->fermeResultat();
              $this->aFields['wmsservices'] = $sListWmsServiceId;
              $this->aFields['wmsservices_label'] = implode(',', $aListWmsServiceName);
              }
             */
        }
    
        /**
         * delete a private layer
         */
        function DELETE() {
            /*
              require $this->sRessourcesFile;
              $this->oConnection->oBd->delete($this->aProperties['schema_vm4ms'], 'ms_layer', 'ms_layer_id', $this->aValues['my_vitis_id'], 'string');