Dotclear

Changeset 3113


Ignore:
Timestamp:
04/08/12 16:40:04 (11 years ago)
Author:
philippe
Message:

new version

Location:
plugins/myGmaps/trunk
Files:
4 added
11 edited

Legend:

Unmodified
Added
Removed
  • plugins/myGmaps/trunk/_admin.php

    r2864 r3113  
    1919     preg_match('/plugin.php\?p=myGmaps(&.*)?$/',$_SERVER['REQUEST_URI']), 
    2020     $core->auth->check('usage,contentadmin',$core->blog->id)); 
     21      
     22$core->addBehavior('adminDashboardFavs',array('myGmapsBehaviors','dashboardFavs')); 
     23 
     24class myGmapsBehaviors 
     25{ 
     26    public static function dashboardFavs($core,$favs) 
     27    { 
     28        $favs['myGmaps'] = new ArrayObject(array( 
     29            'myGmaps', 
     30            __('Google Maps'), 
     31            'plugin.php?p=myGmaps&do=list', 
     32            'index.php?pf=myGmaps/icon.png', 
     33            'index.php?pf=myGmaps/icon-big.png', 
     34            'usage,contentadmin', 
     35            null, 
     36            null)); 
     37    } 
     38} 
    2139 
    2240$p_url    = 'plugin.php?p='.basename(dirname(__FILE__)); 
     
    3351     $meta->delPostMeta($post_id,'map'); 
    3452     $meta->delPostMeta($post_id,'map_options'); 
    35      if ($_GET['post_type'] == 'page') { 
     53     if (isset($_GET['post_type']) && $_GET['post_type'] == 'page') { 
    3654          http::redirect('plugin.php?p=pages&act=page&id='.$post_id); 
    3755     } else { 
     
    4563     try { 
    4664     $post_id = $_GET['id']; 
     65      
    4766     $meta =& $GLOBALS['core']->meta; 
    4867     $meta->delPostMeta($post_id,'map',(integer) $_GET['remove']); 
    4968      
    50      if ($_GET['post_type'] == 'page') { 
     69     if (isset($_GET['post_type']) && $_GET['post_type'] == 'page') { 
    5170          http::redirect('plugin.php?p=pages&act=page&id='.$post_id); 
    5271     } else { 
     
    6685          '<script type="text/javascript">'."\n". 
    6786          '$(document).ready(function() {'."\n". 
     87               '$(\'#gmap-area h3\').toggleWithLegend($(\'#post-gmap\'), {'."\n". 
     88                    'cookie: \'dcx_gmap_detail\''."\n". 
     89               '});'."\n". 
    6890               '$(\'a.map-remove\').click(function() {'."\n". 
    6991               'msg = \''.__('Are you sure you want to remove this map?').'\';'."\n". 
     
    94116     { 
    95117          global $core; 
     118          if (is_null($post)) { 
     119               return; 
     120          } 
    96121          $id = $post->post_id; 
    97122          $type = $post->post_type; 
     
    101126               if (!$meta_rs) { 
    102127                    echo  
    103                          '<fieldset><legend>'.__('Google Map').'</legend>'. 
     128                         '<div class="area" id="gmap-area">'. 
     129                         '<h3>'.__('Google Map').'</h3>'. 
     130                         '<div id="post-gmap" >'. 
     131                         '<fieldset><legend>'.__('No map').'</legend>'. 
    104132                         '<p><a href="plugin.php?p=myGmaps&amp;post_id='.$id.'">'.__('Add a map to entry').'</a></p>'. 
    105133                         '</fieldset>'; 
     
    110138                    $maps_options = explode(",",$meta->getMetaStr($post->post_meta,'map_options')); 
    111139                     
    112                     echo '<fieldset><legend>'.__('Google Map').'</legend>'. 
    113                     '<h3>'.__('Map elements').'</h3>'; 
     140                    echo  
     141                         '<div class="area" id="gmap-area">'. 
     142                         '<h3>'.__('Google Map').'</h3>'. 
     143                         '<div id="post-gmap" >'. 
     144                         '<fieldset><legend>'.__('This map elements').'</legend>'; 
    114145                    if ($meta->getMetaStr($post->post_meta,'map') != '') { 
    115146                         echo 
    116                               '<table class="clear"><tr>'. 
    117                               '<th>'.__('Title').'</th>'. 
    118                               '<th>'.__('Date').'</th>'. 
    119                               '<th>'.__('Category').'</th>'. 
    120                               '<th>'.__('Author').'</th>'. 
    121                               '<th class="nowrap">'.__('Type').'</th>'. 
    122                               '<th>&nbsp;</th>'. 
    123                               '</tr>'; 
     147                         '<table class="clear"><tr>'. 
     148                         '<th>'.__('Title').'</th>'. 
     149                         '<th>'.__('Date').'</th>'. 
     150                         '<th>'.__('Category').'</th>'. 
     151                         '<th>'.__('Author').'</th>'. 
     152                         '<th class="nowrap">'.__('Type').'</th>'. 
     153                         '<th>&nbsp;</th>'. 
     154                         '</tr>'; 
    124155                          
    125156                         $params['post_type'] = 'map'; 
     
    166197                     
    167198               } 
     199               echo 
     200               '</div>'. 
     201               '</div>'; 
    168202          } 
    169203     } 
  • plugins/myGmaps/trunk/_define.php

    r2864 r3113  
    1515     /* Description*/         "Create Google Maps objects to include in maps associated to your posts", 
    1616     /* Author */             "Philippe aka amalgame", 
    17      /* Version */            '0.7.2', 
     17     /* Version */            '0.7.7', 
    1818     /* Permissions */        'usage,contentadmin' 
    1919); 
  • plugins/myGmaps/trunk/_install.php

    r2864 r3113  
    2626$s =& $core->blog->settings->myGmaps; 
    2727 
     28$s->put('myGmaps_enabled',false,'boolean','Enable myGmaps plugin',false,true); 
    2829$s->put('myGmaps_center','43.0395797336425, 6.126280043989323','string','Default maps center',false,true); 
    2930$s->put('myGmaps_zoom','12','integer','Default maps zoom level',false,true); 
  • plugins/myGmaps/trunk/_public.php

    r2864 r3113  
    4141     public static function publicHeadContent($core,$_ctx) 
    4242     {          
     43               # Settings 
     44 
     45               $s =& $core->blog->settings->myGmaps; 
     46                
     47               if (!$s->myGmaps_enabled) { 
     48                    return; 
     49               } 
     50                
    4351               echo 
    4452               '<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>'."\n". 
     
    121129                                        '}'."\n". 
    122130                                         
     131                                        'var myRegExp = "marker";'."\n". 
     132                                        'var string = "'.$marker[2].'";'."\n". 
     133                                        'var match = string.search(myRegExp);'."\n". 
     134                                        'if(match != -1) {'."\n". 
     135                                             'var myicon = "'.$marker[2].'";'."\n".  
     136                                        '} else {'."\n". 
     137                                             'var myicon = new google.maps.MarkerImage("'.$marker[2].'", null, null, new google.maps.Point(16, 16));'."\n". 
     138                                        '}'."\n". 
    123139                                        'marker = new google.maps.Marker({'."\n". 
    124                                              'icon : "'.$marker[2].'",'."\n". 
     140                                             'icon : myicon,'."\n". 
    125141                                             'position: new google.maps.LatLng('.$marker[0].','.$marker[1].'),'."\n". 
    126142                                             'title: title_'.$maps->post_id.','."\n". 
  • plugins/myGmaps/trunk/addmap.php

    r2871 r3113  
    229229     public function display($page,$nb_per_page,$enclose_block='') 
    230230     { 
     231           
    231232          global $core; 
    232233          $meta =& $GLOBALS['core']->meta; 
     
    240241          if ($my_post_maps !='') { 
    241242               $maps_array = explode(",",$my_post_maps); 
     243          } else { 
     244               $maps_array = array(); 
    242245          } 
    243246           
     
    423426{ 
    424427      
    425      echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.__('Google Maps').' &rsaquo; '.$page_title.'</h2>'; 
     428     echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <a href="'.$p_url.'&amp;do=list" >'.__('Google Maps').'</a> &rsaquo; <span class="page-title">'.$page_title.'</span></h2>'; 
    426429     // 
    427430     echo '<div class="multi-part" id="entries-list" title="'.__('Add elements').'">'; 
  • plugins/myGmaps/trunk/index.php

    r2864 r3113  
    1616     $edit = 'map'; 
    1717      
    18 } elseif (isset($_GET['add_map_filters'])) { 
     18} elseif (isset($_GET['add_map_filters']) && $_REQUEST['do'] != 'list') { 
    1919     require_once dirname(__FILE__).'/addmap.php'; 
    2020      
  • plugins/myGmaps/trunk/js/_map.js

    r2827 r3113  
    111111          var infowindowIcons = '<div id="infowindow_icons" style="cursor:pointer;">' + 
    112112          '<h3>' + icon_msg + '</h3>' + 
    113           '<img src="index.php?pf=myGmaps/icons/marker-blue.png" alt="" width="20" height="34" />&nbsp;' + 
     113          '<p><img src="index.php?pf=myGmaps/icons/marker-blue.png" alt="" width="20" height="34" />&nbsp;' + 
    114114          '<img src="index.php?pf=myGmaps/icons/marker-green.png" alt="" width="20" height="34" />&nbsp;' + 
    115115          '<img src="index.php?pf=myGmaps/icons/marker-grey.png" alt="" width="20" height="34" />&nbsp;' + 
     
    118118          '<img src="index.php?pf=myGmaps/icons/marker-white.png" alt="" width="20" height="34" />&nbsp;' + 
    119119          '<img src="index.php?pf=myGmaps/icons/marker-yellow.png" alt="" width="20" height="34" />&nbsp;' + 
    120           '<img src="index.php?pf=myGmaps/icons/marker.png" alt="" width="20" height="34" />' + 
     120          '<img src="index.php?pf=myGmaps/icons/marker.png" alt="" width="20" height="34" /></p>' + 
     121          '<p><img src="index.php?pf=myGmaps/icons/camping.png" alt="" width="32" height="32" />&nbsp;' + 
     122          '<img src="index.php?pf=myGmaps/icons/bars.png" alt="" width="32" height="32" />&nbsp;' + 
     123          '<img src="index.php?pf=myGmaps/icons/dining.png" alt="" width="32" height="32" />&nbsp;' + 
     124          '<img src="index.php?pf=myGmaps/icons/port.png" alt="" width="32" height="32" />&nbsp;' + 
     125          '<img src="index.php?pf=myGmaps/icons/restau.png" alt="" width="32" height="32" />&nbsp;' + 
     126          '<img src="index.php?pf=myGmaps/icons/sailing.png" alt="" width="32" height="32" />&nbsp;' + 
     127          '<img src="index.php?pf=myGmaps/icons/star.png" alt="" width="32" height="32" />&nbsp;' + 
     128          '<img src="index.php?pf=myGmaps/icons/sunny.png" alt="" width="32" height="32" /></p>' + 
    121129          '</div>'; 
    122130 
     
    272280 
    273281          //Add markers 
    274  
     282           
    275283          function addMarker(location) { 
    276284               var post_maps = $('#post_maps').val(); 
  • plugins/myGmaps/trunk/map.php

    r2864 r3113  
    369369} 
    370370 
    371 echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.__('Google Maps').' &rsaquo; '.$page_title; 
    372  
    373 echo '</h2>'; 
     371echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <a href="'.$p_url.'&amp;do=list" >'.__('Google Maps').'</a> &rsaquo; <span class="page-title">'.$page_title.'</span></h2>'; 
     372 
     373echo '</span></h2>'; 
    374374 
    375375if ($post_id) 
  • plugins/myGmaps/trunk/maps.php

    r2864 r3113  
    299299if (!empty($_POST['saveconfig'])) { 
    300300  try { 
    301     $s->put('myGmaps_center',$_POST['myGmaps_center']); 
     301    $s->put('myGmaps_enabled',$_POST['myGmaps_enabled']); 
     302     $s->put('myGmaps_center',$_POST['myGmaps_center']); 
    302303     $s->put('myGmaps_zoom',$_POST['myGmaps_zoom']);    
    303304     $s->put('myGmaps_type',$_POST['myGmaps_type']); 
     
    352353{ 
    353354      
    354      echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.__('Google Maps').'</h2>'; 
     355     echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.__('Google Maps').'</span></h2>'; 
    355356      
    356357     // 
    357358     echo '<div class="multi-part" id="entries-list" title="'.__('Map elements').'">'; 
    358      echo '<p><strong><a href="'.$p_url.'&amp;do=edit">'.__('New element').'</a></strong></p>'; 
     359     echo '<p class="top-add"><strong><a class="button add" href="'.$p_url.'&amp;do=edit">'.__('New element').'</a></strong></p>'; 
    359360     if (!$show_filters) { 
    360361          echo  
     
    433434     echo '<div class="multi-part" id="settings" title="'.__('Settings').'">'. 
    434435     '<form method="post" action="'.$p_url.'" id="settings-form">'. 
     436     '<fieldset><legend>'.__('Activation').'</legend>'. 
     437          '<p><label class="classic" for="myGmaps_enabled">'. 
     438          form::checkbox('myGmaps_enabled','1',$s->myGmaps_enabled). 
     439          __('Enable extension for this blog').'</label></p>'. 
     440     '</fieldset>'. 
    435441     '<fieldset><legend>'.__('Default map options').'</legend>'. 
    436442     '<p>'.__('Choose map center, zoom level and map type.').'</p>'. 
  • plugins/myGmaps/trunk/maps_actions.php

    r2864 r3113  
    246246elseif ($action == 'author' && $core->auth->check('admin',$core->blog->id)) 
    247247{ 
    248      echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.__('Google Maps').' &rsaquo; '.__('Change author for map elements').'</h2>'; 
     248     echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.__('Google Maps').' &rsaquo; '.__('Change author for map elements').'</span></h2>'; 
    249249      
    250250     echo 
Note: See TracChangeset for help on using the changeset viewer.

Sites map