Index: trunk/extensions/gis/mapsources.php |
— | — | @@ -31,10 +31,6 @@ |
32 | 32 | |
33 | 33 | include_once ( "gissettings.php" ) ; |
34 | 34 | |
35 | | -# if ( isset ( $wikibasedir ) ) |
36 | | -# { |
37 | | -# require_once( "{$wikibasedir}/extensions/gis/geo.php" ); |
38 | | -# } |
39 | 35 | require_once( 'transversemercator.php' ); |
40 | 36 | |
41 | 37 | /** |
— | — | @@ -59,10 +55,10 @@ |
60 | 56 | $wgOut->setRobotpolicy( 'noindex,nofollow' ); |
61 | 57 | |
62 | 58 | $wgOut->setPagetitle( $this->mapsources ); |
63 | | - $this->showList(); |
| 59 | + $wgOut->addWikiText( $this->build_output() ); |
64 | 60 | } |
65 | 61 | |
66 | | - function showList() { |
| 62 | + function build_output() { |
67 | 63 | global $wgOut, $wgUser, $wgContLang; |
68 | 64 | |
69 | 65 | if (($e = $this->p->get_error()) != "") { |
— | — | @@ -70,7 +66,7 @@ |
71 | 67 | "<p>" . htmlspecialchars( $e ) . "</p>"); |
72 | 68 | $wgOut->output(); |
73 | 69 | wfErrorExit(); |
74 | | - return; |
| 70 | + return ""; |
75 | 71 | } |
76 | 72 | |
77 | 73 | $attr = $this->p->get_attr(); |
— | — | @@ -219,17 +215,17 @@ |
220 | 216 | $wgOut->addHTML( |
221 | 217 | "<p>". |
222 | 218 | htmlspecialchars( "Please add this page: ". |
223 | | - $bstitle->getText() )); |
| 219 | + $bstitle->getText() )."</p>"); |
224 | 220 | $wgOut->output(); |
225 | 221 | wfErrorExit(); |
226 | | - return; |
| 222 | + return ""; |
227 | 223 | } |
228 | 224 | $bstext = $bsarticle->getContent( false ); # allow redir |
229 | 225 | |
230 | 226 | /* |
231 | 227 | * Replace in page |
232 | 228 | */ |
233 | | - $out = str_replace( "{latdegdec}", $lat['deg'], |
| 229 | + return str_replace( "{latdegdec}", $lat['deg'], |
234 | 230 | str_replace( "{londegdec}", $lon['deg'], |
235 | 231 | str_replace( "{londegneg}", -$lon['deg'], |
236 | 232 | str_replace( "{latdegint}", $latdegint, |
— | — | @@ -265,7 +261,6 @@ |
266 | 262 | str_replace( "{region}", $attr['region'], |
267 | 263 | str_replace( "{page}", $attr['page'], |
268 | 264 | $bstext ))))))))))))))))))))))))))))))))))); |
269 | | - $wgOut->addWikiText( $out ); |
270 | 265 | } |
271 | 266 | } |
272 | 267 | |
Index: trunk/extensions/gis/maparea.php |
— | — | @@ -81,9 +81,11 @@ |
82 | 82 | $lat = ($x->gis_latitude_min+$x->gis_latitude_max)/2; |
83 | 83 | $lon = ($x->gis_longitude_min+$x->gis_longitude_max)/2; |
84 | 84 | $type = $x->gis_type; |
| 85 | + $name = $g->get_title($id); |
85 | 86 | if ($type == "") $type = "unknown"; |
86 | | - $out .= "==[[" . $g->get_title($id) . "]]==\r\n" |
| 87 | + $out .= "==[[" . $name . "]]==\r\n" |
87 | 88 | . ";type:" . $type . "\r\n" |
| 89 | + . ";name:" . $name . "\r\n" |
88 | 90 | . ";data:" . $this->map_pos($lat,$lon) . "\r\n" |
89 | 91 | . "\r\n"; |
90 | 92 | } |
Index: trunk/extensions/gis/index.php |
— | — | @@ -31,6 +31,8 @@ |
32 | 32 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
33 | 33 | */ |
34 | 34 | |
| 35 | +$wgGisVersion = '0.1alpha'; |
| 36 | + |
35 | 37 | include_once ( "gissettings.php" ) ; |
36 | 38 | |
37 | 39 | if ( isset ( $wikibasedir ) ) |
— | — | @@ -46,29 +48,26 @@ |
47 | 49 | require_once( "mapsources.php"); |
48 | 50 | require_once( "neighbors.php"); |
49 | 51 | require_once( "maparea.php"); |
| 52 | +require_once( "gisversion.php"); |
50 | 53 | |
51 | 54 | if ( isset ( $_GET['geo'] ) ) { |
52 | 55 | $geo = urldecode ( $_GET['geo'] ); |
53 | 56 | $title = urldecode ( $_GET['title'] ); |
| 57 | + $bsl = new map_sources( $geo, $title ); |
| 58 | + $bsl->show(); |
54 | 59 | } else if ( isset ( $_GET['near'] ) ) { |
55 | 60 | $near = urldecode ( $_GET['near'] ) ; |
56 | 61 | $dist = urldecode ( $_GET['dist'] ) ; |
57 | 62 | $title = urldecode ( $_GET['title'] ); |
| 63 | + $bsl = new neighbors( $near, $dist, $title ); |
| 64 | + $bsl->show(); |
58 | 65 | } else if ( isset ( $_GET['maparea'] ) ) { |
59 | 66 | $maparea = urldecode ( $_GET['maparea'] ) ; |
60 | | -} |
61 | | - |
62 | | -# FIXME: if no params, then what? |
63 | | - |
64 | | -if ($maparea != "") { |
65 | 67 | $bsl = new maparea( $maparea ); |
66 | 68 | $bsl->show(); |
67 | | -} else if ($near != "") { |
68 | | - $bsl = new neighbors( $near, $dist, $title ); |
| 69 | +} else if ( isset ( $_GET['version'] ) ) { |
| 70 | + $bsl = new gis_version( ); |
69 | 71 | $bsl->show(); |
70 | | -} else { |
71 | | - $bsl = new map_sources( $geo, $title ); |
72 | | - $bsl->show(); |
73 | 72 | } |
74 | 73 | |
75 | 74 | $wgOut->output(); |
Index: trunk/extensions/gis/gisversion.php |
— | — | @@ -0,0 +1,68 @@ |
| 2 | +<?php |
| 3 | +/** \file |
| 4 | + * |
| 5 | + * Show version information |
| 6 | + * |
| 7 | + * \todo Make hook for Special:Version instead |
| 8 | + * |
| 9 | + * ---------------------------------------------------------------------- |
| 10 | + * |
| 11 | + * Copyright 2005, Egil Kvaleberg <egil@kvaleberg.no> |
| 12 | + * |
| 13 | + * This program is free software; you can redistribute it and/or modify |
| 14 | + * it under the terms of the GNU General Public License as published by |
| 15 | + * the Free Software Foundation; either version 2 of the License, or |
| 16 | + * (at your option) any later version. |
| 17 | + * |
| 18 | + * This program is distributed in the hope that it will be useful, |
| 19 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 | + * GNU General Public License for more details. |
| 22 | + * |
| 23 | + * You should have received a copy of the GNU General Public License |
| 24 | + * along with this program; if not, write to the Free Software |
| 25 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 26 | + */ |
| 27 | + |
| 28 | +include_once ( "gissettings.php" ) ; |
| 29 | + |
| 30 | +/** |
| 31 | + * Base class |
| 32 | + */ |
| 33 | +class gis_version { |
| 34 | + function gis_version( ) { |
| 35 | + } |
| 36 | + |
| 37 | + function show() { |
| 38 | + global $wgOut, $wgUser, $wgContLang; |
| 39 | + global $wgVersion, $wgGisVersion; |
| 40 | + |
| 41 | + $wgOut->setPagetitle( "Version" ); |
| 42 | + $wgOut->addHTML( ' |
| 43 | + <p><b><a href="http://www.mediawiki.org/">MediaWiki</a></b> |
| 44 | + <a href="http://meta.wikimedia.org/wiki/Gis">GIS extension</a>, |
| 45 | + copyright (C) 2005 by Egil Kvaleberg.</p> |
| 46 | + |
| 47 | + <p>The GIS extension is free software; you can redistribute it and/or modify |
| 48 | + it under the terms of the GNU General Public License as published by |
| 49 | + the Free Software Foundation; either version 2 of the License, or |
| 50 | + (at your option) any later version.</p> |
| 51 | + |
| 52 | + <p>The GIS extension is distributed in the hope that it will be useful, |
| 53 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 54 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 55 | + GNU General Public License for more details.</p> |
| 56 | + |
| 57 | + <p>You should have received <a href="../COPYING">a copy of the GNU General Public License</a> |
| 58 | + along with this program; if not, write to the Free Software |
| 59 | + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 60 | + or <a href="http://www.gnu.org/copyleft/gpl.html">read it online</a></p> |
| 61 | +'); |
| 62 | + $out .= ":GIS extension: $wgGisVersion\n"; |
| 63 | + $out .= ":MediaWiki: $wgVersion\n"; |
| 64 | + |
| 65 | + $wgOut->addWikiText( $out ); |
| 66 | + } |
| 67 | +} |
| 68 | + |
| 69 | +?> |
Property changes on: trunk/extensions/gis/gisversion.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 70 | + native |
Added: svn:keywords |
2 | 71 | + Author Date Id Revision |