Commit 2251186adcbbf5513be3902b8111e86d29fb9ca7

Authored by Edmar Moretti
1 parent 94a815f5

Padronização da interface das ferramentas que fazem upload de arquivos (shp, kml, etc)

classesphp/funcoes_gerais.php
@@ -2426,278 +2426,144 @@ function getRGBpallete($rule, $value) @@ -2426,278 +2426,144 @@ function getRGBpallete($rule, $value)
2426 ); 2426 );
2427 } 2427 }
2428 2428
2429 -// TODO verificar ao fechar versao  
2430 -function seems_utf8($Str)  
2431 -{ // by bmorel at ssi dot fr 2429 +function fg_seems_utf8($Str) { # by bmorel at ssi dot fr
2432 $length = strlen($Str); 2430 $length = strlen($Str);
2433 - for ($i = 0; $i < $length; $i ++) {  
2434 - if (ord($Str[$i]) < 0x80)  
2435 - continue; // 0bbbbbbb  
2436 - elseif ((ord($Str[$i]) & 0xE0) == 0xC0)  
2437 - $n = 1; // 110bbbbb  
2438 - elseif ((ord($Str[$i]) & 0xF0) == 0xE0)  
2439 - $n = 2; // 1110bbbb  
2440 - elseif ((ord($Str[$i]) & 0xF8) == 0xF0)  
2441 - $n = 3; // 11110bbb  
2442 - elseif ((ord($Str[$i]) & 0xFC) == 0xF8)  
2443 - $n = 4; // 111110bb  
2444 - elseif ((ord($Str[$i]) & 0xFE) == 0xFC)  
2445 - $n = 5; // 1111110b  
2446 - else  
2447 - return false; // Does not match any model  
2448 - for ($j = 0; $j < $n; $j ++) { // n bytes matching 10bbbbbb follow ?  
2449 - if ((++ $i == $length) || ((ord($Str[$i]) & 0xC0) != 0x80)) 2431 + for ($i = 0; $i < $length; $i++) {
  2432 + if (ord($Str[$i]) < 0x80) continue; # 0bbbbbbb
  2433 + elseif ((ord($Str[$i]) & 0xE0) == 0xC0) $n = 1; # 110bbbbb
  2434 + elseif ((ord($Str[$i]) & 0xF0) == 0xE0) $n = 2; # 1110bbbb
  2435 + elseif ((ord($Str[$i]) & 0xF8) == 0xF0) $n = 3; # 11110bbb
  2436 + elseif ((ord($Str[$i]) & 0xFC) == 0xF8) $n = 4; # 111110bb
  2437 + elseif ((ord($Str[$i]) & 0xFE) == 0xFC) $n = 5; # 1111110b
  2438 + else return false; # Does not match any model
  2439 + for ($j = 0; $j < $n; $j++) { # n bytes matching 10bbbbbb follow ?
  2440 + if ((++$i == $length) || ((ord($Str[$i]) & 0xC0) != 0x80))
2450 return false; 2441 return false;
2451 } 2442 }
2452 } 2443 }
2453 return true; 2444 return true;
2454 } 2445 }
2455 -  
2456 -/**  
2457 - * TODO Verificar ao fechar versao - verificar a acentuacao das palavras nessa funcao  
2458 - */  
2459 -function removeAcentos($s)  
2460 -{  
2461 - $s = ereg_replace("[&aacute;�&acirc;&atilde;]", "a", $s);  
2462 - $s = ereg_replace("[&Aacute;�&Acirc;&Atilde;]", "A", $s);  
2463 - $s = ereg_replace("[&eacute;�&ecirc;]", "e", $s);  
2464 - $s = ereg_replace("[&iacute;]", "i", $s);  
2465 - $s = ereg_replace("[&Iacute;]", "I", $s);  
2466 - $s = ereg_replace("[&Eacute;�&Ecirc;]", "E", $s);  
2467 - $s = ereg_replace("[��&ocirc;&otilde;]", "o", $s);  
2468 - $s = ereg_replace("[��&Ocirc;&Otilde;]", "O", $s);  
2469 - $s = ereg_replace("[&uacute;��]", "u", $s);  
2470 - $s = ereg_replace("[&Uacute;��]", "U", $s);  
2471 - $s = str_replace("&ccedil;", "c", $s);  
2472 - $s = str_replace("&Ccedil;", "C", $s);  
2473 - // $str = htmlentities($s);  
2474 - $str = preg_replace("/(&)([a-z])([a-z]+;)/i", '$2', $s);  
2475 - $str = preg_replace("/[^A-Z0-9]/i", ' ', $str);  
2476 - $string = preg_replace("/\s+/i", ' ', $str);  
2477 -  
2478 - if (! preg_match('/[\x80-\xff]/', $string)) { 2446 +function removeAcentos($string){
  2447 + if (!preg_match('/[\x80-\xff]/', $string)){
2479 return $string; 2448 return $string;
2480 } 2449 }
2481 - if ($seems_utf8($string)) { 2450 + if (fg_seems_utf8($string)) {
2482 $chars = array( 2451 $chars = array(
2483 // Decompositions for Latin-1 Supplement 2452 // Decompositions for Latin-1 Supplement
2484 - chr(195) . chr(128) => 'A',  
2485 - chr(195) . chr(129) => 'A',  
2486 - chr(195) . chr(130) => 'A',  
2487 - chr(195) . chr(131) => 'A',  
2488 - chr(195) . chr(132) => 'A',  
2489 - chr(195) . chr(133) => 'A',  
2490 - chr(195) . chr(135) => 'C',  
2491 - chr(195) . chr(136) => 'E',  
2492 - chr(195) . chr(137) => 'E',  
2493 - chr(195) . chr(138) => 'E',  
2494 - chr(195) . chr(139) => 'E',  
2495 - chr(195) . chr(140) => 'I',  
2496 - chr(195) . chr(141) => 'I',  
2497 - chr(195) . chr(142) => 'I',  
2498 - chr(195) . chr(143) => 'I',  
2499 - chr(195) . chr(145) => 'N',  
2500 - chr(195) . chr(146) => 'O',  
2501 - chr(195) . chr(147) => 'O',  
2502 - chr(195) . chr(148) => 'O',  
2503 - chr(195) . chr(149) => 'O',  
2504 - chr(195) . chr(150) => 'O',  
2505 - chr(195) . chr(153) => 'U',  
2506 - chr(195) . chr(154) => 'U',  
2507 - chr(195) . chr(155) => 'U',  
2508 - chr(195) . chr(156) => 'U',  
2509 - chr(195) . chr(157) => 'Y',  
2510 - chr(195) . chr(159) => 's',  
2511 - chr(195) . chr(160) => 'a',  
2512 - chr(195) . chr(161) => 'a',  
2513 - chr(195) . chr(162) => 'a',  
2514 - chr(195) . chr(163) => 'a',  
2515 - chr(195) . chr(164) => 'a',  
2516 - chr(195) . chr(165) => 'a',  
2517 - chr(195) . chr(167) => 'c',  
2518 - chr(195) . chr(168) => 'e',  
2519 - chr(195) . chr(169) => 'e',  
2520 - chr(195) . chr(170) => 'e',  
2521 - chr(195) . chr(171) => 'e',  
2522 - chr(195) . chr(172) => 'i',  
2523 - chr(195) . chr(173) => 'i',  
2524 - chr(195) . chr(174) => 'i',  
2525 - chr(195) . chr(175) => 'i',  
2526 - chr(195) . chr(177) => 'n',  
2527 - chr(195) . chr(178) => 'o',  
2528 - chr(195) . chr(179) => 'o',  
2529 - chr(195) . chr(180) => 'o',  
2530 - chr(195) . chr(181) => 'o',  
2531 - chr(195) . chr(182) => 'o',  
2532 - chr(195) . chr(182) => 'o',  
2533 - chr(195) . chr(185) => 'u',  
2534 - chr(195) . chr(186) => 'u',  
2535 - chr(195) . chr(187) => 'u',  
2536 - chr(195) . chr(188) => 'u',  
2537 - chr(195) . chr(189) => 'y',  
2538 - chr(195) . chr(191) => 'y', 2453 + chr(195).chr(128) => 'A', chr(195).chr(129) => 'A',
  2454 + chr(195).chr(130) => 'A', chr(195).chr(131) => 'A',
  2455 + chr(195).chr(132) => 'A', chr(195).chr(133) => 'A',
  2456 + chr(195).chr(135) => 'C', chr(195).chr(136) => 'E',
  2457 + chr(195).chr(137) => 'E', chr(195).chr(138) => 'E',
  2458 + chr(195).chr(139) => 'E', chr(195).chr(140) => 'I',
  2459 + chr(195).chr(141) => 'I', chr(195).chr(142) => 'I',
  2460 + chr(195).chr(143) => 'I', chr(195).chr(145) => 'N',
  2461 + chr(195).chr(146) => 'O', chr(195).chr(147) => 'O',
  2462 + chr(195).chr(148) => 'O', chr(195).chr(149) => 'O',
  2463 + chr(195).chr(150) => 'O', chr(195).chr(153) => 'U',
  2464 + chr(195).chr(154) => 'U', chr(195).chr(155) => 'U',
  2465 + chr(195).chr(156) => 'U', chr(195).chr(157) => 'Y',
  2466 + chr(195).chr(159) => 's', chr(195).chr(160) => 'a',
  2467 + chr(195).chr(161) => 'a', chr(195).chr(162) => 'a',
  2468 + chr(195).chr(163) => 'a', chr(195).chr(164) => 'a',
  2469 + chr(195).chr(165) => 'a', chr(195).chr(167) => 'c',
  2470 + chr(195).chr(168) => 'e', chr(195).chr(169) => 'e',
  2471 + chr(195).chr(170) => 'e', chr(195).chr(171) => 'e',
  2472 + chr(195).chr(172) => 'i', chr(195).chr(173) => 'i',
  2473 + chr(195).chr(174) => 'i', chr(195).chr(175) => 'i',
  2474 + chr(195).chr(177) => 'n', chr(195).chr(178) => 'o',
  2475 + chr(195).chr(179) => 'o', chr(195).chr(180) => 'o',
  2476 + chr(195).chr(181) => 'o', chr(195).chr(182) => 'o',
  2477 + chr(195).chr(182) => 'o', chr(195).chr(185) => 'u',
  2478 + chr(195).chr(186) => 'u', chr(195).chr(187) => 'u',
  2479 + chr(195).chr(188) => 'u', chr(195).chr(189) => 'y',
  2480 + chr(195).chr(191) => 'y',
2539 // Decompositions for Latin Extended-A 2481 // Decompositions for Latin Extended-A
2540 - chr(196) . chr(128) => 'A',  
2541 - chr(196) . chr(129) => 'a',  
2542 - chr(196) . chr(130) => 'A',  
2543 - chr(196) . chr(131) => 'a',  
2544 - chr(196) . chr(132) => 'A',  
2545 - chr(196) . chr(133) => 'a',  
2546 - chr(196) . chr(134) => 'C',  
2547 - chr(196) . chr(135) => 'c',  
2548 - chr(196) . chr(136) => 'C',  
2549 - chr(196) . chr(137) => 'c',  
2550 - chr(196) . chr(138) => 'C',  
2551 - chr(196) . chr(139) => 'c',  
2552 - chr(196) . chr(140) => 'C',  
2553 - chr(196) . chr(141) => 'c',  
2554 - chr(196) . chr(142) => 'D',  
2555 - chr(196) . chr(143) => 'd',  
2556 - chr(196) . chr(144) => 'D',  
2557 - chr(196) . chr(145) => 'd',  
2558 - chr(196) . chr(146) => 'E',  
2559 - chr(196) . chr(147) => 'e',  
2560 - chr(196) . chr(148) => 'E',  
2561 - chr(196) . chr(149) => 'e',  
2562 - chr(196) . chr(150) => 'E',  
2563 - chr(196) . chr(151) => 'e',  
2564 - chr(196) . chr(152) => 'E',  
2565 - chr(196) . chr(153) => 'e',  
2566 - chr(196) . chr(154) => 'E',  
2567 - chr(196) . chr(155) => 'e',  
2568 - chr(196) . chr(156) => 'G',  
2569 - chr(196) . chr(157) => 'g',  
2570 - chr(196) . chr(158) => 'G',  
2571 - chr(196) . chr(159) => 'g',  
2572 - chr(196) . chr(160) => 'G',  
2573 - chr(196) . chr(161) => 'g',  
2574 - chr(196) . chr(162) => 'G',  
2575 - chr(196) . chr(163) => 'g',  
2576 - chr(196) . chr(164) => 'H',  
2577 - chr(196) . chr(165) => 'h',  
2578 - chr(196) . chr(166) => 'H',  
2579 - chr(196) . chr(167) => 'h',  
2580 - chr(196) . chr(168) => 'I',  
2581 - chr(196) . chr(169) => 'i',  
2582 - chr(196) . chr(170) => 'I',  
2583 - chr(196) . chr(171) => 'i',  
2584 - chr(196) . chr(172) => 'I',  
2585 - chr(196) . chr(173) => 'i',  
2586 - chr(196) . chr(174) => 'I',  
2587 - chr(196) . chr(175) => 'i',  
2588 - chr(196) . chr(176) => 'I',  
2589 - chr(196) . chr(177) => 'i',  
2590 - chr(196) . chr(178) => 'IJ',  
2591 - chr(196) . chr(179) => 'ij',  
2592 - chr(196) . chr(180) => 'J',  
2593 - chr(196) . chr(181) => 'j',  
2594 - chr(196) . chr(182) => 'K',  
2595 - chr(196) . chr(183) => 'k',  
2596 - chr(196) . chr(184) => 'k',  
2597 - chr(196) . chr(185) => 'L',  
2598 - chr(196) . chr(186) => 'l',  
2599 - chr(196) . chr(187) => 'L',  
2600 - chr(196) . chr(188) => 'l',  
2601 - chr(196) . chr(189) => 'L',  
2602 - chr(196) . chr(190) => 'l',  
2603 - chr(196) . chr(191) => 'L',  
2604 - chr(197) . chr(128) => 'l',  
2605 - chr(197) . chr(129) => 'L',  
2606 - chr(197) . chr(130) => 'l',  
2607 - chr(197) . chr(131) => 'N',  
2608 - chr(197) . chr(132) => 'n',  
2609 - chr(197) . chr(133) => 'N',  
2610 - chr(197) . chr(134) => 'n',  
2611 - chr(197) . chr(135) => 'N',  
2612 - chr(197) . chr(136) => 'n',  
2613 - chr(197) . chr(137) => 'N',  
2614 - chr(197) . chr(138) => 'n',  
2615 - chr(197) . chr(139) => 'N',  
2616 - chr(197) . chr(140) => 'O',  
2617 - chr(197) . chr(141) => 'o',  
2618 - chr(197) . chr(142) => 'O',  
2619 - chr(197) . chr(143) => 'o',  
2620 - chr(197) . chr(144) => 'O',  
2621 - chr(197) . chr(145) => 'o',  
2622 - chr(197) . chr(146) => 'OE',  
2623 - chr(197) . chr(147) => 'oe',  
2624 - chr(197) . chr(148) => 'R',  
2625 - chr(197) . chr(149) => 'r',  
2626 - chr(197) . chr(150) => 'R',  
2627 - chr(197) . chr(151) => 'r',  
2628 - chr(197) . chr(152) => 'R',  
2629 - chr(197) . chr(153) => 'r',  
2630 - chr(197) . chr(154) => 'S',  
2631 - chr(197) . chr(155) => 's',  
2632 - chr(197) . chr(156) => 'S',  
2633 - chr(197) . chr(157) => 's',  
2634 - chr(197) . chr(158) => 'S',  
2635 - chr(197) . chr(159) => 's',  
2636 - chr(197) . chr(160) => 'S',  
2637 - chr(197) . chr(161) => 's',  
2638 - chr(197) . chr(162) => 'T',  
2639 - chr(197) . chr(163) => 't',  
2640 - chr(197) . chr(164) => 'T',  
2641 - chr(197) . chr(165) => 't',  
2642 - chr(197) . chr(166) => 'T',  
2643 - chr(197) . chr(167) => 't',  
2644 - chr(197) . chr(168) => 'U',  
2645 - chr(197) . chr(169) => 'u',  
2646 - chr(197) . chr(170) => 'U',  
2647 - chr(197) . chr(171) => 'u',  
2648 - chr(197) . chr(172) => 'U',  
2649 - chr(197) . chr(173) => 'u',  
2650 - chr(197) . chr(174) => 'U',  
2651 - chr(197) . chr(175) => 'u',  
2652 - chr(197) . chr(176) => 'U',  
2653 - chr(197) . chr(177) => 'u',  
2654 - chr(197) . chr(178) => 'U',  
2655 - chr(197) . chr(179) => 'u',  
2656 - chr(197) . chr(180) => 'W',  
2657 - chr(197) . chr(181) => 'w',  
2658 - chr(197) . chr(182) => 'Y',  
2659 - chr(197) . chr(183) => 'y',  
2660 - chr(197) . chr(184) => 'Y',  
2661 - chr(197) . chr(185) => 'Z',  
2662 - chr(197) . chr(186) => 'z',  
2663 - chr(197) . chr(187) => 'Z',  
2664 - chr(197) . chr(188) => 'z',  
2665 - chr(197) . chr(189) => 'Z',  
2666 - chr(197) . chr(190) => 'z',  
2667 - chr(197) . chr(191) => 's', 2482 + chr(196).chr(128) => 'A', chr(196).chr(129) => 'a',
  2483 + chr(196).chr(130) => 'A', chr(196).chr(131) => 'a',
  2484 + chr(196).chr(132) => 'A', chr(196).chr(133) => 'a',
  2485 + chr(196).chr(134) => 'C', chr(196).chr(135) => 'c',
  2486 + chr(196).chr(136) => 'C', chr(196).chr(137) => 'c',
  2487 + chr(196).chr(138) => 'C', chr(196).chr(139) => 'c',
  2488 + chr(196).chr(140) => 'C', chr(196).chr(141) => 'c',
  2489 + chr(196).chr(142) => 'D', chr(196).chr(143) => 'd',
  2490 + chr(196).chr(144) => 'D', chr(196).chr(145) => 'd',
  2491 + chr(196).chr(146) => 'E', chr(196).chr(147) => 'e',
  2492 + chr(196).chr(148) => 'E', chr(196).chr(149) => 'e',
  2493 + chr(196).chr(150) => 'E', chr(196).chr(151) => 'e',
  2494 + chr(196).chr(152) => 'E', chr(196).chr(153) => 'e',
  2495 + chr(196).chr(154) => 'E', chr(196).chr(155) => 'e',
  2496 + chr(196).chr(156) => 'G', chr(196).chr(157) => 'g',
  2497 + chr(196).chr(158) => 'G', chr(196).chr(159) => 'g',
  2498 + chr(196).chr(160) => 'G', chr(196).chr(161) => 'g',
  2499 + chr(196).chr(162) => 'G', chr(196).chr(163) => 'g',
  2500 + chr(196).chr(164) => 'H', chr(196).chr(165) => 'h',
  2501 + chr(196).chr(166) => 'H', chr(196).chr(167) => 'h',
  2502 + chr(196).chr(168) => 'I', chr(196).chr(169) => 'i',
  2503 + chr(196).chr(170) => 'I', chr(196).chr(171) => 'i',
  2504 + chr(196).chr(172) => 'I', chr(196).chr(173) => 'i',
  2505 + chr(196).chr(174) => 'I', chr(196).chr(175) => 'i',
  2506 + chr(196).chr(176) => 'I', chr(196).chr(177) => 'i',
  2507 + chr(196).chr(178) => 'IJ',chr(196).chr(179) => 'ij',
  2508 + chr(196).chr(180) => 'J', chr(196).chr(181) => 'j',
  2509 + chr(196).chr(182) => 'K', chr(196).chr(183) => 'k',
  2510 + chr(196).chr(184) => 'k', chr(196).chr(185) => 'L',
  2511 + chr(196).chr(186) => 'l', chr(196).chr(187) => 'L',
  2512 + chr(196).chr(188) => 'l', chr(196).chr(189) => 'L',
  2513 + chr(196).chr(190) => 'l', chr(196).chr(191) => 'L',
  2514 + chr(197).chr(128) => 'l', chr(197).chr(129) => 'L',
  2515 + chr(197).chr(130) => 'l', chr(197).chr(131) => 'N',
  2516 + chr(197).chr(132) => 'n', chr(197).chr(133) => 'N',
  2517 + chr(197).chr(134) => 'n', chr(197).chr(135) => 'N',
  2518 + chr(197).chr(136) => 'n', chr(197).chr(137) => 'N',
  2519 + chr(197).chr(138) => 'n', chr(197).chr(139) => 'N',
  2520 + chr(197).chr(140) => 'O', chr(197).chr(141) => 'o',
  2521 + chr(197).chr(142) => 'O', chr(197).chr(143) => 'o',
  2522 + chr(197).chr(144) => 'O', chr(197).chr(145) => 'o',
  2523 + chr(197).chr(146) => 'OE',chr(197).chr(147) => 'oe',
  2524 + chr(197).chr(148) => 'R',chr(197).chr(149) => 'r',
  2525 + chr(197).chr(150) => 'R',chr(197).chr(151) => 'r',
  2526 + chr(197).chr(152) => 'R',chr(197).chr(153) => 'r',
  2527 + chr(197).chr(154) => 'S',chr(197).chr(155) => 's',
  2528 + chr(197).chr(156) => 'S',chr(197).chr(157) => 's',
  2529 + chr(197).chr(158) => 'S',chr(197).chr(159) => 's',
  2530 + chr(197).chr(160) => 'S', chr(197).chr(161) => 's',
  2531 + chr(197).chr(162) => 'T', chr(197).chr(163) => 't',
  2532 + chr(197).chr(164) => 'T', chr(197).chr(165) => 't',
  2533 + chr(197).chr(166) => 'T', chr(197).chr(167) => 't',
  2534 + chr(197).chr(168) => 'U', chr(197).chr(169) => 'u',
  2535 + chr(197).chr(170) => 'U', chr(197).chr(171) => 'u',
  2536 + chr(197).chr(172) => 'U', chr(197).chr(173) => 'u',
  2537 + chr(197).chr(174) => 'U', chr(197).chr(175) => 'u',
  2538 + chr(197).chr(176) => 'U', chr(197).chr(177) => 'u',
  2539 + chr(197).chr(178) => 'U', chr(197).chr(179) => 'u',
  2540 + chr(197).chr(180) => 'W', chr(197).chr(181) => 'w',
  2541 + chr(197).chr(182) => 'Y', chr(197).chr(183) => 'y',
  2542 + chr(197).chr(184) => 'Y', chr(197).chr(185) => 'Z',
  2543 + chr(197).chr(186) => 'z', chr(197).chr(187) => 'Z',
  2544 + chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z',
  2545 + chr(197).chr(190) => 'z', chr(197).chr(191) => 's',
2668 // Euro Sign 2546 // Euro Sign
2669 - chr(226) . chr(130) . chr(172) => 'E', 2547 + chr(226).chr(130).chr(172) => 'E',
2670 // GBP (Pound) Sign 2548 // GBP (Pound) Sign
2671 - chr(194) . chr(163) => ''  
2672 - ); 2549 + chr(194).chr(163) => '');
2673 $string = strtr($string, $chars); 2550 $string = strtr($string, $chars);
2674 } else { 2551 } else {
2675 // Assume ISO-8859-1 if not UTF-8 2552 // Assume ISO-8859-1 if not UTF-8
2676 - $chars['in'] = chr(128) . chr(131) . chr(138) . chr(142) . chr(154) . chr(158) . chr(159) . chr(162) . chr(165) . chr(181) . chr(192) . chr(193) . chr(194) . chr(195) . chr(196) . chr(197) . chr(199) . chr(200) . chr(201) . chr(202) . chr(203) . chr(204) . chr(205) . chr(206) . chr(207) . chr(209) . chr(210) . chr(211) . chr(212) . chr(213) . chr(214) . chr(216) . chr(217) . chr(218) . chr(219) . chr(220) . chr(221) . chr(224) . chr(225) . chr(226) . chr(227) . chr(228) . chr(229) . chr(231) . chr(232) . chr(233) . chr(234) . chr(235) . chr(236) . chr(237) . chr(238) . chr(239) . chr(241) . chr(242) . chr(243) . chr(244) . chr(245) . chr(246) . chr(248) . chr(249) . chr(250) . chr(251) . chr(252) . chr(253) . chr(255); 2553 + $chars['in'] = chr(128).chr(131).chr(138).chr(142).chr(154).chr(158)
  2554 + .chr(159).chr(162).chr(165).chr(181).chr(192).chr(193).chr(194)
  2555 + .chr(195).chr(196).chr(197).chr(199).chr(200).chr(201).chr(202)
  2556 + .chr(203).chr(204).chr(205).chr(206).chr(207).chr(209).chr(210)
  2557 + .chr(211).chr(212).chr(213).chr(214).chr(216).chr(217).chr(218)
  2558 + .chr(219).chr(220).chr(221).chr(224).chr(225).chr(226).chr(227)
  2559 + .chr(228).chr(229).chr(231).chr(232).chr(233).chr(234).chr(235)
  2560 + .chr(236).chr(237).chr(238).chr(239).chr(241).chr(242).chr(243)
  2561 + .chr(244).chr(245).chr(246).chr(248).chr(249).chr(250).chr(251)
  2562 + .chr(252).chr(253).chr(255);
2677 $chars['out'] = "EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy"; 2563 $chars['out'] = "EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy";
2678 $string = strtr($string, $chars['in'], $chars['out']); 2564 $string = strtr($string, $chars['in'], $chars['out']);
2679 - $double_chars['in'] = array(  
2680 - chr(140),  
2681 - chr(156),  
2682 - chr(198),  
2683 - chr(208),  
2684 - chr(222),  
2685 - chr(223),  
2686 - chr(230),  
2687 - chr(240),  
2688 - chr(254)  
2689 - );  
2690 - $double_chars['out'] = array(  
2691 - 'OE',  
2692 - 'oe',  
2693 - 'AE',  
2694 - 'DH',  
2695 - 'TH',  
2696 - 'ss',  
2697 - 'ae',  
2698 - 'dh',  
2699 - 'th'  
2700 - ); 2565 + $double_chars['in'] = array(chr(140), chr(156), chr(198), chr(208), chr(222), chr(223), chr(230), chr(240), chr(254));
  2566 + $double_chars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th');
2701 $string = str_replace($double_chars['in'], $double_chars['out'], $string); 2567 $string = str_replace($double_chars['in'], $double_chars['out'], $string);
2702 } 2568 }
2703 return $string; 2569 return $string;
ferramentas/conectargeorss/index.js
@@ -30,6 +30,7 @@ i3GEOF.conectargeorss = { @@ -30,6 +30,7 @@ i3GEOF.conectargeorss = {
30 }, 30 },
31 destroy: function(){ 31 destroy: function(){
32 //nao use this aqui 32 //nao use this aqui
  33 + i3GEOF.conectargeorss.renderFunction.call();
33 }, 34 },
34 html:function() { 35 html:function() {
35 var p = this._parameters, 36 var p = this._parameters,
@@ -38,7 +39,7 @@ i3GEOF.conectargeorss = { @@ -38,7 +39,7 @@ i3GEOF.conectargeorss = {
38 locaplic: i3GEO.configura.locaplic, 39 locaplic: i3GEO.configura.locaplic,
39 namespace: p.namespace, 40 namespace: p.namespace,
40 idContainer: p.idContainer, 41 idContainer: p.idContainer,
41 - botao: $trad("p14"), 42 + botao: $trad("adicmapa"),
42 ...i3GEO.idioma.objetoIdioma(i3f.dicionario) 43 ...i3GEO.idioma.objetoIdioma(i3f.dicionario)
43 }; 44 };
44 i3f.renderFunction.call( 45 i3f.renderFunction.call(
@@ -53,9 +54,10 @@ i3GEOF.conectargeorss = { @@ -53,9 +54,10 @@ i3GEOF.conectargeorss = {
53 var data = i3GEO.util.getFormData("#" + this._parameters.idContainer + " form"); 54 var data = i3GEO.util.getFormData("#" + this._parameters.idContainer + " form");
54 return data 55 return data
55 }, 56 },
56 - adiciona: function(btn){ 57 + adiciona: function(formEl){
  58 + var btn = $(formEl).find(":submit");
  59 + btn.prop("disabled",true).find("span").removeClass("hidden");
57 i3GEO.janela.abreAguarde(); 60 i3GEO.janela.abreAguarde();
58 - $(btn).button("disable").find("span").removeClass("hidden");  
59 var par = this.getFormData(), 61 var par = this.getFormData(),
60 i3f = this; 62 i3f = this;
61 par.g_sid = i3GEO.configura.sid; 63 par.g_sid = i3GEO.configura.sid;
@@ -66,23 +68,23 @@ i3GEOF.conectargeorss = { @@ -66,23 +68,23 @@ i3GEOF.conectargeorss = {
66 ) 68 )
67 .done( 69 .done(
68 function(data, status){ 70 function(data, status){
  71 + btn.prop("disabled",false).find("span").addClass("hidden");
69 i3GEO.janela.fechaAguarde(); 72 i3GEO.janela.fechaAguarde();
70 if(data.errorMsg != ""){ 73 if(data.errorMsg != ""){
71 i3GEO.janela.snackBar({content: data.errorMsg, style:'red'}); 74 i3GEO.janela.snackBar({content: data.errorMsg, style:'red'});
72 } else { 75 } else {
73 i3GEO.atualiza(); 76 i3GEO.atualiza();
74 i3GEO.janela.snackBar({content: $trad("concluido",i3f.dicionario)}); 77 i3GEO.janela.snackBar({content: $trad("concluido",i3f.dicionario)});
75 - i3f.destroy();  
76 } 78 }
77 - $(btn).button("disable").find("span").addClass("hidden"); 79 + i3f.destroy();
78 } 80 }
79 ) 81 )
80 .fail( 82 .fail(
81 function(data){ 83 function(data){
  84 + btn.prop("disabled",false).find("span").addClass("hidden");
82 i3GEO.janela.fechaAguarde(); 85 i3GEO.janela.fechaAguarde();
83 i3GEO.janela.snackBar({content: data.status, style:'red'}); 86 i3GEO.janela.snackBar({content: data.status, style:'red'});
84 i3f.destroy(); 87 i3f.destroy();
85 - $(btn).button("disable").find("span").addClass("hidden");  
86 } 88 }
87 ); 89 );
88 } 90 }
ferramentas/conectargeorss/template_mst.html
1 <div id='{{idContainer}}' class='container-fluid container-tools'> 1 <div id='{{idContainer}}' class='container-fluid container-tools'>
2 - <form class="form-vertical"> 2 + <form action="#" onsubmit="i3GEOF.{{namespace}}.adiciona(this);return false;" class="form-vertical">
3 <div class='form-group label-fixed condensed'> 3 <div class='form-group label-fixed condensed'>
4 <label class="col-md-12 control-label">{{{inseregeorss}}}</label> 4 <label class="col-md-12 control-label">{{{inseregeorss}}}</label>
5 <div class="col-md-12 "> 5 <div class="col-md-12 ">
6 <input required class="form-control input-lg" type='text' id='{{namespace}}url' name="url" value='' /> 6 <input required class="form-control input-lg" type='text' id='{{namespace}}url' name="url" value='' />
7 </div> 7 </div>
8 </div> 8 </div>
  9 + <button type="submit" class='btn btn-primary btn-sm btn-raised'>
  10 + <span class="glyphicon glyphicon-repeat normal-right-spinner hidden"></span> {{{botao}}}
  11 + </button>
9 </form> 12 </form>
10 - <button onclick="i3GEOF.{{namespace}}.adiciona(this)" class='btn btn-primary btn-sm btn-raised'>  
11 - <span class="glyphicon glyphicon-repeat normal-right-spinner hidden"></span> {{{botao}}}  
12 - </button>  
13 - <br> <br>  
14 </div> 13 </div>
15 \ No newline at end of file 14 \ No newline at end of file
ferramentas/conectarkml/index.js
@@ -29,7 +29,7 @@ i3GEOF.conectarkml = { @@ -29,7 +29,7 @@ i3GEOF.conectarkml = {
29 }, 29 },
30 destroy: function(){ 30 destroy: function(){
31 //nao use this aqui 31 //nao use this aqui
32 - //i3GEOF.conectarkml._parameters.mustache = ""; 32 + i3GEOF.conectarkml.renderFunction.call();
33 }, 33 },
34 html:function() { 34 html:function() {
35 var p = this._parameters, 35 var p = this._parameters,
@@ -38,7 +38,7 @@ i3GEOF.conectarkml = { @@ -38,7 +38,7 @@ i3GEOF.conectarkml = {
38 locaplic: i3GEO.configura.locaplic, 38 locaplic: i3GEO.configura.locaplic,
39 namespace: p.namespace, 39 namespace: p.namespace,
40 idContainer: p.idContainer, 40 idContainer: p.idContainer,
41 - botao: $trad("p14"), 41 + botao: $trad("adicmapa"),
42 ...i3GEO.idioma.objetoIdioma(i3f.dicionario) 42 ...i3GEO.idioma.objetoIdioma(i3f.dicionario)
43 }; 43 };
44 i3f.renderFunction.call( 44 i3f.renderFunction.call(
@@ -52,9 +52,10 @@ i3GEOF.conectarkml = { @@ -52,9 +52,10 @@ i3GEOF.conectarkml = {
52 var data = i3GEO.util.getFormData("#" + this._parameters.idContainer + " form"); 52 var data = i3GEO.util.getFormData("#" + this._parameters.idContainer + " form");
53 return data 53 return data
54 }, 54 },
55 - adiciona: function(btn){ 55 + adiciona: function(formEl){
  56 + var btn = $(formEl).find(":submit");
  57 + btn.prop("disabled",true).find("span").removeClass("hidden");
56 i3GEO.janela.abreAguarde(); 58 i3GEO.janela.abreAguarde();
57 - $(btn).button("disable").find("span").removeClass("hidden");  
58 var par = this.getFormData(), 59 var par = this.getFormData(),
59 i3f = this; 60 i3f = this;
60 par.g_sid = i3GEO.configura.sid; 61 par.g_sid = i3GEO.configura.sid;
@@ -68,7 +69,7 @@ i3GEOF.conectarkml = { @@ -68,7 +69,7 @@ i3GEOF.conectarkml = {
68 i3GEO.atualiza(); 69 i3GEO.atualiza();
69 i3GEO.janela.fechaAguarde(); 70 i3GEO.janela.fechaAguarde();
70 i3GEO.janela.snackBar({content: $trad("concluido",i3f.dicionario)}); 71 i3GEO.janela.snackBar({content: $trad("concluido",i3f.dicionario)});
71 - $(btn).button("disable").find("span").addClass("hidden"); 72 + btn.prop("disabled",false).find("span").addClass("hidden");
72 i3f.destroy(); 73 i3f.destroy();
73 } 74 }
74 ) 75 )
@@ -76,7 +77,7 @@ i3GEOF.conectarkml = { @@ -76,7 +77,7 @@ i3GEOF.conectarkml = {
76 function(data){ 77 function(data){
77 i3GEO.janela.fechaAguarde(); 78 i3GEO.janela.fechaAguarde();
78 i3GEO.janela.snackBar({content: data.status, style:'red'}); 79 i3GEO.janela.snackBar({content: data.status, style:'red'});
79 - $(btn).button("disable").find("span").addClass("hidden"); 80 + btn.prop("disabled",false).find("span").addClass("hidden");
80 i3f.destroy(); 81 i3f.destroy();
81 } 82 }
82 ); 83 );
ferramentas/conectarkml/template_mst.html
1 <div id='{{idContainer}}' class='container-fluid container-tools'> 1 <div id='{{idContainer}}' class='container-fluid container-tools'>
2 - <form class="form-vertical"> 2 + <form action="#" onsubmit="i3GEOF.{{namespace}}.adiciona(this);return false;" class="form-vertical">
3 <div class='form-group label-fixed condensed'> 3 <div class='form-group label-fixed condensed'>
4 <label class="col-md-12 control-label">{{{insereKml}}}</label> 4 <label class="col-md-12 control-label">{{{insereKml}}}</label>
5 <div class="col-md-12 "> 5 <div class="col-md-12 ">
6 <input required class="form-control input-lg" type='text' id='{{namespace}}url' name="url" value='' /> 6 <input required class="form-control input-lg" type='text' id='{{namespace}}url' name="url" value='' />
7 </div> 7 </div>
8 </div> 8 </div>
  9 + <button type="submit" class='btn btn-primary btn-sm btn-raised'>
  10 + <span class="glyphicon glyphicon-repeat normal-right-spinner hidden"></span> {{{botao}}}
  11 + </button>
9 </form> 12 </form>
10 - <button onclick="i3GEOF.{{namespace}}.adiciona(this)" class='btn btn-primary btn-sm btn-raised'>  
11 - <span class="glyphicon glyphicon-repeat normal-right-spinner hidden"></span> {{{botao}}}  
12 - </button>  
13 - <br> <br>  
14 </div> 13 </div>
15 \ No newline at end of file 14 \ No newline at end of file
ferramentas/opcoesescala/index.js
@@ -83,7 +83,8 @@ i3GEOF.opcoesescala = { @@ -83,7 +83,8 @@ i3GEOF.opcoesescala = {
83 }, 83 },
84 mudaEscalaGrafica: function(btn){ 84 mudaEscalaGrafica: function(btn){
85 i3GEO.janela.abreAguarde(); 85 i3GEO.janela.abreAguarde();
86 - $(btn).button("disable").find("span").removeClass("hidden"); 86 + btn = $(btn);
  87 + btn.prop("disabled",true).find("span").removeClass("hidden");
87 var par = this.getFormData(), 88 var par = this.getFormData(),
88 i3f = this; 89 i3f = this;
89 par.g_sid = i3GEO.configura.sid; 90 par.g_sid = i3GEO.configura.sid;
@@ -94,6 +95,7 @@ i3GEOF.opcoesescala = { @@ -94,6 +95,7 @@ i3GEOF.opcoesescala = {
94 ) 95 )
95 .done( 96 .done(
96 function(data, status){ 97 function(data, status){
  98 + btn.prop("disabled",false).find("span").addClass("hidden");
97 i3GEO.janela.fechaAguarde(); 99 i3GEO.janela.fechaAguarde();
98 i3GEO.janela.snackBar({content: $trad("concluido",i3f.dicionario)}); 100 i3GEO.janela.snackBar({content: $trad("concluido",i3f.dicionario)});
99 i3f.destroy(); 101 i3f.destroy();
@@ -101,6 +103,7 @@ i3GEOF.opcoesescala = { @@ -101,6 +103,7 @@ i3GEOF.opcoesescala = {
101 ) 103 )
102 .fail( 104 .fail(
103 function(data){ 105 function(data){
  106 + btn.prop("disabled",false).find("span").addClass("hidden");
104 i3GEO.janela.fechaAguarde(); 107 i3GEO.janela.fechaAguarde();
105 i3GEO.janela.snackBar({content: data.status, style:'red'}); 108 i3GEO.janela.snackBar({content: data.status, style:'red'});
106 i3f.destroy(); 109 i3f.destroy();
@@ -109,7 +112,8 @@ i3GEOF.opcoesescala = { @@ -109,7 +112,8 @@ i3GEOF.opcoesescala = {
109 }, 112 },
110 test: function(btn){ 113 test: function(btn){
111 i3GEO.janela.abreAguarde(); 114 i3GEO.janela.abreAguarde();
112 - $(btn).button("disable").find("span").removeClass("hidden"); 115 + btn = $(btn);
  116 + btn.prop("disabled",true).find("span").removeClass("hidden");
113 var par = this.getFormData(), 117 var par = this.getFormData(),
114 i3f = this; 118 i3f = this;
115 par.g_sid = i3GEO.configura.sid; 119 par.g_sid = i3GEO.configura.sid;
@@ -121,14 +125,14 @@ i3GEOF.opcoesescala = { @@ -121,14 +125,14 @@ i3GEOF.opcoesescala = {
121 .done( 125 .done(
122 function(data, status){ 126 function(data, status){
123 i3GEO.janela.fechaAguarde(); 127 i3GEO.janela.fechaAguarde();
124 - $(btn).button("enable").find("span").addClass("hidden"); 128 + btn.prop("disabled",false).find("span").addClass("hidden");
125 i3GEO.janela.closeMsg("<img src='" + data + "' >"); 129 i3GEO.janela.closeMsg("<img src='" + data + "' >");
126 } 130 }
127 ) 131 )
128 .fail( 132 .fail(
129 function(data){ 133 function(data){
130 i3GEO.janela.fechaAguarde(); 134 i3GEO.janela.fechaAguarde();
131 - $(btn).button("enable").find("span").addClass("hidden"); 135 + btn.prop("disabled",false).find("span").addClass("hidden");
132 i3GEO.janela.snackBar({content: data.status, style:'red'}); 136 i3GEO.janela.snackBar({content: data.status, style:'red'});
133 } 137 }
134 ); 138 );
ferramentas/opcoeslegenda/index.js
@@ -82,7 +82,8 @@ i3GEOF.opcoeslegenda = { @@ -82,7 +82,8 @@ i3GEOF.opcoeslegenda = {
82 }, 82 },
83 aplicaParametrosLegImg: function(btn){ 83 aplicaParametrosLegImg: function(btn){
84 i3GEO.janela.abreAguarde(); 84 i3GEO.janela.abreAguarde();
85 - $(btn).button("disable").find("span").removeClass("hidden"); 85 + btn = $(btn);
  86 + btn.prop("disabled",true).find("span").removeClass("hidden");
86 var par = this.getFormData(), 87 var par = this.getFormData(),
87 i3f = this; 88 i3f = this;
88 par.g_sid = i3GEO.configura.sid; 89 par.g_sid = i3GEO.configura.sid;
@@ -93,6 +94,7 @@ i3GEOF.opcoeslegenda = { @@ -93,6 +94,7 @@ i3GEOF.opcoeslegenda = {
93 ) 94 )
94 .done( 95 .done(
95 function(data, status){ 96 function(data, status){
  97 + btn.prop("disabled",false).find("span").addClass("hidden");
96 i3GEO.janela.fechaAguarde(); 98 i3GEO.janela.fechaAguarde();
97 i3GEO.janela.snackBar({content: $trad("concluido",i3f.dicionario)}); 99 i3GEO.janela.snackBar({content: $trad("concluido",i3f.dicionario)});
98 i3f.destroy(); 100 i3f.destroy();
@@ -100,6 +102,7 @@ i3GEOF.opcoeslegenda = { @@ -100,6 +102,7 @@ i3GEOF.opcoeslegenda = {
100 ) 102 )
101 .fail( 103 .fail(
102 function(data){ 104 function(data){
  105 + btn.prop("disabled",false).find("span").addClass("hidden");
103 i3GEO.janela.fechaAguarde(); 106 i3GEO.janela.fechaAguarde();
104 i3GEO.janela.snackBar({content: data.status, style:'red'}); 107 i3GEO.janela.snackBar({content: data.status, style:'red'});
105 i3f.destroy(); 108 i3f.destroy();
@@ -108,7 +111,8 @@ i3GEOF.opcoeslegenda = { @@ -108,7 +111,8 @@ i3GEOF.opcoeslegenda = {
108 }, 111 },
109 test: function(btn){ 112 test: function(btn){
110 i3GEO.janela.abreAguarde(); 113 i3GEO.janela.abreAguarde();
111 - $(btn).button("disable").find("span").removeClass("hidden"); 114 + btn = $(btn);
  115 + btn.prop("disabled",true).find("span").removeClass("hidden");
112 var par = this.getFormData(), 116 var par = this.getFormData(),
113 i3f = this; 117 i3f = this;
114 par.g_sid = i3GEO.configura.sid; 118 par.g_sid = i3GEO.configura.sid;
@@ -120,7 +124,7 @@ i3GEOF.opcoeslegenda = { @@ -120,7 +124,7 @@ i3GEOF.opcoeslegenda = {
120 .done( 124 .done(
121 function(data, status){ 125 function(data, status){
122 i3GEO.janela.fechaAguarde(); 126 i3GEO.janela.fechaAguarde();
123 - $(btn).button("enable").find("span").addClass("hidden"); 127 + btn.prop("disabled",false).find("span").addClass("hidden");
124 i3GEO.janela.closeMsg("<img src='" + data + "' >"); 128 i3GEO.janela.closeMsg("<img src='" + data + "' >");
125 } 129 }
126 ) 130 )
@@ -128,7 +132,7 @@ i3GEOF.opcoeslegenda = { @@ -128,7 +132,7 @@ i3GEOF.opcoeslegenda = {
128 function(data){ 132 function(data){
129 i3GEO.janela.fechaAguarde(); 133 i3GEO.janela.fechaAguarde();
130 i3GEO.janela.snackBar({content: data.status, style:'red'}); 134 i3GEO.janela.snackBar({content: data.status, style:'red'});
131 - $(btn).button("enable").find("span").addClass("hidden"); 135 + btn.prop("disabled",false).find("span").addClass("hidden");
132 } 136 }
133 ); 137 );
134 } 138 }
ferramentas/opcoesmaparef/index.js
@@ -85,7 +85,8 @@ i3GEOF.opcoesmaparef = { @@ -85,7 +85,8 @@ i3GEOF.opcoesmaparef = {
85 }, 85 },
86 altera: function(btn){ 86 altera: function(btn){
87 i3GEO.janela.abreAguarde(); 87 i3GEO.janela.abreAguarde();
88 - $(btn).button("disable").find("span").removeClass("hidden"); 88 + btn = $(btn);
  89 + btn.prop("disabled",true).find("span").removeClass("hidden");
89 var par = this.getFormData(), 90 var par = this.getFormData(),
90 i3f = this; 91 i3f = this;
91 par.g_sid = i3GEO.configura.sid; 92 par.g_sid = i3GEO.configura.sid;
@@ -96,6 +97,7 @@ i3GEOF.opcoesmaparef = { @@ -96,6 +97,7 @@ i3GEOF.opcoesmaparef = {
96 ) 97 )
97 .done( 98 .done(
98 function(data, status){ 99 function(data, status){
  100 + btn.prop("disabled",false).find("span").addClass("hidden");
99 i3GEO.janela.fechaAguarde(); 101 i3GEO.janela.fechaAguarde();
100 i3GEO.janela.snackBar({content: $trad("concluido",i3f.dicionario)}); 102 i3GEO.janela.snackBar({content: $trad("concluido",i3f.dicionario)});
101 i3f.destroy(); 103 i3f.destroy();
@@ -103,6 +105,7 @@ i3GEOF.opcoesmaparef = { @@ -103,6 +105,7 @@ i3GEOF.opcoesmaparef = {
103 ) 105 )
104 .fail( 106 .fail(
105 function(data){ 107 function(data){
  108 + btn.prop("disabled",false).find("span").addClass("hidden");
106 i3GEO.janela.fechaAguarde(); 109 i3GEO.janela.fechaAguarde();
107 i3GEO.janela.snackBar({content: data.status, style:'red'}); 110 i3GEO.janela.snackBar({content: data.status, style:'red'});
108 i3f.destroy(); 111 i3f.destroy();
ferramentas/opcoestamanho/index.js
@@ -62,7 +62,8 @@ i3GEOF.opcoestamanho = { @@ -62,7 +62,8 @@ i3GEOF.opcoestamanho = {
62 }, 62 },
63 mudatamanho: function(btn){ 63 mudatamanho: function(btn){
64 i3GEO.janela.abreAguarde(); 64 i3GEO.janela.abreAguarde();
65 - $(btn).button("disable").find("span").removeClass("hidden"); 65 + btn = $(btn);
  66 + btn.prop("disabled",true).find("span").removeClass("hidden");
66 var par = this.getFormData(), 67 var par = this.getFormData(),
67 i3f = this; 68 i3f = this;
68 par.g_sid = i3GEO.configura.sid; 69 par.g_sid = i3GEO.configura.sid;
@@ -73,6 +74,7 @@ i3GEOF.opcoestamanho = { @@ -73,6 +74,7 @@ i3GEOF.opcoestamanho = {
73 ) 74 )
74 .done( 75 .done(
75 function(data, status){ 76 function(data, status){
  77 + btn.prop("disabled",false).find("span").addClass("hidden");
76 i3GEO.janela.fechaAguarde(); 78 i3GEO.janela.fechaAguarde();
77 i3GEO.janela.snackBar({content: $trad("concluido",i3f.dicionario)}); 79 i3GEO.janela.snackBar({content: $trad("concluido",i3f.dicionario)});
78 i3f.destroy(); 80 i3f.destroy();
@@ -80,6 +82,7 @@ i3GEOF.opcoestamanho = { @@ -80,6 +82,7 @@ i3GEOF.opcoestamanho = {
80 ) 82 )
81 .fail( 83 .fail(
82 function(data){ 84 function(data){
  85 + btn.prop("disabled",false).find("span").addClass("hidden");
83 i3GEO.janela.fechaAguarde(); 86 i3GEO.janela.fechaAguarde();
84 i3GEO.janela.snackBar({content: data.status, style:'red'}); 87 i3GEO.janela.snackBar({content: data.status, style:'red'});
85 i3f.destroy(); 88 i3f.destroy();
ferramentas/uploaddbf/index.js
1 -/*  
2 -Title: Upload de arquivo dbf  
3 -  
4 -Envia para o servidor um arquivo local (dbf ou csv) e insere como uma camada no mapa.  
5 -  
6 -Veja:  
7 -  
8 -<i3GEO.arvoreDeTemas.dialogo.uploaddbf>  
9 -  
10 -Arquivo: i3geo/ferramentas/uploaddbf/index.js.php  
11 -  
12 -About: Licen&ccedil;a  
13 -  
14 -i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet  
15 -  
16 -Direitos Autorais Reservados (c) 2006 Minist&eacute;rio do Meio Ambiente Brasil  
17 -Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com  
18 -  
19 -Este programa &eacute; software livre; voc&ecirc; pode redistribu&iacute;-lo  
20 -e/ou modific&aacute;-lo sob os termos da Licen&ccedil;a P&uacute;blica Geral  
21 -GNU conforme publicada pela Free Software Foundation;  
22 -  
23 -Este programa &eacute; distribu&iacute;do na expectativa de que seja &uacute;til,  
24 -por&eacute;m, SEM NENHUMA GARANTIA; nem mesmo a garantia impl&iacute;cita  
25 -de COMERCIABILIDADE OU ADEQUA&Ccedil;&Atilde;O A UMA FINALIDADE ESPEC&Iacute;FICA.  
26 -Consulte a Licen&ccedil;a P&uacute;blica Geral do GNU para mais detalhes.  
27 -Voc&ecirc; deve ter recebido uma c&oacute;pia da Licen&ccedil;a P&uacute;blica Geral do  
28 -GNU junto com este programa; se n&atilde;o, escreva para a  
29 -Free Software Foundation, Inc., no endere&ccedil;o  
30 -59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.  
31 -*/  
32 if(typeof(i3GEOF) === 'undefined'){ 1 if(typeof(i3GEOF) === 'undefined'){
33 var i3GEOF = {}; 2 var i3GEOF = {};
34 } 3 }
35 -/*  
36 -Classe: i3GEOF.uploaddbf  
37 -*/  
38 i3GEOF.uploaddbf = { 4 i3GEOF.uploaddbf = {
39 - /*  
40 - Variavel: aguarde  
41 -  
42 - Estilo do objeto DOM com a imagem de aguarde existente no cabe&ccedil;alho da janela.  
43 - */  
44 - aguarde: "",  
45 - MUSTACHE: "",  
46 - /**  
47 - * Susbtitutos para o template  
48 - */  
49 - mustacheHash : function() {  
50 - var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.uploaddbf.dicionario);  
51 - dicionario["locaplic"] = i3GEO.configura.locaplic;  
52 - dicionario["sid"] = i3GEO.configura.sid;  
53 - return dicionario; 5 + renderFunction: i3GEO.janela.formModal,
  6 + _parameters : {
  7 + "mustache": "",
  8 + "idContainer": "i3GEOuploaddbf",
  9 + "namespace": "uploaddbf",
  10 + "dataForm": ""
54 }, 11 },
55 - /*  
56 - Function: inicia  
57 -  
58 - Inicia a ferramenta. &Eacute; chamado por criaJanelaFlutuante  
59 -  
60 - Parametro:  
61 -  
62 - iddiv {String} - id do div que receber&aacute; o conteudo HTML da ferramenta  
63 - */  
64 - inicia: function(iddiv){  
65 - if(i3GEOF.uploaddbf.MUSTACHE == ""){  
66 - $.get(i3GEO.configura.locaplic + "/ferramentas/uploaddbf/template_mst.html", function(template) {  
67 - i3GEOF.uploaddbf.MUSTACHE = template;  
68 - i3GEOF.uploaddbf.inicia(iddiv);  
69 - });  
70 - return;  
71 - }  
72 - $i(iddiv).innerHTML = i3GEOF.uploaddbf.html();  
73 -  
74 - i3GEO.util.radioEpsg(  
75 - function(retorno){  
76 - $i("i3GEOuploaddbfListaepsg").innerHTML = retorno.dados;  
77 - },  
78 - "i3GEOuploaddbfListaepsg",  
79 - "uploaddbf"  
80 - ); 12 + start : function(){
  13 + var p = this._parameters,
  14 + i3f = this,
  15 + t1 = i3GEO.configura.locaplic + "/ferramentas/"+p.namespace+"/template_mst.html";
  16 + if(p.mustache === ""){
  17 + i3GEO.janela.abreAguarde();
  18 + $.get(t1).done(function(r1) {
  19 + p.mustache = r1;
  20 + i3f.html();
  21 + i3GEO.janela.fechaAguarde();
  22 + if(p.dataForm.errorMsg && p.dataForm.errorMsg != ""){
  23 + i3GEO.janela.snackBar({content: p.dataForm.errorMsg, style:'red'});
  24 + i3GEO.janela.fechaAguarde();
  25 + i3f.destroy();
  26 + }
  27 + }).fail(function(data) {
  28 + i3GEO.janela.snackBar({content: "Erro. " + data.status, style:'red'});
  29 + i3f.destroy();
  30 + });
  31 + } else {
  32 + i3f.html();
  33 + }
81 }, 34 },
82 - /*  
83 - Function: html  
84 -  
85 - Gera o c&oacute;digo html para apresenta&ccedil;&atilde;o das op&ccedil;&otilde;es da ferramenta  
86 -  
87 - Retorno:  
88 -  
89 - String com o c&oacute;digo html  
90 - */  
91 - html:function() {  
92 - var ins = Mustache.render(i3GEOF.uploaddbf.MUSTACHE, i3GEOF.uploaddbf.mustacheHash());  
93 - return ins; 35 + destroy: function(){
  36 + //nao use this aqui
  37 + i3GEOF.uploaddbf.renderFunction.call();
  38 + },
  39 + doneok: function(){
  40 + i3GEO.janela.snackBar({content: $trad("camadaadic")});
  41 + this.destroy();
94 }, 42 },
95 - /*  
96 - Function: iniciaJanelaFlutuante  
97 -  
98 - Cria a janela flutuante para controle da ferramenta.  
99 - */  
100 - iniciaJanelaFlutuante: function(){  
101 - var janela,divid,titulo,cabecalho,minimiza;  
102 - if ($i("i3GEOF.uploaddbf")) {  
103 - return;  
104 - }  
105 - cabecalho = function(){};  
106 - minimiza = function(){  
107 - i3GEO.janela.minimiza("i3GEOF.uploaddbf",200);  
108 - };  
109 - titulo = "<span class='i3GeoTituloJanelaBsNolink' >" + $trad("a2b") + "</span></div>";  
110 - janela = i3GEO.janela.cria(  
111 - "320px",  
112 - "480px",  
113 - "",  
114 - "",  
115 - "",  
116 - titulo,  
117 - "i3GEOF.uploaddbf",  
118 - false,  
119 - "hd",  
120 - cabecalho,  
121 - minimiza,  
122 - "",  
123 - true,  
124 - "",  
125 - "",  
126 - "",  
127 - "",  
128 - "26"  
129 - );  
130 - divid = janela[2].id;  
131 - $i("i3GEOF.uploaddbf_corpo").style.backgroundColor = "white";  
132 - i3GEOF.uploaddbf.aguarde = $i("i3GEOF.uploaddbf_imagemCabecalho").style;  
133 - i3GEOF.uploaddbf.inicia(divid); 43 + html:function() {
  44 + var p = this._parameters,
  45 + i3f = this,
  46 + hash = {
  47 + locaplic: i3GEO.configura.locaplic,
  48 + namespace: p.namespace,
  49 + sid: i3GEO.configura.sid,
  50 + idContainer: p.idContainer,
  51 + adicmapa : $trad("adicmapa"),
  52 + ...i3GEO.idioma.objetoIdioma(i3f.dicionario)
  53 + };
  54 + i3f.renderFunction.call(
  55 + this,
  56 + {
  57 + texto: Mustache.render(p.mustache, hash),
  58 + onclose: i3f.destroy
  59 + });
  60 + i3GEO.util.comboEpsg("uploaddbfEPSG","i3GEOuploaddbfListaepsg");
134 }, 61 },
135 - /*  
136 - Function: submete  
137 -  
138 - Envia o arquivo ao servidor  
139 - */  
140 - submete: function(){  
141 - if(i3GEOF.uploaddbf.aguarde.visibility==="visible")  
142 - {return;}  
143 - i3GEOF.uploaddbf.aguarde.visibility="visible";  
144 - $i("i3GEOuploaddbff").submit(); 62 + submete: function(btn){
  63 + i3GEO.janela.abreAguarde();
  64 + $(btn).prop("disabled",true).find("span").removeClass("hidden");
  65 + $("#" + this._parameters.idContainer + " form").submit();
145 } 66 }
146 }; 67 };
ferramentas/uploaddbf/template_mst.html
1 -<div class='container-fluid'>  
2 -<h5></h5>  
3 - <form class="form-horizontal" role="form" id='i3GEOuploaddbff' target='i3GEOuploaddbfiframe' action='{{{locaplic}}}/ferramentas/uploaddbf/upload.php' method='post' ENCTYPE='multipart/form-data'>  
4 - <div class="input-group-btn">  
5 - <button style="margin-right:10px;" type="button" class="btn btn-primary btn-raised pull-left" onclick="$(this).parent().find('input[type=file]').click();">{{{arquivo}}}</button>  
6 - <input name="i3GEOuploaddbffile" onchange="$(this).parent().find('.form-control').html($(this).val().split(/[\\|/]/).pop());" style="display: none;" type="file">  
7 - <span class="form-control upload"></span>  
8 - </div>  
9 - <br>  
10 - <div class='form-group label-fixed condensed'>  
11 - <label class="control-label">{{{tipoArquivo}}}</label>  
12 - <div style="width: 100%;" class="input-group">  
13 - <select class="form-control" name="i3GEOuploaddbftipoarquivo">  
14 - <option value='dbf' selected>dbf</option> 1 +<div id='{{idContainer}}' class='container-fluid container-tools'>
  2 + <form accept-charset="utf-8" class="form-horizontal" target="i3GEOuploaddbfiframe" action="{{{locaplic}}}/ferramentas/uploaddbf/upload.php" method="post" ENCTYPE="multipart/form-data">
  3 + <div class='form-group label-fixed condensed'>
  4 + <label class="col-md-6 control-label">{{{arquivo}}}</label>
  5 + <div class="col-md-6 ">
  6 + <input required onclick="$(this).parent().find('input[type=file]').click();" class="form-control input-lg" type='text' name="i3GEOuploaddbffile" />
  7 + <input name="i3GEOuploaddbffile" onchange="$(this).parent().find('.form-control').val($(this).val().split(/[\\|/]/).pop());" style="display: none;" type="file">
  8 + <b class="caret careti"></b>
  9 + </div>
  10 + </div>
  11 + <div style="width: 100%;" class='form-group label-fixed condensed'>
  12 + <label class="col-md-6 control-label">{{{tipoArquivo}}}</label>
  13 + <div class="col-md-6">
  14 + <select class="form-control" name="i3GEOuploaddbftipoarquivo">
  15 + <option value='dbf' selected>dbf</option>
15 <option value='csvpv'>csv separado por ;</option> 16 <option value='csvpv'>csv separado por ;</option>
16 <option value='csvv'>csv separado por ,</option> 17 <option value='csvv'>csv separado por ,</option>
17 - </select><b class="caret careti"></b>  
18 - </div>  
19 - </div>  
20 - <div class='form-group label-fixed condensed'>  
21 - <label class="control-label" for="">{{{colunaX}}}</label>  
22 - <input class="form-control input-lg" type='text' name="i3GEOuploaddbfnomex" value='' />  
23 - </div>  
24 - <div class='form-group label-fixed condensed'>  
25 - <label class="control-label" for="">{{{colunaY}}}</label>  
26 - <input class="form-control input-lg" type='text' name="i3GEOuploaddbfnomey" value='' />  
27 - </div>  
28 -  
29 - <div class='form-group label-fixed condensed'>  
30 - <label class="control-label" for="tipo">{{{projecao}}}</label>  
31 - <div style="width: 100%;" class="input-group"></div>  
32 - <div id=i3GEOuploaddbfListaepsg style="text-align: left; overflow: auto; height: 70px; margin-top: 8px;"></div>  
33 - </div>  
34 - <hr />  
35 - <button name="submit" onclick="i3GEOF.uploaddbf.submete()" class='btn btn-primary btn-sm btn-raised'>{{{criaCamada}}}</button> 18 + </select><b class="caret careti"></b>
  19 + </div>
  20 + </div>
  21 + <div class='form-group label-fixed condensed'>
  22 + <label class="col-md-6 control-label">{{{colunaX}}}</label>
  23 + <div class="col-md-6 ">
  24 + <input class="form-control input-lg " type='text' name='i3GEOuploaddbfnomex' value='' />
  25 + </div>
  26 + </div>
  27 + <div class='form-group label-fixed condensed'>
  28 + <label class="col-md-6 control-label">{{{colunaY}}}</label>
  29 + <div class="col-md-6 ">
  30 + <input class="form-control input-lg " type='text' name='i3GEOuploaddbfnomey' value='' />
  31 + </div>
  32 + </div>
  33 + <div style="width: 100%;" class='form-group label-fixed condensed'>
  34 + <label class="col-md-6 control-label">{{{projecao}}}</label>
  35 + <div class="col-md-6">
  36 + <div id='i3GEOuploaddbfListaepsg'></div>
  37 + </div>
  38 + </div>
  39 + <button name="submit" onclick="i3GEOF.uploaddbf.submete(this)" class='btn btn-primary btn-sm btn-raised'>
  40 + <span class="glyphicon glyphicon-repeat normal-right-spinner hidden"></span>{{{adicmapa}}}
  41 + </button>
36 <input type='hidden' name='g_sid' value='{{{sid}}}'> 42 <input type='hidden' name='g_sid' value='{{{sid}}}'>
37 <input type='hidden' name='MAX_FILE_SIZE' value='100000'> 43 <input type='hidden' name='MAX_FILE_SIZE' value='100000'>
38 </form> 44 </form>
39 - <iframe name='i3GEOuploaddbfiframe' style='text-align: left; border: 1px solid gray;' width='98%' height='60px'></iframe> 45 + <iframe name=i3GEOuploaddbfiframe style="text-align: left; border: 1px solid rgb(242, 232, 232);" width="98%" height="60px"></iframe>
40 </div> 46 </div>
41 \ No newline at end of file 47 \ No newline at end of file
ferramentas/uploaddbf/upload.php
@@ -13,9 +13,6 @@ if (ob_get_level() == 0) ob_start(); @@ -13,9 +13,6 @@ if (ob_get_level() == 0) ob_start();
13 ?> 13 ?>
14 <html> 14 <html>
15 <head> 15 <head>
16 -<link rel="stylesheet" type="text/css" href="../../css/input.css" />  
17 -<link rel="stylesheet" type="text/css" href="../../css/geral.css" />  
18 -<title></title>  
19 </head> 16 </head>
20 <body bgcolor="white" style="background-color:white;text-align:left;"> 17 <body bgcolor="white" style="background-color:white;text-align:left;">
21 <p> 18 <p>
@@ -198,7 +195,7 @@ if (isset($_FILES[&#39;i3GEOuploaddbffile&#39;][&#39;name&#39;]) &amp;&amp; strlen(basename($_FILES[&#39;i3G @@ -198,7 +195,7 @@ if (isset($_FILES[&#39;i3GEOuploaddbffile&#39;][&#39;name&#39;]) &amp;&amp; strlen(basename($_FILES[&#39;i3G
198 {$novolayer->setProjection("init=epsg:".$uploaddbfEPSG);} 195 {$novolayer->setProjection("init=epsg:".$uploaddbfEPSG);}
199 $salvo = $mapa->save($map_file); 196 $salvo = $mapa->save($map_file);
200 echo "<b>Tema criado!!!"; 197 echo "<b>Tema criado!!!";
201 - echo "<script>window.scrollTo(0,10000);window.parent.i3GEO.atualiza()</script>"; 198 + echo "<script>window.scrollTo(0,10000);window.parent.i3GEO.atualiza();window.parent.i3GEOF.uploaddbf.doneok();</script>";
202 } 199 }
203 } 200 }
204 else 201 else
@@ -209,9 +206,9 @@ if (isset($_FILES[&#39;i3GEOuploaddbffile&#39;][&#39;name&#39;]) &amp;&amp; strlen(basename($_FILES[&#39;i3G @@ -209,9 +206,9 @@ if (isset($_FILES[&#39;i3GEOuploaddbffile&#39;][&#39;name&#39;]) &amp;&amp; strlen(basename($_FILES[&#39;i3G
209 } 206 }
210 } 207 }
211 restauraCon($map_file,$postgis_mapa); 208 restauraCon($map_file,$postgis_mapa);
212 -paraAguarde(); 209 +
213 function paraAguarde(){ 210 function paraAguarde(){
214 - echo "<script>window.scrollTo(0,10000);window.parent.i3GEOF.uploaddbf.aguarde.visibility='hidden';</script>"; 211 + echo "<script>window.parent.i3GEOF.uploaddbf.destroy();</script>";
215 } 212 }
216 function verificaNome($nome) 213 function verificaNome($nome)
217 { 214 {
ferramentas/uploadgpx/dependencias.php
1 <?php 1 <?php
2 include(dirname(__FILE__)."/../blacklist.php"); 2 include(dirname(__FILE__)."/../blacklist.php");
3 verificaBlFerramentas(basename(dirname(__FILE__))); 3 verificaBlFerramentas(basename(dirname(__FILE__)));
4 -  
5 -  
6 /** 4 /**
7 * Carrega os programas javascript necessarios para a ferramenta 5 * Carrega os programas javascript necessarios para a ferramenta
8 * Esse programa e usado na tag <script> ou com a funcao scripttag do i3Geo 6 * Esse programa e usado na tag <script> ou com a funcao scripttag do i3Geo
ferramentas/uploadgpx/index.js
1 -/*  
2 -Title: GPX  
3 -  
4 -Envia para o servidor um arquivo no formato GPX local e insere como novas camadas no mapa.  
5 -  
6 -Veja:  
7 -  
8 -<i3GEO.arvoreDeTemas.dialogo.uploadgpx>  
9 -  
10 -Arquivo:  
11 -  
12 -i3geo/ferramentas/uploadgpx/index.js.php  
13 -  
14 -Licenca:  
15 -  
16 -GPL2  
17 -  
18 -i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet  
19 -  
20 -Direitos Autorais Reservados (c) 2006 Minist&eacute;rio do Meio Ambiente Brasil  
21 -Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com  
22 -  
23 -Este programa &eacute; software livre; voc&ecirc; pode redistribu&iacute;-lo  
24 -e/ou modific&aacute;-lo sob os termos da Licen&ccedil;a P&uacute;blica Geral  
25 -GNU conforme publicada pela Free Software Foundation;  
26 -  
27 -Este programa &eacute; distribu&iacute;do na expectativa de que seja &uacute;til,  
28 -por&eacute;m, SEM NENHUMA GARANTIA; nem mesmo a garantia impl&iacute;cita  
29 -de COMERCIABILIDADE OU ADEQUA&Ccedil;&Atilde;O A UMA FINALIDADE ESPEC&Iacute;FICA.  
30 -Consulte a Licen&ccedil;a P&uacute;blica Geral do GNU para mais detalhes.  
31 -Voc&ecirc; deve ter recebido uma c&oacute;pia da Licen&ccedil;a P&uacute;blica Geral do  
32 -GNU junto com este programa; se n&atilde;o, escreva para a  
33 -Free Software Foundation, Inc., no endere&ccedil;o  
34 -59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.  
35 -*/  
36 -  
37 -  
38 if(typeof(i3GEOF) === 'undefined'){ 1 if(typeof(i3GEOF) === 'undefined'){
39 var i3GEOF = {}; 2 var i3GEOF = {};
40 } 3 }
41 -/*  
42 -Classe: i3GEOF.uploadgpx  
43 -*/  
44 i3GEOF.uploadgpx = { 4 i3GEOF.uploadgpx = {
45 - /*  
46 - Variavel: aguarde  
47 -  
48 - Estilo do objeto DOM com a imagem de aguarde existente no cabe&ccedil;alho da janela.  
49 - */  
50 - aguarde: "",  
51 - /**  
52 - * Susbtitutos para o template  
53 - */  
54 - mustacheHash : function() {  
55 - var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.uploadgpx.dicionario);  
56 - dicionario["sid"] = i3GEO.configura.sid;  
57 - dicionario["locaplic"] = i3GEO.configura.locaplic;  
58 - return dicionario; 5 + renderFunction: i3GEO.janela.formModal,
  6 + _parameters : {
  7 + "mustache": "",
  8 + "idContainer": "i3GEOuploadgpx",
  9 + "namespace": "uploadgpx",
  10 + "dataForm": ""
59 }, 11 },
60 - MUSTACHE: "",  
61 - /*  
62 - Function: inicia  
63 -  
64 - Inicia a ferramenta. &Eacute; chamado por criaJanelaFlutuante  
65 -  
66 - Parametro:  
67 -  
68 - iddiv {String} - id do div que receber&aacute; o conteudo HTML da ferramenta  
69 - */  
70 - inicia: function(iddiv){  
71 - if(i3GEOF.uploadgpx.MUSTACHE == ""){  
72 - $.get(i3GEO.configura.locaplic + "/ferramentas/uploadgpx/template_mst.html", function(template) {  
73 - i3GEOF.uploadgpx.MUSTACHE = template;  
74 - i3GEOF.uploadgpx.inicia(iddiv);  
75 - });  
76 - return;  
77 - }  
78 - try{  
79 - $i(iddiv).innerHTML = i3GEOF.uploadgpx.html();  
80 -  
81 - i3GEO.util.radioEpsg(  
82 - function(retorno)  
83 - {$i("i3GEOuploadgpxListaepsg").innerHTML = retorno.dados;},  
84 - "i3GEOuploadgpxListaepsg",  
85 - "uploadgpx"  
86 - );  
87 - }  
88 - catch(erro){i3GEO.janela.tempoMsg(erro);} 12 + start : function(){
  13 + var p = this._parameters,
  14 + i3f = this,
  15 + t1 = i3GEO.configura.locaplic + "/ferramentas/"+p.namespace+"/template_mst.html";
  16 + if(p.mustache === ""){
  17 + i3GEO.janela.abreAguarde();
  18 + $.get(t1).done(function(r1) {
  19 + p.mustache = r1;
  20 + i3f.html();
  21 + i3GEO.janela.fechaAguarde();
  22 + if(p.dataForm.errorMsg && p.dataForm.errorMsg != ""){
  23 + i3GEO.janela.snackBar({content: p.dataForm.errorMsg, style:'red'});
  24 + i3GEO.janela.fechaAguarde();
  25 + i3f.destroy();
  26 + }
  27 + }).fail(function(data) {
  28 + i3GEO.janela.snackBar({content: "Erro. " + data.status, style:'red'});
  29 + i3f.destroy();
  30 + });
  31 + } else {
  32 + i3f.html();
  33 + }
89 }, 34 },
90 - /*  
91 - Function: html  
92 -  
93 - Gera o c&oacute;digo html para apresenta&ccedil;&atilde;o das op&ccedil;&otilde;es da ferramenta  
94 -  
95 - Retorno:  
96 -  
97 - String com o c&oacute;digo html  
98 - */  
99 - html : function() {  
100 - var ins = Mustache.render(i3GEOF.uploadgpx.MUSTACHE, i3GEOF.uploadgpx.mustacheHash());  
101 - return ins; 35 + destroy: function(){
  36 + //nao use this aqui
  37 + i3GEOF.uploadgpx.renderFunction.call();
102 }, 38 },
103 - /*  
104 - Function: iniciaJanelaFlutuante  
105 -  
106 - Cria a janela flutuante para controle da ferramenta.  
107 - */  
108 - iniciaJanelaFlutuante: function(){  
109 - var janela,divid,titulo,cabecalho,minimiza;  
110 - if ($i("i3GEOF.uploadgpx")) {  
111 - return;  
112 - }  
113 - cabecalho = function(){};  
114 - minimiza = function(){  
115 - i3GEO.janela.minimiza("i3GEOF.uploadgpx",200);  
116 - };  
117 - titulo = "<span class='i3GeoTituloJanelaBsNolink' >GPX</span></div>";  
118 - janela = i3GEO.janela.cria(  
119 - "400px",  
120 - "330px",  
121 - "",  
122 - "",  
123 - "",  
124 - titulo,  
125 - "i3GEOF.uploadgpx",  
126 - false,  
127 - "hd",  
128 - cabecalho,  
129 - minimiza,  
130 - "",  
131 - true,  
132 - "",  
133 - "",  
134 - "",  
135 - "",  
136 - "103"  
137 - );  
138 - divid = janela[2].id;  
139 - $i("i3GEOF.uploadgpx_corpo").style.backgroundColor = "white";  
140 - i3GEOF.uploadgpx.aguarde = $i("i3GEOF.uploadgpx_imagemCabecalho").style;  
141 - i3GEOF.uploadgpx.inicia(divid); 39 + doneok: function(){
  40 + i3GEO.janela.snackBar({content: $trad("camadaadic")});
  41 + this.destroy();
142 }, 42 },
143 - /*  
144 - Function: submete  
145 -  
146 - Submete o arquivo ao servidor.  
147 - */  
148 - submete: function(){  
149 - if(i3GEOF.uploadgpx.aguarde.visibility==="visible")  
150 - {return;}  
151 - i3GEOF.uploadgpx.aguarde.visibility="visible";  
152 - $i("i3GEOuploadgpxf").submit(); 43 + html:function() {
  44 + var p = this._parameters,
  45 + i3f = this,
  46 + hash = {
  47 + locaplic: i3GEO.configura.locaplic,
  48 + namespace: p.namespace,
  49 + sid: i3GEO.configura.sid,
  50 + idContainer: p.idContainer,
  51 + adicmapa : $trad("adicmapa"),
  52 + ...i3GEO.idioma.objetoIdioma(i3f.dicionario)
  53 + };
  54 + i3f.renderFunction.call(
  55 + this,
  56 + {
  57 + texto: Mustache.render(p.mustache, hash),
  58 + onclose: i3f.destroy
  59 + });
  60 + i3GEO.util.comboEpsg("uploadgpxEPSG","i3GEOuploadgpxListaepsg");
  61 + },
  62 + submete: function(btn){
  63 + i3GEO.janela.abreAguarde();
  64 + $(btn).prop("disabled",true).find("span").removeClass("hidden");
  65 + $("#" + this._parameters.idContainer + " form").submit();
153 } 66 }
154 }; 67 };
ferramentas/uploadgpx/template_mst.html
1 -<div class='container-fluid'>  
2 - <h5></h5>  
3 -  
4 - <form class="form-horizontal" role="form" id='i3GEOuploadgpxf' target='i3GEOuploadgpxiframe' action='{{{locaplic}}}/ferramentas/uploadgpx/upload.php' method='post' ENCTYPE='multipart/form-data'>  
5 - <div class="input-group-btn">  
6 - <button style="margin-right:10px;" type="button" class="btn btn-primary btn-raised pull-left" onclick="$(this).parent().find('input[type=file]').click();">{{{arquivoGpx}}}</button>  
7 - <input name="i3GEOuploadgpx" onchange="$(this).parent().find('.form-control').html($(this).val().split(/[\\|/]/).pop());" style="display: none;" type="file">  
8 - <span class="form-control upload"></span>  
9 - </div>  
10 - <br>  
11 - <div class='form-group label-fixed condensed'>  
12 - <label class="control-label" for="tipo">{{{projecao}}}</label>  
13 - <div class="input-group"></div>  
14 - <div id=i3GEOuploadgpxListaepsg style="text-align: left; overflow: auto; height: 70px; margin-top: 8px;"></div>  
15 - </div>  
16 - <hr />  
17 - <button name="submit" onclick="i3GEOF.uploadgpx.submete()" class='btn btn-primary btn-sm btn-raised'>{{{criaCamada}}}</button>  
18 -  
19 - <input type='hidden' name='g_sid' value='{{{sid}}}'>  
20 - <input type='hidden' name='MAX_FILE_SIZE' value='100000'>  
21 -  
22 - </form>  
23 - <iframe name='i3GEOuploadgpxiframe' style='text-align: left; border: 1px solid gray;' width='98%' height='60px'></iframe> 1 +<div id='{{idContainer}}' class='container-fluid container-tools'>
  2 + <form accept-charset="utf-8" class="form-horizontal" target="i3GEOuploadgpxiframe" action="{{{locaplic}}}/ferramentas/uploadgpx/upload.php" method="post" ENCTYPE="multipart/form-data">
  3 + <div class='form-group label-fixed condensed'>
  4 + <label class="col-md-6 control-label">{{{arquivoGpx}}}</label>
  5 + <div class="col-md-6 ">
  6 + <input required onclick="$(this).parent().find('input[type=file]').click();" class="form-control input-lg" type='text' name="i3GEOuploadgpx" />
  7 + <input name="i3GEOuploadgpx" onchange="$(this).parent().find('.form-control').val($(this).val().split(/[\\|/]/).pop());" style="display: none;" type="file">
  8 + <b class="caret careti"></b>
  9 + </div>
  10 + </div>
  11 + <div style="width: 100%;" class='form-group label-fixed condensed'>
  12 + <label class="col-md-6 control-label">{{{projecao}}}</label>
  13 + <div class="col-md-6">
  14 + <div id='i3GEOuploadgpxListaepsg'></div>
  15 + </div>
  16 + </div>
  17 + <button name="submit" onclick="i3GEOF.uploadgpx.submete(this)" class='btn btn-primary btn-sm btn-raised'>
  18 + <span class="glyphicon glyphicon-repeat normal-right-spinner hidden"></span>{{{adicmapa}}}
  19 + </button>
  20 + <input type='hidden' name='g_sid' value='{{{sid}}}'>
  21 + <input type='hidden' name='MAX_FILE_SIZE' value='100000'>
  22 + </form>
  23 + <iframe name=i3GEOuploadgpxiframe style="text-align: left; border: 1px solid rgb(242, 232, 232);" width="98%" height="60px"></iframe>
24 </div> 24 </div>
25 \ No newline at end of file 25 \ No newline at end of file
ferramentas/uploadgpx/upload.php
@@ -14,9 +14,6 @@ if (ob_get_level() == 0) ob_start(); @@ -14,9 +14,6 @@ if (ob_get_level() == 0) ob_start();
14 ?> 14 ?>
15 <html> 15 <html>
16 <head> 16 <head>
17 -<link rel="stylesheet" type="text/css" href="../../css/input.css" />  
18 -<link rel="stylesheet" type="text/css" href="../../css/geral.css" />  
19 -<title></title>  
20 </head> 17 </head>
21 <body bgcolor="white" style="background-color:white;text-align:left;"> 18 <body bgcolor="white" style="background-color:white;text-align:left;">
22 <p> 19 <p>
@@ -102,14 +99,14 @@ if (isset($_FILES[&#39;i3GEOuploadgpx&#39;][&#39;name&#39;]) &amp;&amp; strlen(basename($_FILES[&#39;i3GEOup @@ -102,14 +99,14 @@ if (isset($_FILES[&#39;i3GEOuploadgpx&#39;][&#39;name&#39;]) &amp;&amp; strlen(basename($_FILES[&#39;i3GEOup
102 // le os itens 99 // le os itens
103 $novolayer->set("status",MS_DEFAULT); 100 $novolayer->set("status",MS_DEFAULT);
104 $novolayer->set("template","none.htm"); 101 $novolayer->set("template","none.htm");
105 - if(isset($_GET["uploadkmlEPSG"]) && $_GET["uploadkmlEPSG"] != "")  
106 - {$novolayer->setProjection("init=epsg:".$_GET["uploadkmlEPSG"]);}  
107 - //$adiciona = ms_newLayerObj($mapa, $novolayer); 102 + if(isset($_GET["uploadgpxEPSG"]) && $_GET["uploadgpxEPSG"] != ""){
  103 + $novolayer->setProjection("init=epsg:".$_GET["uploadgpxEPSG"]);
  104 + }
108 } 105 }
109 $salvo = $mapa->save($map_file); 106 $salvo = $mapa->save($map_file);
110 //grava os templates de cada tema 107 //grava os templates de cada tema
111 echo "<b><p class='paragrafo' >Camadas criadas!!! Redesenhando o mapa."; 108 echo "<b><p class='paragrafo' >Camadas criadas!!! Redesenhando o mapa.";
112 - echo "<script>window.scrollTo(0,10000);window.parent.i3GEO.atualiza()</script>"; 109 + echo "<script>window.scrollTo(0,10000);window.parent.i3GEO.atualiza();window.parent.i3GEOF.uploadgpx.doneok();</script>";
113 } 110 }
114 else 111 else
115 { 112 {
@@ -126,7 +123,7 @@ else @@ -126,7 +123,7 @@ else
126 restauraCon($map_file,$postgis_mapa); 123 restauraCon($map_file,$postgis_mapa);
127 paraAguarde(); 124 paraAguarde();
128 function paraAguarde(){ 125 function paraAguarde(){
129 - echo "<script>window.scrollTo(0,10000);window.parent.i3GEOF.uploadgpx.aguarde.visibility='hidden';</script>"; 126 + echo "<script>window.parent.i3GEOF.uploadgpx.destroy();</script>";
130 } 127 }
131 function verificaNome($nome) 128 function verificaNome($nome)
132 { 129 {
ferramentas/uploadkml/index.js
1 -/*  
2 -Title: Upload KML  
3 -  
4 -Envia para o servidor um arquivo no formato KML local e insere como novas camadas no mapa.  
5 -  
6 -Veja:  
7 -  
8 -<i3GEO.arvoreDeTemas.dialogo.uploadkml>  
9 -  
10 -Arquivo:  
11 -  
12 -i3geo/ferramentas/uploadkml/index.js.php  
13 -  
14 -Licenca:  
15 -  
16 -GPL2  
17 -  
18 -i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet  
19 -  
20 -Direitos Autorais Reservados (c) 2006 Minist&eacute;rio do Meio Ambiente Brasil  
21 -Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com  
22 -  
23 -Este programa &eacute; software livre; voc&ecirc; pode redistribu&iacute;-lo  
24 -e/ou modific&aacute;-lo sob os termos da Licen&ccedil;a P&uacute;blica Geral  
25 -GNU conforme publicada pela Free Software Foundation;  
26 -  
27 -Este programa &eacute; distribu&iacute;do na expectativa de que seja &uacute;til,  
28 -por&eacute;m, SEM NENHUMA GARANTIA; nem mesmo a garantia impl&iacute;cita  
29 -de COMERCIABILIDADE OU ADEQUA&Ccedil;&Atilde;O A UMA FINALIDADE ESPEC&Iacute;FICA.  
30 -Consulte a Licen&ccedil;a P&uacute;blica Geral do GNU para mais detalhes.  
31 -Voc&ecirc; deve ter recebido uma c&oacute;pia da Licen&ccedil;a P&uacute;blica Geral do  
32 -GNU junto com este programa; se n&atilde;o, escreva para a  
33 -Free Software Foundation, Inc., no endere&ccedil;o  
34 -59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.  
35 -*/  
36 -  
37 -  
38 if(typeof(i3GEOF) === 'undefined'){ 1 if(typeof(i3GEOF) === 'undefined'){
39 var i3GEOF = {}; 2 var i3GEOF = {};
40 } 3 }
41 -/*  
42 -Classe: i3GEOF.uploadkml  
43 -*/  
44 i3GEOF.uploadkml = { 4 i3GEOF.uploadkml = {
45 - /*  
46 - Variavel: aguarde  
47 -  
48 - Estilo do objeto DOM com a imagem de aguarde existente no cabe&ccedil;alho da janela.  
49 - */  
50 - aguarde: "",  
51 - mustacheHash : function() {  
52 - var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.uploadkml.dicionario);  
53 - dicionario["sid"] = i3GEO.configura.sid;  
54 - dicionario["locaplic"] = i3GEO.configura.locaplic;  
55 - return dicionario; 5 + renderFunction: i3GEO.janela.formModal,
  6 + _parameters : {
  7 + "mustache": "",
  8 + "idContainer": "i3GEOuploadkml",
  9 + "namespace": "uploadkml",
  10 + "dataForm": ""
56 }, 11 },
57 - MUSTACHE: "",  
58 - /*  
59 - Function: inicia  
60 -  
61 - Inicia a ferramenta. &Eacute; chamado por criaJanelaFlutuante  
62 -  
63 - Parametro:  
64 -  
65 - iddiv {String} - id do div que receber&aacute; o conteudo HTML da ferramenta  
66 - */  
67 - inicia: function(iddiv){  
68 - if(i3GEOF.uploadkml.MUSTACHE == ""){  
69 - $.get(i3GEO.configura.locaplic + "/ferramentas/uploadkml/template_mst.html", function(template) {  
70 - i3GEOF.uploadkml.MUSTACHE = template;  
71 - i3GEOF.uploadkml.inicia(iddiv);  
72 - });  
73 - return;  
74 - }  
75 - try{  
76 - $i(iddiv).innerHTML = i3GEOF.uploadkml.html();  
77 -  
78 - i3GEO.util.radioEpsg(  
79 - function(retorno)  
80 - {$i("i3GEOuploadkmlListaepsg").innerHTML = retorno.dados;},  
81 - "i3GEOuploadkmlListaepsg",  
82 - "uploadkml"  
83 - );  
84 - }  
85 - catch(erro){i3GEO.janela.tempoMsg(erro);} 12 + start : function(){
  13 + var p = this._parameters,
  14 + i3f = this,
  15 + t1 = i3GEO.configura.locaplic + "/ferramentas/"+p.namespace+"/template_mst.html";
  16 + if(p.mustache === ""){
  17 + i3GEO.janela.abreAguarde();
  18 + $.get(t1).done(function(r1) {
  19 + p.mustache = r1;
  20 + i3f.html();
  21 + i3GEO.janela.fechaAguarde();
  22 + if(p.dataForm.errorMsg && p.dataForm.errorMsg != ""){
  23 + i3GEO.janela.snackBar({content: p.dataForm.errorMsg, style:'red'});
  24 + i3GEO.janela.fechaAguarde();
  25 + i3f.destroy();
  26 + }
  27 + }).fail(function(data) {
  28 + i3GEO.janela.snackBar({content: "Erro. " + data.status, style:'red'});
  29 + i3f.destroy();
  30 + });
  31 + } else {
  32 + i3f.html();
  33 + }
86 }, 34 },
87 - /*  
88 - Function: html  
89 -  
90 - Gera o c&oacute;digo html para apresenta&ccedil;&atilde;o das op&ccedil;&otilde;es da ferramenta  
91 -  
92 - Retorno:  
93 -  
94 - String com o c&oacute;digo html  
95 - */  
96 - html:function() {  
97 - var ins = Mustache.render(i3GEOF.uploadkml.MUSTACHE, i3GEOF.uploadkml.mustacheHash());  
98 - return ins; 35 + destroy: function(){
  36 + //nao use this aqui
  37 + i3GEOF.uploadkml.renderFunction.call();
  38 + },
  39 + doneok: function(){
  40 + i3GEO.janela.snackBar({content: $trad("camadaadic")});
  41 + this.destroy();
99 }, 42 },
100 - /*  
101 - Function: iniciaJanelaFlutuante  
102 -  
103 - Cria a janela flutuante para controle da ferramenta.  
104 - */  
105 - iniciaJanelaFlutuante: function(){  
106 - var janela,divid,titulo,cabecalho,minimiza;  
107 - if ($i("i3GEOF.uploadkml")) {  
108 - return;  
109 - }  
110 - cabecalho = function(){};  
111 - minimiza = function(){  
112 - i3GEO.janela.minimiza("i3GEOF.uploadkml",200);  
113 - };  
114 - titulo = "<span class='i3GeoTituloJanelaBsNolink' >KML</span></div>";  
115 - janela = i3GEO.janela.cria(  
116 - "450px",  
117 - "460px",  
118 - "",  
119 - "",  
120 - "",  
121 - titulo,  
122 - "i3GEOF.uploadkml",  
123 - false,  
124 - "hd",  
125 - cabecalho,  
126 - minimiza,  
127 - "",  
128 - true,  
129 - "",  
130 - "",  
131 - "",  
132 - "",  
133 - "104"  
134 - );  
135 - divid = janela[2].id;  
136 - $i("i3GEOF.uploadkml_corpo").style.backgroundColor = "white";  
137 - i3GEOF.uploadkml.aguarde = $i("i3GEOF.uploadkml_imagemCabecalho").style;  
138 - i3GEOF.uploadkml.inicia(divid); 43 + html:function() {
  44 + var p = this._parameters,
  45 + i3f = this,
  46 + hash = {
  47 + locaplic: i3GEO.configura.locaplic,
  48 + namespace: p.namespace,
  49 + sid: i3GEO.configura.sid,
  50 + idContainer: p.idContainer,
  51 + adicmapa : $trad("adicmapa"),
  52 + ...i3GEO.idioma.objetoIdioma(i3f.dicionario)
  53 + };
  54 + i3f.renderFunction.call(
  55 + this,
  56 + {
  57 + texto: Mustache.render(p.mustache, hash),
  58 + onclose: i3f.destroy
  59 + });
  60 + i3GEO.util.comboEpsg("uploadkmlEPSG","i3GEOuploadkmlListaepsg");
139 }, 61 },
140 - /*  
141 - Function: submete  
142 -  
143 - Submete o arquivo ao servidor.  
144 - */  
145 - submete: function(){  
146 - if($i("layerkml").value == ""){  
147 - i3GEO.janela.tempoMsg($trad("nomeLayerKml",i3GEOF.uploadkml.dicionario));  
148 - return;  
149 - }  
150 - if(i3GEOF.uploadkml.aguarde.visibility==="visible"){  
151 - return;  
152 - }  
153 - i3GEOF.uploadkml.aguarde.visibility="visible";  
154 - $i("i3GEOuploadkmlf").submit(); 62 + submete: function(btn){
  63 + i3GEO.janela.abreAguarde();
  64 + $(btn).prop("disabled",true).find("span").removeClass("hidden");
  65 + $("#" + this._parameters.idContainer + " form").submit();
155 } 66 }
156 }; 67 };
ferramentas/uploadkml/template_mst.html
1 -<div class='container-fluid'>  
2 - <h5 class="alert alert-info">{{{ajuda}}}</h5>  
3 - <h5 class="alert alert-info">{{{ajuda2}}}</h5>  
4 - <form class="form-horizontal" role="form" id='i3GEOuploadkmlf' target='i3GEOuploadkmliframe' action='{{{locaplic}}}/ferramentas/uploadkml/upload.php' method='post' ENCTYPE='multipart/form-data'>  
5 - <div class="input-group-btn">  
6 - <button style="margin-right:10px;" type="button" class="btn btn-primary btn-raised pull-left" onclick="$(this).parent().find('input[type=file]').click();">KML</button>  
7 - <input name="i3GEOuploadkml" onchange="$(this).parent().find('.form-control').html($(this).val().split(/[\\|/]/).pop());" style="display: none;" type="file">  
8 - <span class="form-control upload"></span>  
9 - </div>  
10 - <br>  
11 - <div class='form-group label-fixed condensed'>  
12 - <label class="control-label" for="">{{{nomeLayerKml}}}</label>  
13 - <input class="form-control input-lg" type='text' name="layerkml" id="layerkml" value='' />  
14 - </div>  
15 - <div class='form-group label-fixed condensed'>  
16 - <label class="control-label" for="tipo">{{{projecao}}}</label>  
17 - <div class="input-group"></div>  
18 - <div id=i3GEOuploadkmlListaepsg style="text-align: left; overflow: auto; height: 70px; margin-top: 8px;"></div>  
19 - </div>  
20 - <hr />  
21 -  
22 - <input type='hidden' name='g_sid' value='{{{sid}}}'>  
23 - <input type='hidden' name='MAX_FILE_SIZE' value='100000'>  
24 - </form>  
25 - <button onclick="i3GEOF.uploadkml.submete()" class='btn btn-primary btn-sm btn-raised'>{{{criaCamada}}}</button>  
26 - <iframe name='i3GEOuploadkmliframe' style='text-align: left; border: 1px solid gray;' width='98%' height='60px'></iframe> 1 +<div id='{{idContainer}}' class='container-fluid container-tools'>
  2 + <h5 class="alert alert-info">{{{ajuda}}}</h5>
  3 + <h5 class="alert alert-info">{{{ajuda2}}}</h5>
  4 + <form accept-charset="utf-8" class="form-horizontal" target="i3GEOuploadkmliframe" action="{{{locaplic}}}/ferramentas/uploadkml/upload.php" method="post" ENCTYPE="multipart/form-data">
  5 + <div class='form-group label-fixed condensed'>
  6 + <label class="col-md-6 control-label">{{{arquivoKml}}}</label>
  7 + <div class="col-md-6 ">
  8 + <input required onclick="$(this).parent().find('input[type=file]').click();" class="form-control input-lg" type='text' name="i3GEOuploadkml" />
  9 + <input name="i3GEOuploadkml" onchange="$(this).parent().find('.form-control').val($(this).val().split(/[\\|/]/).pop());" style="display: none;" type="file">
  10 + <b class="caret careti"></b>
  11 + </div>
  12 + </div>
  13 + <div class='form-group label-fixed condensed'>
  14 + <label class="col-md-6 control-label">{{{nomeLayerKml}}}</label>
  15 + <div class="col-md-6 ">
  16 + <input required class="form-control input-lg " type='text' value='' name="layerkml"/>
  17 + </div>
  18 + </div>
  19 + <div style="width: 100%;" class='form-group label-fixed condensed'>
  20 + <label class="col-md-6 control-label">{{{projecao}}}</label>
  21 + <div class="col-md-6">
  22 + <div id='i3GEOuploadkmlListaepsg'></div>
  23 + </div>
  24 + </div>
  25 + <button name="submit" onclick="i3GEOF.uploadkml.submete(this)" class='btn btn-primary btn-sm btn-raised'>
  26 + <span class="glyphicon glyphicon-repeat normal-right-spinner hidden"></span>{{{adicmapa}}}
  27 + </button>
  28 + <input type='hidden' name='g_sid' value='{{{sid}}}'>
  29 + <input type='hidden' name='MAX_FILE_SIZE' value='100000'>
  30 + </form>
  31 + <iframe name=i3GEOuploadkmliframe style="text-align: left; border: 1px solid rgb(242, 232, 232);" width="98%" height="60px"></iframe>
27 </div> 32 </div>
28 \ No newline at end of file 33 \ No newline at end of file
ferramentas/uploadkml/upload.php
@@ -16,8 +16,6 @@ if (ob_get_level() == 0) ob_start(); @@ -16,8 +16,6 @@ if (ob_get_level() == 0) ob_start();
16 ?> 16 ?>
17 <html> 17 <html>
18 <head> 18 <head>
19 -<link rel="stylesheet" type="text/css" href="../../css/input.css" />  
20 -<link rel="stylesheet" type="text/css" href="../../css/geral.css" />  
21 <title></title> 19 <title></title>
22 </head> 20 </head>
23 <body bgcolor="white" style="background-color:white;text-align:left;"> 21 <body bgcolor="white" style="background-color:white;text-align:left;">
@@ -112,7 +110,7 @@ if (isset($_FILES[&#39;i3GEOuploadkml&#39;][&#39;name&#39;]) &amp;&amp; strlen(basename($_FILES[&#39;i3GEOup @@ -112,7 +110,7 @@ if (isset($_FILES[&#39;i3GEOuploadkml&#39;][&#39;name&#39;]) &amp;&amp; strlen(basename($_FILES[&#39;i3GEOup
112 $salvo = $mapa->save($map_file); 110 $salvo = $mapa->save($map_file);
113 //grava os templates de cada tema 111 //grava os templates de cada tema
114 echo "<b><p class='paragrafo' >Camadas criadas!!! Redesenhando o mapa."; 112 echo "<b><p class='paragrafo' >Camadas criadas!!! Redesenhando o mapa.";
115 - echo "<script>window.scrollTo(0,10000);window.parent.i3GEO.atualiza()</script>"; 113 + echo "<script>window.scrollTo(0,10000);window.parent.i3GEO.atualiza();window.parent.i3GEOF.uploadkml.doneok();</script>";
116 } 114 }
117 else 115 else
118 { 116 {
@@ -129,7 +127,7 @@ else @@ -129,7 +127,7 @@ else
129 restauraCon($map_file,$postgis_mapa); 127 restauraCon($map_file,$postgis_mapa);
130 paraAguarde(); 128 paraAguarde();
131 function paraAguarde(){ 129 function paraAguarde(){
132 - echo "<script>window.scrollTo(0,10000);window.parent.i3GEOF.uploadkml.aguarde.visibility='hidden';</script>"; 130 + echo "<script>window.parent.i3GEOF.uploadkml.destroy();</script>";
133 } 131 }
134 function verificaNome($nome) 132 function verificaNome($nome)
135 { 133 {
ferramentas/uploadshp/index.js
@@ -34,6 +34,11 @@ i3GEOF.uploadshp = { @@ -34,6 +34,11 @@ i3GEOF.uploadshp = {
34 }, 34 },
35 destroy: function(){ 35 destroy: function(){
36 //nao use this aqui 36 //nao use this aqui
  37 + i3GEOF.uploadshp.renderFunction.call();
  38 + },
  39 + doneok: function(){
  40 + i3GEO.janela.snackBar({content: $trad("camadaadic")});
  41 + this.destroy();
37 }, 42 },
38 html:function() { 43 html:function() {
39 var p = this._parameters, 44 var p = this._parameters,
@@ -43,6 +48,7 @@ i3GEOF.uploadshp = { @@ -43,6 +48,7 @@ i3GEOF.uploadshp = {
43 namespace: p.namespace, 48 namespace: p.namespace,
44 sid: i3GEO.configura.sid, 49 sid: i3GEO.configura.sid,
45 idContainer: p.idContainer, 50 idContainer: p.idContainer,
  51 + adicmapa : $trad("adicmapa"),
46 ...i3GEO.idioma.objetoIdioma(i3f.dicionario) 52 ...i3GEO.idioma.objetoIdioma(i3f.dicionario)
47 }; 53 };
48 i3f.renderFunction.call( 54 i3f.renderFunction.call(
@@ -53,11 +59,6 @@ i3GEOF.uploadshp = { @@ -53,11 +59,6 @@ i3GEOF.uploadshp = {
53 }); 59 });
54 i3GEO.util.comboEpsg("uploadEPSG","i3GEOuploadListaepsg"); 60 i3GEO.util.comboEpsg("uploadEPSG","i3GEOuploadListaepsg");
55 }, 61 },
56 - /*  
57 - Function: submete  
58 -  
59 - Submete o arquivo ao servidor  
60 - */  
61 submete: function(btn){ 62 submete: function(btn){
62 i3GEO.janela.abreAguarde(); 63 i3GEO.janela.abreAguarde();
63 $(btn).prop("disabled",true).find("span").removeClass("hidden"); 64 $(btn).prop("disabled",true).find("span").removeClass("hidden");
ferramentas/uploadshp/template_mst.html
@@ -51,9 +51,8 @@ @@ -51,9 +51,8 @@
51 </div> 51 </div>
52 </div> 52 </div>
53 53
54 - <hr />  
55 - <button id="teste" name="submit" onclick="i3GEOF.uploadshp.submete(this)" class='btn btn-primary btn-sm btn-raised'>  
56 - <span class="glyphicon glyphicon-repeat normal-right-spinner hidden"></span>{{{envia}}} 54 + <button name="submit" onclick="i3GEOF.uploadshp.submete(this)" class='btn btn-primary btn-sm btn-raised'>
  55 + <span class="glyphicon glyphicon-repeat normal-right-spinner hidden"></span>{{{adicmapa}}}
57 </button> 56 </button>
58 57
59 <input type=hidden name=g_sid value="{{{sid}}}"> 58 <input type=hidden name=g_sid value="{{{sid}}}">
ferramentas/uploadshp/upload.php
@@ -182,7 +182,7 @@ if (isset($_FILES[&#39;i3GEOuploadshp&#39;][&#39;name&#39;])) @@ -182,7 +182,7 @@ if (isset($_FILES[&#39;i3GEOuploadshp&#39;][&#39;name&#39;]))
182 $salvo = $mapa->save($map_file); 182 $salvo = $mapa->save($map_file);
183 //grava os templates de cada tema 183 //grava os templates de cada tema
184 echo "<b><p class='paragrafo' >Tema criado!!! Redesenhando o mapa."; 184 echo "<b><p class='paragrafo' >Tema criado!!! Redesenhando o mapa.";
185 - echo "<script>window.scrollTo(0,10000);window.parent.i3GEO.atualiza()</script>"; 185 + echo "<script>window.scrollTo(0,10000);window.parent.i3GEO.atualiza();window.parent.i3GEOF.uploadshp.doneok();</script>";
186 } 186 }
187 else 187 else
188 { 188 {