Changeset 50140 in spip-zone
- Timestamp:
- Aug 1, 2011, 10:00:47 AM (10 years ago)
- Location:
- _plugins_/forms/geoforms
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/forms/geoforms/exec/geoforms_config.php
r11590 r50140 6 6 * Auteur : 7 7 * Cedric Morin 8 * (Modifié par Carl V.) 9 * 8 10 * (c) 2007 - Distribue sous licence GNU/GPL 9 11 * … … 14 16 15 17 function exec_geoforms_config(){ 18 16 19 global $connect_statut,$spip_lang_right; 17 debut_page(_T('geoforms:configuration')); 20 21 22 /**** Modification pour être compatible avec SPIP 2 ****/ 23 /** (cf. --> http://www.spip-contrib.net/PortageV2-Migrer-un-plugin-vers-SPIP2 ) **/ 24 25 // Test de la version de SPIP 26 if (version_compare($GLOBALS['spip_version_code'],'1.9300','<')) // SPIP <= 1.9.2x 27 { 28 debut_page(_T('geoforms:configuration')); 29 30 } elseif (version_compare($GLOBALS['spip_version_code'],'2','>=')) // SPIP >= 2.x 31 { 32 $commencer_page = charger_fonction('commencer_page', 'inc'); 33 34 // Affichage d'un bouton 'GeoForms' situé dans le sous-menu de 'Configuration' (espace privé) 35 // permettant de paramétrer GeoForms (MAIS pour l'instant ne marche pas!!) 36 echo $commencer_page( _T("geoforms:configuration") ); 37 }; 38 39 /*************************************************************/ 40 18 41 19 42 // Configuration du systeme geographique 20 43 echo debut_grand_cadre(true); 21 if (autoriser('administrer','geoforms')) { 44 45 46 echo "<div>"; 47 48 // Titre de la page de configuration 49 echo "<h3>"; 50 echo _T("geoforms:configuration_titre") . " : "; 51 echo "</h3>"; 52 53 // 'Warning' à afficher sur la page de configuration SI SPIP >= 2.1 54 // (à tester sur d'autres versions de SPIP...) 55 if ( version_compare($GLOBALS['spip_version_code'],'2.1','>=') ) 56 { 57 echo "<p>"; 58 echo _T("geoforms:configuration_warning"); 59 echo "<br />"; 60 echo _T("geoforms:configuration_warning2"); 61 echo "</p>"; 62 } 63 64 echo "</div>"; 65 66 echo "<br />"; 67 68 if( autoriser('administrer','geoforms') ) 69 { 70 /* La fonction 'inc_geomap_config()' appelée est définie 71 dans "\plugins\googlemap_api\inc\geomap_config.php" */ 22 72 $geomap_config = charger_fonction('geomap_config','inc'); 73 23 74 echo $geomap_config(); 24 75 } 76 25 77 echo fin_grand_cadre(true); 78 26 79 fin_page(); 80 27 81 } 28 82 29 30 83 ?> -
_plugins_/forms/geoforms/geoforms_map.html
r11417 r50140 1 2 <!-- #### Page de test du plugin 'geoforms' #### --> 3 1 4 <html> 2 <head> 3 #INSERT_HEAD 4 <style type='text/css'><!-- 5 .geomap { 6 width:750px; 7 height:500px; 8 } 9 --></style> 10 </head> 11 <body style='width:100%;height:100%;'> 12 #MODELE{geomap,georss=#URL_PAGE{geoforms.rss,id_form=#ID_FORM}} 13 </body> 5 6 <!-- HEAD --> 7 <head> 8 9 #INSERT_HEAD 10 11 <!-- (Styles externalisés dans un fichier 'geoforms.css') --> 12 <style type='text/css'> 13 <!-- 14 .geomap { 15 width:750px; 16 height:500px; 17 } 18 --> 19 </style> 20 21 </head> 22 23 24 <!-- BODY --> 25 <body style='width:100%; height:100%;'> 26 27 <!-- Modèle permettant d'intégrer la carte Google Map --> 28 #MODELE{geomap,georss=#URL_PAGE{geoforms.rss,id_form=#ID_FORM}} 29 30 </body> 31 14 32 </html> 33 -
_plugins_/forms/geoforms/geoforms_pipeline.php
r11510 r50140 24 24 } 25 25 26 27 /* 28 Inserer les scripts dans le public 29 30 INFO : Fonction récupérée du plugin "googlemap_api" (googlemap_api/inc/geomap_pipeline.php) 31 et modifiée pour faire afficher la carte GoogleMap dans la partie public du site 32 La fonction appelle un script du plugin "googlemap_api" qui inclue le JavaScript 33 "geomap.js" dans le header de la page, ce qui permet d'afficher la carte GoogleMap 34 dans la partie public (à la place d'un cadre vide!) 35 */ 36 function geoforms_affichage_final($flux){ 37 38 // SI on trouve le mot "geomap" dans la page (class CSS du div contenant la carte GoogleMap) 39 // ET que la clé API est définie... 40 if ( 41 (strpos($flux, 'geomap') == true) 42 && (lire_config('geomap/cle_api')) 43 ){ 44 $incHead = ''; 45 $geomap_script_init = charger_fonction('geomap_script_init','inc'); 46 $incHead .= $geomap_script_init(); 47 48 return substr_replace($flux, $incHead, strpos($flux, '</head>'), 0); 49 50 } else { 51 return $flux; 52 } 53 } 54 26 55 ?> -
_plugins_/forms/geoforms/inc/geoforms_types_champs.php
r14633 r50140 10 10 */ 11 11 12 //// Informations sur les pipelines (points dentrées) de 'Forms & Tables' disponibles à l'adresse : 13 //// --> http://www.spip-contrib.net/Les-points-d-entrees-de-Forms 14 15 /* 16 Pipeline "forms_types_champs" : 17 appelé avec la liste des types de champs. Permet dajouter/modifier des types de champ. 18 */ 12 19 function geoforms_forms_types_champs($flux){ 13 20 $flux['geox']=_T('geoforms:geoloc_x'); … … 17 24 } 18 25 26 /* 27 Pipeline "forms_bloc_edition_champ" : 28 appelé avec le contenu du bloc de saisie dun champ. 29 Permet la modification pour des types de champs supplémentaires. 30 */ 19 31 function geoforms_forms_bloc_edition_champ($flux){ 20 32 $row = $flux['args']['row']; … … 54 66 } 55 67 68 /* 69 Pipeline "forms_update_edition_champ" : 70 appelé lors de la mise à jour dun champ, en edition du formulaire. 71 Permet dajouter des proprietes aux champs. 72 */ 56 73 function geoforms_forms_update_edition_champ($flux){ 57 74 $row = $flux['args']['row']; … … 70 87 } 71 88 89 /* 90 Pipeline "forms_input_champs" : 91 appelé pour chaque champ au moment de générer le <input> de saisie. 92 */ 72 93 function geoforms_forms_input_champs($flux){ 73 static $vu=array(); 94 95 static $vu = array(); 74 96 $type = $flux['args']['type']; 75 if (in_array($type,array('geox','geoy','geoz')) 76 AND ( 77 (_DIR_RESTREINT AND $GLOBALS['geoforms_public']!=false) 78 OR (!_DIR_RESTREINT AND _request('exec')!=='forms_edit') 97 98 /***** Modification pour aussi faire afficher la carte côté public *****/ 99 /** (Fix temporaire pour marcher avec SPIP 2.1.10) **/ 100 if( 101 ( 102 in_array( $type, array('geox','geoy','geoz') ) 103 ) AND ( 104 ( _DIR_RESTREINT AND $GLOBALS['geoforms_public'] != false ) 105 OR ( /* !_DIR_RESTREINT AND */ _request('exec') !== 'forms_edit' ) 106 /* Le test "!_DIR_RESTREINT" ne fonctionne pas(/plus?) 107 (?? à remplacer par quelque chose comme "SI on est dans l'espace public ..." ??) */ 79 108 ) 80 ) { 109 ) 110 /*********************************************************************/ 111 { 81 112 $id_form = $flux['args']['id_form']; 82 113 $champ = $flux['args']['champ']; 83 114 $extra_info = $flux['args']['extra_info']; 84 $vu[$id_form][$type]=array( 115 116 $vu[$id_form][$type] = array( 85 117 'id'=>extraire_attribut($flux['data'],'id'), 86 118 //'name'=>extraire_attribut($flux['data'],'name'), 87 119 'value'=>extraire_attribut($flux['data'],'value'), 88 'syst'=>$extra_info); 89 if (isset($vu[$id_form]['geox']) AND isset($vu[$id_form]['geoy'])){ 120 'syst'=>$extra_info 121 ); 122 123 // SI un champ 'geox' et un champ 'geoy' sont définis ... 124 if ( isset($vu[$id_form]['geox']) AND isset($vu[$id_form]['geoy']) ) 125 { 90 126 include_spip('inc/geoforms'); 91 127 $syst = $vu[$id_form]['geox']['syst']; 92 128 list($x,$y) = geoforms_latitude_longitude($vu[$id_form]['geox']['value'],$vu[$id_form]['geoy']['value'],$syst); 93 if ($geomap_append_moveend_map = charger_fonction('geomap_append_clicable_map','inc',true)){ 129 130 if ($geomap_append_moveend_map = charger_fonction('geomap_append_clicable_map','inc',true)) 131 { 94 132 $id = $vu[$id_form]['geox']['id']."-".$vu[$id_form]['geoy']['id']; 95 $flux['data'].="<div class='geomap ' id='map-$id_form-$id'> </div>";133 $flux['data'].="<div class='geomap geoforms_map' id='map-$id_form-$id'> </div>"; 96 134 $flux['data'].=$geomap_append_moveend_map("map-$id_form-$id",$vu[$id_form]['geox']['id'],$vu[$id_form]['geoy']['id'],$x,$y, NULL,NULL,true); 97 135 unset($vu[$id_form]); 98 136 } 99 137 } 138 100 139 } 140 101 141 return $flux; 102 142 } 103 143 144 /* 145 Pipeline "forms_pre_edition_donnee" : 146 appelé avec la liste des champs et leurs valeurs juste avant leur insertion/maj en base. 147 Permet lajout éventuel de champs saisis et non détectés. 148 */ 104 149 function geoforms_forms_pre_edition_donnee($flux){ 105 150 $geox = $geoy = NULL; … … 119 164 } 120 165 166 /* 167 Pipeline "forms_ajoute_styles" : 168 pipeline pour ajouter des styles à la css (utile pour styler des champs supplémentaires). 169 */ 121 170 function geoforms_forms_ajoute_styles($texte){ 122 171 if ($f=find_in_path('geoforms.css')){ -
_plugins_/forms/geoforms/lang/geoforms_fr.php
r11377 r50140 2 2 3 3 // This is a SPIP language file -- Ceci est un fichier langue de SPIP 4 // langue / language = fr 4 5 5 6 $GLOBALS[$GLOBALS['idx_lang']] = array( 6 'geoloc_x'=>'Geolocalisation-X',7 'geoloc_y'=>'Geolocalisation-Y',8 'geoloc_z'=>'Geolocalisation-Z',9 7 10 'latitude_longitude_geox'=>'Latitude', 11 'latitude_longitude_geoy'=>'Longitude', 12 'latitude_longitude_geoz'=>'Altitude', 8 // C 9 'configuration' => 'GeoForms', 10 'configuration_titre' => 'Configuration du plugin GeoForms', 11 'configuration_warning' => '!!ATTENTION!! : Pour l\'instant, cette interface de configuration NE marche PAS avec SPIP > à 2.1', 12 'configuration_warning2' => '--> Passer plutôt par la page de configuration de "GoogleMap Api" (CFG) pour définir la position par défaut des cartes et la clé API.', 13 14 // G 15 'geoloc_x'=>'Geolocalisation-X', 16 'geoloc_y'=>'Geolocalisation-Y', 17 'geoloc_z'=>'Geolocalisation-Z', 13 18 14 'lambert_geox'=>'X', 15 'lambert_geoy'=>'Y', 16 'lambert_geoz'=>'Altitude', 17 'lambert1' => 'Lambert 1', 18 'lambert2' => 'Lambert 2', 19 'lambert3' => 'Lambert 3', 20 'lambert4' => 'Lambert 4', 21 'lambertgc' => 'Lambert Grand Champ', 22 'lambert93' => 'Lambert 93', 19 // L 20 'latitude_longitude_geox'=>'Latitude', 21 'latitude_longitude_geoy'=>'Longitude', 22 'latitude_longitude_geoz'=>'Altitude', 23 24 'lambert_geox'=>'X', 25 'lambert_geoy'=>'Y', 26 'lambert_geoz'=>'Altitude', 27 'lambert1' => 'Lambert 1', 28 'lambert2' => 'Lambert 2', 29 'lambert3' => 'Lambert 3', 30 'lambert4' => 'Lambert 4', 31 'lambertgc' => 'Lambert Grand Champ', 32 'lambert93' => 'Lambert 93', 33 23 34 ); 24 35 25 26 36 ?> -
_plugins_/forms/geoforms/plugin.xml
r25251 r50140 46 46 <inclure>geoforms_pipeline.php</inclure> 47 47 </pipeline> 48 49 <pipeline> 50 <nom>affichage_final</nom> 51 <action>affichage_final</action> 52 <inclure>geoforms_pipeline.php</inclure> 53 </pipeline> 54 48 55 </plugin>
Note: See TracChangeset
for help on using the changeset viewer.