Changeset 11663 in spip-zone


Ignore:
Timestamp:
Apr 26, 2007, 1:48:53 PM (13 years ago)
Author:
cedric@…
Message:

"fonction manquante"

Location:
_plugins_/_stable_/forms/geoforms
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/_stable_/forms/geoforms/inc/geoforms.php

    r11658 r11663  
    1010 */
    1111
     12
    1213function geoforms_latitude_longitude($x,$y,$systeme){
    1314        if (strlen($systeme)){
     
    1819}
    1920
     21function geoforms_donnee_icone($id_form,$id_donnee){
     22        return url_absolue(find_in_path('img_pack/correxir.png'));
     23}
     24
     25function geoforms_donnee_latitude($id_form,$id_donnee){
     26        $t = geoforms_donnee_latitude_longitude($id_form,$id_donnee);
     27        return reset($t);
     28}
     29function geoforms_donnee_longitude($id_form,$id_donnee){
     30        $t = geoforms_donnee_latitude_longitude($id_form,$id_donnee);
     31        return end($t);
     32}
     33function geoforms_donnee_latitude_longitude($id_form,$id_donnee){
     34        static $buf = array();
     35        if (!isset($buf[$id_donnee])){
     36                $res = spip_query("SELECT c.*,dc.*
     37                FROM spip_forms_champs as c, spip_forms_donnees_champs as dc
     38                WHERE c.type IN ('geox','geoy') AND c.id_form="._q($id_form)." AND dc.champ=c.champ AND dc.id_donnee="._q($id_donnee)." ORDER BY c.rang");
     39                while ($row = spip_fetch_array($res) AND (!isset($buf[$id_donnee]['geox']) OR !isset($buf[$id_donnee]['geoy']))){
     40                        $buf[$id_donnee][$row['type']] = array('value'=>$row['valeur'],'syst'=>$row['extra_info']);
     41                }
     42                list($buf[$id_donnee]['geox'],$buf[$id_donnee]['geoy']) = geoforms_latitude_longitude($buf[$id_donnee]['geox']['value'],$buf[$id_donnee]['geoy']['value'],$buf[$id_donnee]['geox']['syst']);
     43        }
     44        if (!isset($buf[$id_donnee])) return array(0,0);
     45        return array($buf[$id_donnee]['geox'],$buf[$id_donnee]['geoy']);
     46}
     47
    2048?>
  • _plugins_/_stable_/forms/geoforms/plugin.xml

    r11658 r11663  
    1212        <chemin dir='' />
    1313        <fonctions>public/geoforms_balises.php</fonctions>
     14        <options>geoforms_options.php</options>
    1415        <pipeline>
    1516                <nom>forms_types_champs</nom>
  • _plugins_/_stable_/forms/geoforms/public/geoforms_balises.php

    r11658 r11663  
    3636}
    3737
    38 function geoforms_donnee_icone($id_form,$id_donnee){
    39         return url_absolue(find_in_path('img_pack/correxir.png'));
    40 }
    41 
    42 function geoforms_donnee_latitude($id_form,$id_donnee){
    43         $t = geoforms_donnee_latitude_longitude($id_form,$id_donnee);
    44         return reset($t);
    45 }
    46 function geoforms_donnee_longitude($id_form,$id_donnee){
    47         $t = geoforms_donnee_latitude_longitude($id_form,$id_donnee);
    48         return end($t);
    49 }
    50 function geoforms_donnee_latitude_longitude($id_form,$id_donnee){
    51         static $buf = array();
    52         if (!isset($buf[$id_donnee])){
    53                 $res = spip_query("SELECT c.*,dc.*
    54                 FROM spip_forms_champs as c, spip_forms_donnees_champs as dc
    55                 WHERE c.type IN ('geox','geoy') AND c.id_form="._q($id_form)." AND dc.champ=c.champ AND dc.id_donnee="._q($id_donnee)." ORDER BY c.rang");
    56                 while ($row = spip_fetch_array($res) AND (!isset($buf[$id_donnee]['geox']) OR !isset($buf[$id_donnee]['geoy']))){
    57                         $buf[$id_donnee][$row['type']] = array('value'=>$row['valeur'],'syst'=>$row['extra_info']);
    58                 }
    59                 list($buf[$id_donnee]['geox'],$buf[$id_donnee]['geoy']) = geoforms_latitude_longitude($buf[$id_donnee]['geox']['value'],$buf[$id_donnee]['geoy']['value'],$buf[$id_donnee]['geox']['syst']);
    60         }
    61         if (!isset($buf[$id_donnee])) return array(0,0);
    62         return array($buf[$id_donnee]['geox'],$buf[$id_donnee]['geoy']);
    63 }
    64 
    6538?>
Note: See TracChangeset for help on using the changeset viewer.