Changeset 3113
- Timestamp:
- 04/08/12 16:40:04 (11 years ago)
- Location:
- plugins/myGmaps/trunk
- Files:
-
- 4 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/myGmaps/trunk/_admin.php
r2864 r3113 19 19 preg_match('/plugin.php\?p=myGmaps(&.*)?$/',$_SERVER['REQUEST_URI']), 20 20 $core->auth->check('usage,contentadmin',$core->blog->id)); 21 22 $core->addBehavior('adminDashboardFavs',array('myGmapsBehaviors','dashboardFavs')); 23 24 class 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 } 21 39 22 40 $p_url = 'plugin.php?p='.basename(dirname(__FILE__)); … … 33 51 $meta->delPostMeta($post_id,'map'); 34 52 $meta->delPostMeta($post_id,'map_options'); 35 if ( $_GET['post_type'] == 'page') {53 if (isset($_GET['post_type']) && $_GET['post_type'] == 'page') { 36 54 http::redirect('plugin.php?p=pages&act=page&id='.$post_id); 37 55 } else { … … 45 63 try { 46 64 $post_id = $_GET['id']; 65 47 66 $meta =& $GLOBALS['core']->meta; 48 67 $meta->delPostMeta($post_id,'map',(integer) $_GET['remove']); 49 68 50 if ( $_GET['post_type'] == 'page') {69 if (isset($_GET['post_type']) && $_GET['post_type'] == 'page') { 51 70 http::redirect('plugin.php?p=pages&act=page&id='.$post_id); 52 71 } else { … … 66 85 '<script type="text/javascript">'."\n". 67 86 '$(document).ready(function() {'."\n". 87 '$(\'#gmap-area h3\').toggleWithLegend($(\'#post-gmap\'), {'."\n". 88 'cookie: \'dcx_gmap_detail\''."\n". 89 '});'."\n". 68 90 '$(\'a.map-remove\').click(function() {'."\n". 69 91 'msg = \''.__('Are you sure you want to remove this map?').'\';'."\n". … … 94 116 { 95 117 global $core; 118 if (is_null($post)) { 119 return; 120 } 96 121 $id = $post->post_id; 97 122 $type = $post->post_type; … … 101 126 if (!$meta_rs) { 102 127 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>'. 104 132 '<p><a href="plugin.php?p=myGmaps&post_id='.$id.'">'.__('Add a map to entry').'</a></p>'. 105 133 '</fieldset>'; … … 110 138 $maps_options = explode(",",$meta->getMetaStr($post->post_meta,'map_options')); 111 139 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>'; 114 145 if ($meta->getMetaStr($post->post_meta,'map') != '') { 115 146 echo 116 117 118 119 120 121 122 123 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> </th>'. 154 '</tr>'; 124 155 125 156 $params['post_type'] = 'map'; … … 166 197 167 198 } 199 echo 200 '</div>'. 201 '</div>'; 168 202 } 169 203 } -
plugins/myGmaps/trunk/_define.php
r2864 r3113 15 15 /* Description*/ "Create Google Maps objects to include in maps associated to your posts", 16 16 /* Author */ "Philippe aka amalgame", 17 /* Version */ '0.7. 2',17 /* Version */ '0.7.7', 18 18 /* Permissions */ 'usage,contentadmin' 19 19 ); -
plugins/myGmaps/trunk/_install.php
r2864 r3113 26 26 $s =& $core->blog->settings->myGmaps; 27 27 28 $s->put('myGmaps_enabled',false,'boolean','Enable myGmaps plugin',false,true); 28 29 $s->put('myGmaps_center','43.0395797336425, 6.126280043989323','string','Default maps center',false,true); 29 30 $s->put('myGmaps_zoom','12','integer','Default maps zoom level',false,true); -
plugins/myGmaps/trunk/_public.php
r2864 r3113 41 41 public static function publicHeadContent($core,$_ctx) 42 42 { 43 # Settings 44 45 $s =& $core->blog->settings->myGmaps; 46 47 if (!$s->myGmaps_enabled) { 48 return; 49 } 50 43 51 echo 44 52 '<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>'."\n". … … 121 129 '}'."\n". 122 130 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". 123 139 'marker = new google.maps.Marker({'."\n". 124 'icon : "'.$marker[2].'",'."\n".140 'icon : myicon,'."\n". 125 141 'position: new google.maps.LatLng('.$marker[0].','.$marker[1].'),'."\n". 126 142 'title: title_'.$maps->post_id.','."\n". -
plugins/myGmaps/trunk/addmap.php
r2871 r3113 229 229 public function display($page,$nb_per_page,$enclose_block='') 230 230 { 231 231 232 global $core; 232 233 $meta =& $GLOBALS['core']->meta; … … 240 241 if ($my_post_maps !='') { 241 242 $maps_array = explode(",",$my_post_maps); 243 } else { 244 $maps_array = array(); 242 245 } 243 246 … … 423 426 { 424 427 425 echo '<h2>'.html::escapeHTML($core->blog->name).' › '.__('Google Maps').' › '.$page_title.'</h2>';428 echo '<h2>'.html::escapeHTML($core->blog->name).' › <a href="'.$p_url.'&do=list" >'.__('Google Maps').'</a> › <span class="page-title">'.$page_title.'</span></h2>'; 426 429 // 427 430 echo '<div class="multi-part" id="entries-list" title="'.__('Add elements').'">'; -
plugins/myGmaps/trunk/index.php
r2864 r3113 16 16 $edit = 'map'; 17 17 18 } elseif (isset($_GET['add_map_filters']) ) {18 } elseif (isset($_GET['add_map_filters']) && $_REQUEST['do'] != 'list') { 19 19 require_once dirname(__FILE__).'/addmap.php'; 20 20 -
plugins/myGmaps/trunk/js/_map.js
r2827 r3113 111 111 var infowindowIcons = '<div id="infowindow_icons" style="cursor:pointer;">' + 112 112 '<h3>' + icon_msg + '</h3>' + 113 '< img src="index.php?pf=myGmaps/icons/marker-blue.png" alt="" width="20" height="34" /> ' +113 '<p><img src="index.php?pf=myGmaps/icons/marker-blue.png" alt="" width="20" height="34" /> ' + 114 114 '<img src="index.php?pf=myGmaps/icons/marker-green.png" alt="" width="20" height="34" /> ' + 115 115 '<img src="index.php?pf=myGmaps/icons/marker-grey.png" alt="" width="20" height="34" /> ' + … … 118 118 '<img src="index.php?pf=myGmaps/icons/marker-white.png" alt="" width="20" height="34" /> ' + 119 119 '<img src="index.php?pf=myGmaps/icons/marker-yellow.png" alt="" width="20" height="34" /> ' + 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" /> ' + 122 '<img src="index.php?pf=myGmaps/icons/bars.png" alt="" width="32" height="32" /> ' + 123 '<img src="index.php?pf=myGmaps/icons/dining.png" alt="" width="32" height="32" /> ' + 124 '<img src="index.php?pf=myGmaps/icons/port.png" alt="" width="32" height="32" /> ' + 125 '<img src="index.php?pf=myGmaps/icons/restau.png" alt="" width="32" height="32" /> ' + 126 '<img src="index.php?pf=myGmaps/icons/sailing.png" alt="" width="32" height="32" /> ' + 127 '<img src="index.php?pf=myGmaps/icons/star.png" alt="" width="32" height="32" /> ' + 128 '<img src="index.php?pf=myGmaps/icons/sunny.png" alt="" width="32" height="32" /></p>' + 121 129 '</div>'; 122 130 … … 272 280 273 281 //Add markers 274 282 275 283 function addMarker(location) { 276 284 var post_maps = $('#post_maps').val(); -
plugins/myGmaps/trunk/map.php
r2864 r3113 369 369 } 370 370 371 echo '<h2>'.html::escapeHTML($core->blog->name).' › '.__('Google Maps').' › '.$page_title;372 373 echo '</ h2>';371 echo '<h2>'.html::escapeHTML($core->blog->name).' › <a href="'.$p_url.'&do=list" >'.__('Google Maps').'</a> › <span class="page-title">'.$page_title.'</span></h2>'; 372 373 echo '</span></h2>'; 374 374 375 375 if ($post_id) -
plugins/myGmaps/trunk/maps.php
r2864 r3113 299 299 if (!empty($_POST['saveconfig'])) { 300 300 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']); 302 303 $s->put('myGmaps_zoom',$_POST['myGmaps_zoom']); 303 304 $s->put('myGmaps_type',$_POST['myGmaps_type']); … … 352 353 { 353 354 354 echo '<h2>'.html::escapeHTML($core->blog->name).' › '.__('Google Maps').'</h2>';355 echo '<h2>'.html::escapeHTML($core->blog->name).' › <span class="page-title">'.__('Google Maps').'</span></h2>'; 355 356 356 357 // 357 358 echo '<div class="multi-part" id="entries-list" title="'.__('Map elements').'">'; 358 echo '<p ><strong><ahref="'.$p_url.'&do=edit">'.__('New element').'</a></strong></p>';359 echo '<p class="top-add"><strong><a class="button add" href="'.$p_url.'&do=edit">'.__('New element').'</a></strong></p>'; 359 360 if (!$show_filters) { 360 361 echo … … 433 434 echo '<div class="multi-part" id="settings" title="'.__('Settings').'">'. 434 435 '<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>'. 435 441 '<fieldset><legend>'.__('Default map options').'</legend>'. 436 442 '<p>'.__('Choose map center, zoom level and map type.').'</p>'. -
plugins/myGmaps/trunk/maps_actions.php
r2864 r3113 246 246 elseif ($action == 'author' && $core->auth->check('admin',$core->blog->id)) 247 247 { 248 echo '<h2>'.html::escapeHTML($core->blog->name).' › '.__('Google Maps').' › '.__('Change author for map elements').'</h2>';248 echo '<h2>'.html::escapeHTML($core->blog->name).' › <span class="page-title">'.__('Google Maps').' › '.__('Change author for map elements').'</span></h2>'; 249 249 250 250 echo
Note: See TracChangeset
for help on using the changeset viewer.