Dotclear

Changeset 2850


Ignore:
Timestamp:
01/10/11 18:29:56 (13 years ago)
Author:
philippe
Message:

myGmaps : corrected minor bug in map insertion interface

Location:
plugins/myGmaps
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • plugins/myGmaps/_define.php

    r2849 r2850  
    1515     /* Description*/         "Create Google Maps objects to include in maps associated to your posts", 
    1616     /* Author */             "Philippe aka amalgame", 
    17      /* Version */            '0.7', 
     17     /* Version */            '0.7.1', 
    1818     /* Permissions */        'usage,contentadmin' 
    1919); 
  • plugins/myGmaps/addmap.php

    r2849 r2850  
    372372} elseif (isset($_POST['updmap'])) { 
    373373  try { 
    374      
     374    $entries = $_POST['entries']; 
    375375     $post_id = $_POST['post_id']; 
    376376     $myGmaps_center = $_POST['myGmaps_center_upd']; 
     
    379379     $meta =& $GLOBALS['core']->meta; 
    380380      
     381     $meta->delPostMeta($post_id,'map'); 
    381382     $meta->delPostMeta($post_id,'map_options'); 
    382383      
     384     $entries = implode(',',$entries); 
     385     foreach ($meta->splitMetaValues($entries) as $tag) { 
     386          $meta->setPostMeta($post_id,'map',$tag); 
     387     } 
    383388     $map_options = $myGmaps_center.','.$myGmaps_zoom.','.$myGmaps_type; 
    384389     $meta->setPostMeta($post_id,'map_options',$map_options); 
     
    538543     '<input type="hidden" name="myGmaps_type_upd" id="myGmaps_type_upd" value="'.$myGmaps_type.'" /></p>'. 
    539544     $core->formNonce(); 
    540       
     545     if (isset($maps_array)) { 
     546          for ($i = 0; $i < sizeof($maps_array); ++$i) { 
     547               echo '<p style="display:none">'.form::checkbox(array('entries[]'),$maps_array[$i],'true','','','').'</p>'; 
     548          } 
     549     } 
    541550     echo '<p>'.form::hidden('post_id',$post_id).form::hidden('post_type',$post_type).'<input type="submit" value="'.__('Save').'" name="updmap" /></p>'; 
    542551      
  • plugins/myGmaps/js/_addmap_map.js

    r2814 r2850  
    108108               var default_zoom = map.getZoom(); 
    109109               var default_type = map.getMapTypeId(); 
     110               $('#form-entries :checkbox').each(function() { 
     111                    if ($(this).attr("checked")) { 
     112                         $('<p style="display:none"><input type="checkbox" name="entries[]" value="'+$(this).val()+'" checked="checked" /></p>').insertAfter("#map_canvas"); 
     113                    } 
     114               }); 
    110115                
    111116               $('input[name=myGmaps_center]').attr('value',default_location); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map