Changeset 7139 for extensions/GMaps
- Timestamp:
- Oct 9, 2010, 9:55:26 PM (14 years ago)
- Location:
- extensions/GMaps
- Files:
-
- 58 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/GMaps/admin/gmaps_category_maps.tpl
r7132 r7139 28 28 autoOpen:false, 29 29 width:800, 30 height:4 50,30 height:465, 31 31 modal: true, 32 32 dialogClass: 'gcBgTabSheet gcBorder', … … 50 50 $('#iBDAssocMapId').bind('change', changeMapDisplayType); 51 51 $('[name=fBDAssocKmlFile]').bind('change', changeKmlFileSource); 52 $('#iBDAssocIcon').bind('change', changeIcon); 53 $('#iBDAssocMarker').bind('change', changeMarker); 52 54 53 55 loadList(); 56 } 57 58 /** 59 * called when the icon is changed 60 */ 61 var changeIcon = function () 62 { 63 $('#iBDAssocIcon').attr('style', $('#iBDAssocIcon option:selected').attr('style')).blur(); 64 } 65 66 /** 67 * called when the marker is changed 68 */ 69 var changeMarker = function () 70 { 71 $('#iBDAssocMarker').attr('style', $('#iBDAssocMarker option:selected').attr('style')).blur(); 54 72 } 55 73 … … 225 243 $('#iBDAssocKmlFileUrl').val(''); 226 244 $('#iBDAssocIcon').val($('#iBDAssocIcon option:first').val()); 245 $('#iBDAssocMarker').val($('#iBDAssocMarker option:first').val()); 227 246 $('#iBDAssocTitle').val(''); 228 247 } … … 249 268 $('#iBDAssocKmlFileUrl').val(tmp.kmlFileUrl); 250 269 $('#iBDAssocIcon').val(tmp.icon); 270 $('#iBDAssocMarker').val(tmp.marker); 251 271 $('#iBDAssocTitle').val(tmp.title); 252 272 } … … 254 274 changeMapDisplayType(); 255 275 changeKmlFileSource(); 276 changeIcon(); 277 changeMarker(); 256 278 } 257 279 … … 313 335 kmlFileUrl:($('#iBDAssocKmlSelect').attr('checked'))?'':$('#iBDAssocKmlFileUrl').val(), 314 336 icon:$('#iBDAssocIcon').val(), 337 marker:$('#iBDAssocMarker').val(), 315 338 title:$('#iBDAssocTitle').val(), 316 339 } … … 430 453 <select id='iBDAssocCatId'> 431 454 {foreach from=$datas.cats item=cat} 432 <option value='{$cat.id}' >{$cat.name}</option>455 <option value='{$cat.id}' style='padding-left:{$cat.level*12}px;font-size:{$cat.level*-4+130}%;'>{$cat.name}</option> 433 456 {/foreach} 434 457 </select> … … 465 488 <select id='iBDAssocIcon'> 466 489 {foreach from=$datas.icons item=icon} 467 <option class='{$icon.type}' value='{$icon.file}'>{$icon.file}</option>490 <option style='background-image:url(plugins/GMaps/img/{$icon.file});' value='{$icon.file}'></option> 468 491 {/foreach} 469 492 </select> 470 </td> 471 </tr> 493 <p id='iBDKmlIconWarning' class='helps' style="width:520px;padding-right:20px;">{'gmaps_icon_info'|@translate}</p> 494 </td> 495 </tr> 496 497 498 <tr> 499 <td>{'gmaps_map_marker'|@translate}</td> 500 <td> 501 <select id='iBDAssocMarker'> 502 {foreach from=$datas.markers item=marker} 503 <option style='background-image:url(plugins/GMaps/img/{$marker.file});' value='{$marker.file}'></option> 504 {/foreach} 505 </select> 506 </td> 507 </tr> 508 472 509 473 510 <tr> -
extensions/GMaps/gmaps.css
r7132 r7139 56 56 } 57 57 58 #iBDAssocCatId, #iBDAssocMapId {59 font-family:monospace;60 font-size:125%;61 }62 63 58 #iDialogGMapNfo { 64 59 height:18px; … … 78 73 filter:alpha(opacity:55); 79 74 } 75 #iBDAssocIcon, #iBDAssocIcon option { 76 height:34px; 77 background-repeat:no-repeat; 78 background-position:2px 2px; 79 } 80 #iBDAssocIcon { 81 width:75px; 82 padding-left:50px; 83 } 84 #iBDAssocIcon option { 85 width:75px; 86 } 87 88 #iBDAssocMarker, #iBDAssocMarker option { 89 background-position:2px 2px; 90 background-repeat:no-repeat; 91 height:40px; 92 } 93 #iBDAssocMarker { 94 width:60px; 95 padding-left:40px; 96 } 97 #iBDAssocMarker option { 98 width:40px; 99 } -
extensions/GMaps/gmaps_aip.class.inc.php
r7132 r7139 27 27 { 28 28 parent::__construct($prefixeTable, $filelocation); 29 29 30 $this->loadConfig(); 30 31 $this->configForTemplate(); … … 36 37 37 38 $this->tabsheet = new tabsheet(); 38 39 39 40 40 if($this->amdState!='advanced') … … 231 231 $datas=Array( 232 232 'urlRequest' => $this->getAdminLink('ajax'), 233 'cats' => $this->makeCategor iesTree(),233 'cats' => $this->makeCategoryList(), 234 234 'maps' => $this->makeMapsList(), 235 235 'icons' => $this->makeIconsList(), 236 'markers' => $this->makeMarkersList(), 236 237 'kmlFiles' => $this->makeKmlFilesList() 237 238 ); … … 322 323 323 324 324 /** 325 * build the categories tree 326 * @return Array : an array, ready to use in the template 327 */ 328 private function makeCategoriesTree() 325 326 /** 327 * build an ordered category list 328 * returns an array, each item is an array like : 329 * 'id' => the category Id 330 * 'name' => the category name 331 * 'rank' => the category rank (global) 332 * 'level' => the category level 333 * 334 * @return Array : the list 335 */ 336 protected function makeCategoryList() 329 337 { 330 338 $returned=array( 331 339 array( 332 'id' => 0, 333 'name' => '-- '.l10n('gmaps_applyForAllTheGallery').' --' 340 'id' => 0, 341 'name' => l10n('gmaps_applyForAllTheGallery'), 342 'rank' => '0000', 343 'level' => 0, 344 'status' => 'public', 345 'childs' => false 334 346 ) 335 347 ); 336 348 337 $sql="SELECT id, name, global_rank 338 FROM ".CATEGORIES_TABLE." 339 ORDER BY global_rank"; 340 $result = pwg_query($sql); 349 $sql="SELECT DISTINCT pct.id, pct.name, pct.global_rank AS rank 350 FROM ".CATEGORIES_TABLE." pct 351 JOIN ( 352 SELECT DISTINCT pgat.cat_id AS catId FROM ".GROUP_ACCESS_TABLE." pgat 353 UNION DISTINCT 354 SELECT DISTINCT puat.cat_id AS catId FROM ".USER_ACCESS_TABLE." puat 355 ) pat 356 ON (pat.catId = pct.id AND pct.status = 'private') OR (pct.status = 'public') 357 ORDER BY global_rank;"; 358 $result=pwg_query($sql); 341 359 if($result) 342 360 { 343 while ($row =pwg_db_fetch_assoc($result))361 while($row=pwg_db_fetch_assoc($result)) 344 362 { 345 $returned[]=array( 346 'id' => $row['id'], 347 'name' => str_repeat(' ', substr_count($row['global_rank'], '.')).$row['name'] 348 ); 363 $row['level']=1+substr_count($row['rank'], '.'); 364 365 /* rank is in formated without leading zero, giving bad order 366 * 1 367 * 1.10 368 * 1.11 369 * 1.2 370 * 1.3 371 * .... 372 * 373 * this loop cp,vert all sub rank in four 0 format, allowing to order 374 * categories easily 375 * 0001 376 * 0001.0010 377 * 0001.0011 378 * 0001.0002 379 * 0001.0003 380 */ 381 $row['rank']=explode('.', $row['rank']); 382 foreach($row['rank'] as $key=>$rank) 383 { 384 $row['rank'][$key]=str_pad($rank, 4, '0', STR_PAD_LEFT); 385 } 386 $row['rank']=implode('.', $row['rank']); 387 388 $returned[]=$row; 349 389 } 350 390 } 351 391 392 usort($returned, array(&$this, 'compareCat')); 393 352 394 return($returned); 353 } //makeCategoriesTree 395 } 396 397 /** 398 * used for sort comparison 399 * defined as public, but don't use it directly 400 * 401 * this function compare two categorie with their rank value 402 */ 403 public function compareCat($catA, $catB) 404 { 405 if($catA['rank'] == $catB['rank']) 406 { 407 return(0); 408 } 409 return( ($catA['rank'] < $catB['rank'])?-1:1 ); 410 } 354 411 355 412 … … 400 457 { 401 458 $returned[]=array( 402 'type' => (strtolower(substr($file,0,1))=='i')?'img':'other',403 459 'file' => $file 404 460 ); … … 409 465 } //makeIconsList 410 466 467 468 /** 469 * build the markers list 470 * @return Array : an array, ready to use in the template 471 */ 472 private function makeMarkersList() 473 { 474 $returned=array(); 475 476 $directory=scandir(GMAPS_PATH.'img/'); 477 foreach($directory as $file) 478 { 479 $ext=(pathinfo($file, PATHINFO_EXTENSION)); 480 if(preg_match('/^mS(\d\d)_(\d\d)\.png$/i', $file)) 481 { 482 $returned[]=array( 483 'file' => $file 484 ); 485 } 486 } 487 488 return($returned); 489 } //makeIconsList 411 490 412 491 /** -
extensions/GMaps/gmaps_ajax.php
r7132 r7139 206 206 isset($_REQUEST['datas']['kmlFileUrl']) && 207 207 isset($_REQUEST['datas']['icon']) && 208 isset($_REQUEST['datas']['marker']) && 208 209 isset($_REQUEST['datas']['title']) )) 209 210 { … … 664 665 $properties['kmlFileUrl']."', '". 665 666 $properties['icon']."', '". 667 $properties['marker']."', '". 666 668 mysql_escape_string($properties['title'])."');"; 667 669 $result=pwg_query($sql); … … 677 679 $properties['kmlFileUrl']."', kmlFileId='". 678 680 $properties['kmlFileId']."', icon='". 679 $properties['icon']."', title='". 681 $properties['icon']."', marker='". 682 $properties['marker']."', title='". 680 683 mysql_escape_string($properties['title'])."' 681 684 WHERE id='$id';"; … … 705 708 'kmlFileUrl' => '', 706 709 'icon' => '', 710 'marker' => '', 707 711 'title' => '' 708 712 ); 709 713 710 714 $sql="SELECT id, categoryId, mapId, applySubCat, kmlFileId, kmlFileUrl, 711 icon, title715 icon, marker, title 712 716 FROM ".$this->tables['category_maps']." 713 717 WHERE id='$id';"; -
extensions/GMaps/gmaps_install.class.inc.php
r7132 r7139 72 72 `kmlFileUrl` varchar(255) NOT NULL, 73 73 `icon` varchar(255) NOT NULL, 74 `marker` varchar(255) NOT NULL, 74 75 `title` varchar(200) NOT NULL, 75 76 PRIMARY KEY (`id`), -
extensions/GMaps/gmaps_pip.class.inc.php
r7128 r7139 167 167 id:'iGMapsIcon', 168 168 zoomLevel:".$map['zoomLevel'].", 169 marker :true,169 markerImg:'".$map['marker']."', 170 170 mapType:'".$map['mapType']."', 171 171 mapTypeControl:'".$map['mapTypeControl']."', … … 369 369 id:'iGMaps".(($map['displayType']=='IP')?'Icon':$map['id'])."', 370 370 zoomLevel:".$map['zoomLevel'].", 371 marker :true,371 markerImg:'".$map['marker']."', 372 372 mapType:'".$map['mapType']."', 373 373 mapTypeControl:'".$map['mapTypeControl']."', -
extensions/GMaps/gmaps_root.class.inc.php
r7132 r7139 204 204 $sql="SELECT DISTINCT pgcm.id, pgcm.categoryId, 205 205 pgcm.imgSort, pgcm.applySubCat, pgcm.kmlFileUrl, pgcm.kmlFileId, pgkf.file AS kmlFileUrlId, 206 pgcm.icon, pgcm.title, 206 pgcm.icon, pgcm.title, pgcm.marker, 207 207 pgmm.displayType, pgmm.sizeMode, 208 208 pgmm.width, pgmm.height, pgmm.zoomLevel, -
extensions/GMaps/js/gmapsCategory.js
r7128 r7139 1 1 2 2 var currentMapLoad; 3 var markerImgProp = [ 4 null, 5 { w:32, h:32, x:15, y:31 }, // s01 6 { w:32, h:32, x:15, y:31 }, // s02 7 { w:32, h:32, x:10, y:31 }, // s03 8 { w:30, h:40, x:4, y:39 }, // s04 9 ]; 10 11 3 12 4 13 /** … … 39 48 { 40 49 kmlFile=null; 50 } 51 52 re=/^mS(\d\d)_.*/i; 53 iM=re.exec(properties.markerImg); 54 if(iM!=null) iM=new Number(iM[1]); 55 56 if(iM!=null) 57 { 58 map.markerImg = new google.maps.MarkerImage('plugins/GMaps/img/'+properties.markerImg, 59 new google.maps.Size(markerImgProp[iM].w, markerImgProp[iM].h), 60 new google.maps.Point(0,0), 61 new google.maps.Point(markerImgProp[iM].x, markerImgProp[iM].y)); 62 } 63 else 64 { 65 map.markerImg = null; 41 66 } 42 67 … … 149 174 ); 150 175 176 if(map.markerImg!=null) marker.setIcon(map.markerImg); 177 151 178 marker.info=markers[i]; 152 179 marker.info.displayed=0; -
extensions/GMaps/js/gmapsPicture.js
r7125 r7139 4 4 meta:false 5 5 }; 6 var markerImgProp = [ 7 null, 8 { w:32, h:32, x:15, y:31 }, // s01 9 { w:32, h:32, x:15, y:31 }, // s02 10 { w:32, h:32, x:10, y:31 }, // s03 11 { w:30, h:40, x:4, y:39 }, // s04 12 ]; 13 6 14 7 15 function applyMap(properties) … … 26 34 ); 27 35 28 if(properties.marker) 29 { 30 var marker = new google.maps.Marker( 31 { 32 position:latlng, 33 map: map, 34 title:properties.markerTitle 35 } 36 ); 37 } 36 37 var marker = new google.maps.Marker( 38 { 39 position:latlng, 40 map: map, 41 title:properties.markerTitle 42 } 43 ); 44 45 46 re=/^mS(\d\d)_.*/i; 47 iM=re.exec(properties.markerImg); 48 if(iM!=null) iM=new Number(iM[1]); 49 50 if(iM!=null) 51 { 52 var markerImg = new google.maps.MarkerImage('plugins/GMaps/img/'+properties.markerImg, 53 new google.maps.Size(markerImgProp[iM].w, markerImgProp[iM].h), 54 new google.maps.Point(0,0), 55 new google.maps.Point(markerImgProp[iM].x, markerImgProp[iM].y)); 56 marker.setIcon(markerImg); 57 } 58 59 60 61 38 62 39 63 if(properties.kmlFileUrl!='') -
extensions/GMaps/language/fr_FR/plugin.lang.php
r7132 r7139 156 156 $lang['gmaps_kml_file_none']="Aucun"; 157 157 158 $lang['gmaps_kml_file_access']="Les fichiers KML/KMZ doivent, pour pouvoir être affichés sur une carte, être accessibles par les serveurs de Google"; 158 $lang['gmaps_kml_file_access']="Les fichiers KML/KMZ doivent, pour pouvoir être affichés sur une carte, être accessibles par les serveurs de Google."; 159 $lang['gmaps_icon_info']="Si le thème dispose d'une icône aux mêmes dimensions que celle sélectionnée, elle sera appliquée en priorité."; 159 160 161 $lang['gmaps_map_marker']="Aspect du marqueur"; 160 162 161 163 ?>
Note: See TracChangeset
for help on using the changeset viewer.