Revision: 43487
Author: siebrand
Date: 2008-11-14 10:41:54 +0000 (Fri, 14 Nov 2008)
Log Message:
-----------
Fix another bunch of PHP notices, and prettify the error messages a bit if
multiple parameters are missing.
Modified Paths:
--------------
trunk/extensions/SlippyMap/SlippyMap.class.php
Modified: trunk/extensions/SlippyMap/SlippyMap.class.php
===================================================================
--- trunk/extensions/SlippyMap/SlippyMap.class.php 2008-11-14 10:17:58 UTC
(rev 43486)
+++ trunk/extensions/SlippyMap/SlippyMap.class.php 2008-11-14 10:41:54 UTC
(rev 43487)
@@ -64,28 +64,38 @@
// Receive new style args: <slippymap aaa=bbb
ccc=ddd></slippymap>
if ( isset( $argv['lat'] ) ) {
$lat = $argv['lat'];
+ } else if ( isset( $oldStyleParams['lat'] ) ) {
+ $lat = $oldStyleParams['lat'];
} else {
- $lat = $oldStyleParams['lat'];
+ $lat = '';
}
if ( isset( $argv['lon'] ) ) {
$lon = $argv['lon'];
+ } else if ( isset( $oldStyleParams['lon'] ) ) {
+ $layer = $oldStyleParams['lon'];
} else {
- $lon = $oldStyleParams['lon'];
+ $layer = '';
}
if ( isset( $argv['z'] ) ) {
$zoom = $argv['z'];
+ } else if ( isset( $oldStyleParams['z'] ) ) {
+ $zoom = $oldStyleParams['z'];
} else {
- $zoom = $oldStyleParams['z'];
+ $zoom = '';
}
if ( isset( $argv['w'] ) ) {
$width = $argv['w'];
+ } else if ( isset( $oldStyleParams['w'] ) ) {
+ $width = $oldStyleParams['w'];
} else {
- $width = $oldStyleParams['w'];
+ $width = '';
}
if ( isset( $argv['h'] ) ) {
$height = $argv['h'];
+ } else if ( isset( $oldStyleParams['h'] ) ) {
+ $height = $oldStyleParams['h'];
} else {
- $height = $oldStyleParams['h'];
+ $height = '';
}
if ( isset( $argv['layer'] ) ) {
$layer = $argv['layer'];
@@ -129,9 +139,9 @@
}
// Check required parameters values are provided
- if ( $lat == '' ) $error .= wfMsg( 'slippymap_latmissing' );
- if ( $lon == '' ) $error .= wfMsg( 'slippymap_lonmissing' );
- if ( $zoom == '' ) $error .= wfMsg( 'slippymap_zoommissing' );
+ if ( $lat == '' ) $error .= wfMsg( 'slippymap_latmissing' ) .
' ';
+ if ( $lon == '' ) $error .= wfMsg( 'slippymap_lonmissing' ) .
' ';
+ if ( $zoom == '' ) $error .= wfMsg( 'slippymap_zoommissing' ) .
' ';
if ( $error == '' ) {
// no errors so far. Now check the values
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs