Commit 936d88288d9c16adeec22dd46012bf0e34365524

Authored by Edmar Moretti
1 parent 9acb1f2a

Correção na formação da string da tag onlineresource e da lista de serviços na opção "lista=temas"

Showing 1 changed file with 38 additions and 12 deletions   Show diff stats
@@ -100,30 +100,56 @@ else @@ -100,30 +100,56 @@ else
100 } 100 }
101 } 101 }
102 if(!isset($menus)) 102 if(!isset($menus))
103 -$menus = array("/opt/www/html/i3geo/menutemas/menutemas.xml"); 103 +$menus = array("menutemas/menutemas.xml");
104 //pega a lista de grupos 104 //pega a lista de grupos
105 if ($lista == "temas") 105 if ($lista == "temas")
106 { 106 {
107 - echo "<b>Lista de temas por grupos e subgrupos (os códigos dos temas estão em vermelho)</b><br><br>"; 107 + echo "<b>Lista de temas por grupos e subgrupos e endereços de acesso aos dados por meio de Web Services WMS (os códigos dos temas estão em vermelho)</b><br><br>";
  108 + $imprimir = "";
108 foreach ($menus as $menu) 109 foreach ($menus as $menu)
109 { 110 {
110 $xml = simplexml_load_file($menu); 111 $xml = simplexml_load_file($menu);
111 foreach($xml->GRUPO as $grupo) 112 foreach($xml->GRUPO as $grupo)
112 { 113 {
113 - echo "<br><b>".mb_convert_encoding($grupo->GTIPO,"HTML-ENTITIES","auto")."</b><br>"; 114 + $imprimegrupo = "<i>".mb_convert_encoding($grupo->GTIPO,"HTML-ENTITIES","auto")."</i>";
114 foreach($grupo->SGRUPO as $sgrupo) 115 foreach($grupo->SGRUPO as $sgrupo)
115 { 116 {
116 - echo "&nbsp;&nbsp;&nbsp;".mb_convert_encoding($sgrupo->SDTIPO,"HTML-ENTITIES","auto")."<br>"; 117 + $imprimesubgrupo = mb_convert_encoding($sgrupo->SDTIPO,"HTML-ENTITIES","auto");
117 foreach($sgrupo->TEMA as $tema) 118 foreach($sgrupo->TEMA as $tema)
118 { 119 {
119 if (mb_convert_encoding($tema->OGC,"HTML-ENTITIES","auto") == "") 120 if (mb_convert_encoding($tema->OGC,"HTML-ENTITIES","auto") == "")
120 { 121 {
121 - echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";  
122 - echo "<span style=color:red >".mb_convert_encoding($tema->TID,"HTML-ENTITIES","auto")."</span>";  
123 - echo "&nbsp;-&nbsp;".mb_convert_encoding($tema->TNOME,"HTML-ENTITIES","auto")." - "; 122 + $imprimir .= $imprimegrupo."->".$imprimesubgrupo."<br>";
  123 + $imprimir .= "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
  124 + $id = mb_convert_encoding($tema->TID,"HTML-ENTITIES","auto");
  125 + $imprimir .= "<span style=color:red >".$id."</span>";
  126 + $imprimir .= "&nbsp;-&nbsp;".mb_convert_encoding($tema->TNOME,"HTML-ENTITIES","auto")."&nbsp";
  127 + $imprimir .= "&nbsp;<a href='".$urli3geo."/ogc.php?tema=".$id."&service=wms&request=getcapabilities' >Getcapabilities</a>";
124 if (mb_convert_encoding($tema->TLINK,"HTML-ENTITIES","auto") != "") 128 if (mb_convert_encoding($tema->TLINK,"HTML-ENTITIES","auto") != "")
125 - {echo "<a href='".mb_convert_encoding($tema->TLINK,"HTML-ENTITIES","auto")."' >fonte</a>";}  
126 - echo "<br>"; 129 + {$imprimir .= "&nbsp;&nbsp;<a href='".mb_convert_encoding($tema->TLINK,"HTML-ENTITIES","auto")."' >fonte</a>";}
  130 + $imprimir .= "<br>";
  131 + }
  132 + }
  133 + }
  134 + }
  135 + }
  136 + echo $imprimir;
  137 + return;
  138 +}
  139 +if ($lista == "sitemap")
  140 +{
  141 + foreach ($menus as $menu)
  142 + {
  143 + $xml = simplexml_load_file($menu);
  144 + foreach($xml->GRUPO as $grupo)
  145 + {
  146 + foreach($grupo->SGRUPO as $sgrupo)
  147 + {
  148 + foreach($sgrupo->TEMA as $tema)
  149 + {
  150 + if (mb_convert_encoding($tema->OGC,"HTML-ENTITIES","auto") == "")
  151 + {
  152 + echo $urli3geo."/ogc.php?tema=".mb_convert_encoding($tema->TID,"HTML-ENTITIES","auto")."&service=wms&request=getcapabilities<br>";
127 } 153 }
128 } 154 }
129 } 155 }
@@ -160,9 +186,8 @@ foreach ($_GET as $k=&gt;$v) @@ -160,9 +186,8 @@ foreach ($_GET as $k=&gt;$v)
160 {$tema = $v;} 186 {$tema = $v;}
161 //if(strtolower($k) == "srs") 187 //if(strtolower($k) == "srs")
162 //{$SRS = $v;} 188 //{$SRS = $v;}
163 -  
164 } 189 }
165 -if(isset($tema)) 190 +if(isset($tema) && $tipo != "metadados")
166 {$tipo = "";} 191 {$tipo = "";}
167 $req->setParameter("VeRsIoN","1.1.0"); 192 $req->setParameter("VeRsIoN","1.1.0");
168 $oMap = ms_newMapobj("aplicmap/ogcws.map"); 193 $oMap = ms_newMapobj("aplicmap/ogcws.map");
@@ -178,7 +203,8 @@ $proto = &quot;http&quot; . ((isset($_SERVER[&#39;HTTPS&#39;]) &amp;&amp; $_SERVER[&#39;HTTPS&#39;] == &quot;on&quot;) ? &quot;s&quot; @@ -178,7 +203,8 @@ $proto = &quot;http&quot; . ((isset($_SERVER[&#39;HTTPS&#39;]) &amp;&amp; $_SERVER[&#39;HTTPS&#39;] == &quot;on&quot;) ? &quot;s&quot;
178 $server = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']; 203 $server = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];
179 $or = $proto.$server.$_SERVER['PHP_SELF']; 204 $or = $proto.$server.$_SERVER['PHP_SELF'];
180 if((isset($tema)) && ($tema != "") && ($tipo=="metadados")) 205 if((isset($tema)) && ($tema != "") && ($tipo=="metadados"))
181 -{$or = $or."tema=".$tema."&";} 206 +{$or = $or."?tema=".$tema."&";}
  207 +
182 $oMap->setmetadata("ows_onlineresource",$or); 208 $oMap->setmetadata("ows_onlineresource",$or);
183 $oMap->setmetadata("ows_title",$tituloInstituicao." - i3geo"); 209 $oMap->setmetadata("ows_title",$tituloInstituicao." - i3geo");
184 if (!isset($intervalo)) 210 if (!isset($intervalo))