Commit 670079e7abd50b3eac9d2eeba14cfc0ae17c05fa

Authored by Edmar Moretti
1 parent 0f0bfc09

Inclusão do editor de textos no sistema de administração

Showing 2 changed files with 24 additions and 5 deletions   Show diff stats
admin/php/editortexto.php
... ... @@ -12,7 +12,17 @@
12 12 </style>
13 13 </head>
14 14 <body>
  15 +<a href="http://mapserver.org/mapfile/index.html#mapfile" target="_new" >Documentação do Mapserver</a><br><br>
  16 +<form action="editortexto.php?mapfile=<?php echo $_GET["mapfile"];?>" method=post >
  17 +
  18 +<input type=submit value="Salvar"/><input type=button value="Testar" onclick="testar()" /> (Salve antes de testar)<br><br>
  19 +Edite:<br>
15 20 <?php
  21 +//evita erros removendo caracteres PHP
  22 +if(isset($_POST["texto"])){
  23 + $gravarTexto = $_POST["texto"];
  24 + $_POST["texto"] = "";
  25 +}
16 26 include_once("admin.php");
17 27 error_reporting(0);
18 28 if(verificaEditores($editores) == "nao")
... ... @@ -21,10 +31,19 @@ $mapfile = &quot;../../temas/&quot;.$_GET[&quot;mapfile&quot;].&quot;.map&quot;;
21 31 if(!file_exists($mapfile))
22 32 {echo "Arquivo $mapfile não existe.";exit;}
23 33 if($_POST["tipo"] == "gravar"){
24   -
25   -exit;
  34 + $fp = fopen($mapfile,"w");
  35 + fwrite($fp,$gravarTexto);
  36 + fclose($fp);
26 37 }
  38 +
27 39 echo "<TEXTAREA name=texto cols=100 rows=20 >";
28 40 echo file_get_contents($mapfile);
29 41 echo "</TEXTAREA>";
30   -?>
31 42 \ No newline at end of file
  43 +echo "<input type=hidden name=tipo value=gravar />";
  44 +?>
  45 +</form>
  46 +<script>
  47 +function testar(){
  48 + window.open("../../testamapfile.php?map=<?php echo $_GET["mapfile"]; ?>");
  49 +}
  50 +</script>
32 51 \ No newline at end of file
... ...
temas/biomashp.map
... ... @@ -80,7 +80,7 @@ MAP
80 80 END
81 81 END
82 82 CLASS
83   - NAME "AMAZONIA"
  83 + NAME "AMAZÔNIA"
84 84 EXPRESSION ('[ID]'eq'1.00')
85 85 STYLE
86 86 ANGLE 360
... ... @@ -90,7 +90,7 @@ MAP
90 90 END
91 91 END
92 92 CLASS
93   - NAME "MATA ATLANTICA"
  93 + NAME "MATA ATLÂNTICA"
94 94 EXPRESSION ('[ID]'eq'4.00')
95 95 STYLE
96 96 ANGLE 360
... ...