Index: branches/Maps0.8/Maps_Settings.php |
— | — | @@ -208,7 +208,7 @@ |
209 | 209 | |
210 | 210 | # Integer or string. The default width and height of a map. These values will |
211 | 211 | # only be used when the user does not provide them. |
212 | | - $egMapsMapWidth = '100%'; |
| 212 | + $egMapsMapWidth = 'auto'; |
213 | 213 | $egMapsMapHeight = 350; |
214 | 214 | |
215 | 215 | # Array. The minimum and maximum width and height for all maps. First min and |
Index: branches/Maps0.8/includes/manipulations/Maps_ParamDimension.php |
— | — | @@ -39,8 +39,12 @@ |
40 | 40 | * @since 0.7 |
41 | 41 | */ |
42 | 42 | public function doManipulation( &$value, Parameter $parameter, array &$parameters ) { |
43 | | - global $egMapsSizeRestrictions; |
| 43 | + global $egMapsSizeRestrictions, $egMapsMapWidth, $egMapsMapHeight; |
44 | 44 | |
| 45 | + if ( $value == 'auto' && $this->dimension == 'width' ) { |
| 46 | + return; |
| 47 | + } |
| 48 | + |
45 | 49 | // Set the default if the value is not valid. |
46 | 50 | if ( !preg_match( '/^\d+(\.\d+)?(px|ex|em|%)?$/', $value ) ) { |
47 | 51 | $value = $this->dimension == 'width' ? $egMapsMapWidth : $egMapsMapHeight; |
— | — | @@ -75,4 +79,4 @@ |
76 | 80 | } |
77 | 81 | } |
78 | 82 | |
79 | | -} |
\ No newline at end of file |
| 83 | +} |
Index: branches/Maps0.8/includes/criteria/CriterionMapDimension.php |
— | — | @@ -39,6 +39,10 @@ |
40 | 40 | protected function doValidation( $value, Parameter $parameter, array $parameters ) { |
41 | 41 | global $egMapsSizeRestrictions; |
42 | 42 | |
| 43 | + if ( $value == 'auto' && $this->dimension == 'width' ) { |
| 44 | + return true; |
| 45 | + } |
| 46 | + |
43 | 47 | // See if the notation is valid. |
44 | 48 | if ( !preg_match( '/^\d+(\.\d+)?(px|ex|em|%)?$/', $value ) ) { |
45 | 49 | return false; |