[PLUGINS] ~maj globale
[lhc/web/www.git] / www / plugins / gis / base / gis.php
index 89aa1cb..5764755 100644 (file)
@@ -1,8 +1,10 @@
 <?php
 
-if (!defined("_ECRIRE_INC_VERSION")) return;
+if (!defined('_ECRIRE_INC_VERSION')) {
+       return;
+}
 
-function gis_declarer_tables_interfaces($interface){
+function gis_declarer_tables_interfaces($interface) {
        $interface['table_des_tables']['gis'] = 'gis';
        $interface['table_des_tables']['gis_liens'] = 'gis_liens';
 
@@ -21,7 +23,7 @@ function gis_declarer_tables_interfaces($interface){
        return $interface;
 }
 
-function gis_declarer_tables_objets_sql($tables){
+function gis_declarer_tables_objets_sql($tables) {
        /* Declaration de la table de points gis */
        $tables['spip_gis'] = array(
                /* Declarations principales */
@@ -32,22 +34,27 @@ function gis_declarer_tables_objets_sql($tables){
 
                /* La table */
                'field' => array(
-                       "id_gis" => "bigint(21) NOT NULL",
-                       "titre" => "text NOT NULL DEFAULT ''",
-                       "descriptif" => "text NOT NULL DEFAULT ''",
-                       "lat" => "double NULL NULL",
-                       "lon" => "double NULL NULL",
-                       "zoom" => "tinyint(4) NULL NULL",
-                       "adresse" => "text NOT NULL DEFAULT ''",
-                       "pays" => "text NOT NULL DEFAULT ''",
-                       "code_pays" => "varchar(255) NOT NULL DEFAULT ''",
-                       "region" => "text NOT NULL DEFAULT ''",
-                       "departement" => "text NOT NULL DEFAULT ''",
-                       "ville" => "text NOT NULL DEFAULT ''",
-                       "code_postal" => "varchar(255) NOT NULL DEFAULT ''"
+                       'id_gis' => 'bigint(21) NOT NULL',
+                       'titre' => "text NOT NULL DEFAULT ''",
+                       'descriptif' => "text NOT NULL DEFAULT ''",
+                       'lat' => 'double NULL NULL',
+                       'lon' => 'double NULL NULL',
+                       'zoom' => 'tinyint(4) NULL NULL',
+                       'adresse' => "text NOT NULL DEFAULT ''",
+                       'pays' => "text NOT NULL DEFAULT ''",
+                       'code_pays' => "varchar(255) NOT NULL DEFAULT ''",
+                       'region' => "text NOT NULL DEFAULT ''",
+                       'departement' => "text NOT NULL DEFAULT ''",
+                       'ville' => "text NOT NULL DEFAULT ''",
+                       'code_postal' => "varchar(255) NOT NULL DEFAULT ''",
+                       'color' => "varchar(25) NOT NULL DEFAULT ''",
+                       'weight' => "varchar(4) NOT NULL DEFAULT ''",
+                       'opacity' => "varchar(4) NOT NULL DEFAULT ''",
+                       'fillcolor' => "varchar(25) NOT NULL DEFAULT ''",
+                       'fillopacity' => "varchar(4) NOT NULL DEFAULT ''"
                ),
                'key' => array(
-                       "PRIMARY KEY" => "id_gis",
+                       'PRIMARY KEY' => 'id_gis',
                        'KEY lat' => 'lat',
                        'KEY lon' => 'lon',
                        'KEY pays' => 'pays(500)',
@@ -58,7 +65,7 @@ function gis_declarer_tables_objets_sql($tables){
                        'KEY code_postal' => 'code_postal',
                ),
                'join' => array(
-                               "id_gis"=>"id_gis"
+                               'id_gis' => 'id_gis'
                ),
                'principale' => 'oui',
                'modeles' => array('carte_gis', 'carte_gis_preview'),
@@ -71,8 +78,9 @@ function gis_declarer_tables_objets_sql($tables){
                'url_voir' => 'gis',
                'url_edit' => 'gis_edit',
                'editable' => 'oui',
-               'champs_editables' => array('lat', 'lon', 'zoom', 'titre', 'descriptif', 'adresse', 'code_postal', 'ville', 'region', 'departement', 'pays', 'code_pays'),
-               'champs_versionnes' => array('lat', 'lon', 'zoom', 'titre', 'descriptif', 'adresse', 'code_postal', 'ville', 'region', 'departement', 'pays', 'code_pays'),
+               'champs_editables' => array('lat', 'lon', 'zoom', 'titre', 'descriptif', 'adresse', 'code_postal', 'ville', 'region', 'departement', 'pays', 'code_pays', 'color', 'weight', 'opacity', 'fillcolor', 'fillopacity'),
+               'champs_versionnes' => array('lat', 'lon', 'zoom', 'titre', 'descriptif', 'adresse', 'code_postal', 'ville', 'region', 'departement', 'pays', 'code_pays', 'color', 'weight', 'opacity', 'fillcolor', 'fillopacity'),
+               'champs_critere_gis' => array('gis.titre AS titre_gis', 'gis.descriptif AS descriptif_gis', 'gis.adresse AS adresse_gis', 'gis.pays AS pays_gis', 'gis.code_pays AS code_pays_gis', 'gis.region AS region_gis', 'gis.departement AS departement_gis', 'gis.ville AS ville_gis', 'gis.code_postal AS code_postal_gis'),
                'icone_objet' => 'gis',
                'rechercher_champs' => array(
                        'titre' => 8,
@@ -115,17 +123,17 @@ function gis_declarer_tables_objets_sql($tables){
        return $tables;
 }
 
-function gis_declarer_tables_auxiliaires($tables_auxiliaires){
+function gis_declarer_tables_auxiliaires($tables_auxiliaires) {
        $spip_gis_liens = array(
-               "id_gis" => "bigint(21) NOT NULL",
-               "objet" => "VARCHAR (25) DEFAULT '' NOT NULL",
-               "id_objet" => "bigint(21) NOT NULL");
+               'id_gis' => 'bigint(21) NOT NULL',
+               'objet' => "VARCHAR (25) DEFAULT '' NOT NULL",
+               'id_objet' => 'bigint(21) NOT NULL');
 
        $spip_gis_liens_key = array(
-               "PRIMARY KEY" => "id_gis,id_objet,objet",
-               "KEY id_gis" => "id_gis",
-               "KEY id_objet" => "id_objet",
-               "KEY objet" => "objet"
+               'PRIMARY KEY' => 'id_gis,id_objet,objet',
+               'KEY id_gis' => 'id_gis',
+               'KEY id_objet' => 'id_objet',
+               'KEY objet' => 'objet'
        );
 
        $tables_auxiliaires['spip_gis_liens'] = array(
@@ -134,5 +142,3 @@ function gis_declarer_tables_auxiliaires($tables_auxiliaires){
 
        return $tables_auxiliaires;
 }
-
-?>