Changing comments layout preparing for generated documentation with Phpdocumentor
[lhc/web/wiklou.git] / includes / SpecialGeo.php
1 <?php
2 # Copyright (C) 2004 Magnus Manske <magnus.manske@web.de>
3 # http://www.mediawiki.org/
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License along
16 # with this program; if not, write to the Free Software Foundation, Inc.,
17 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 # http://www.gnu.org/copyleft/gpl.html
19
20 /**
21 *
22 */
23
24 /**
25 *
26 */
27 function wfSpecialGeo( $page = '' ) {
28 global $wgOut, $wgLang, $wgRequest;
29 $coordinates = $wgRequest->getText( 'coordinates' ) ;
30 $coordinates = explode ( ":" , $coordinates ) ;
31 $ns = array_shift ( $coordinates ) ;
32 $ew = array_shift ( $coordinates ) ;
33 if ( 0 < count ( $coordinates ) ) $zoom = length ( array_shift ( $coordinates ) ) ;
34 else $zoom = 6 ;
35
36 $ns = explode ( "." , $ns ) ;
37 $ew = explode ( "." , $ew ) ;
38 while ( count ( $ns ) < 3 ) $ns[] = "0" ;
39 while ( count ( $ew ) < 3 ) $ew[] = "0" ;
40
41 $mapquest = "http://www.mapquest.com/maps/map.adp?latlongtype=decimal&latitude={$ns[0]}.{$ns[1]}&longitude={$ew[0]}.{$ew[1]}&zoom={$zoom}" ;
42 $mapquest = "<a href=\"{$mapquest}\">Mapquest</a>" ;
43
44
45 $wgOut->addHTML( "{$mapquest}" ) ;
46 /*
47 if( $wgRequest->getVal( 'action' ) == 'submit') {
48 $page = $wgRequest->getText( 'pages' );
49 $curonly = $wgRequest->getCheck( 'curonly' );
50 } else {
51 # Pre-check the 'current version only' box in the UI
52 $curonly = true;
53 }
54
55 if( $page != "" ) {
56 header( "Content-type: application/xml; charset=utf-8" );
57 $pages = explode( "\n", $page );
58 $xml = pages2xml( $pages, $curonly );
59 echo $xml;
60 wfAbruptExit();
61 }
62
63 $wgOut->addWikiText( wfMsg( "exporttext" ) );
64 $titleObj = Title::makeTitle( NS_SPECIAL, "Export" );
65 $action = $titleObj->escapeLocalURL();
66 $wgOut->addHTML( "
67 <form method='post' action=\"$action\">
68 <input type='hidden' name='action' value='submit' />
69 <textarea name='pages' cols='40' rows='10'></textarea><br />
70 <label><input type='checkbox' name='curonly' value='true' checked='checked' />
71 " . wfMsg( "exportcuronly" ) . "</label><br />
72 <input type='submit' />
73 </form>
74 " );
75 */
76 }
77
78 ?>