Index: trunk/extensions/Maps/ParserFunctions/DisplayPoint/Maps_DisplayPoint.php |
— | — | @@ -80,7 +80,12 @@ |
81 | 81 | ), |
82 | 82 | 'label' => array( |
83 | 83 | 'default' => $egMapsDefaultLabel |
84 | | - ), |
| 84 | + ), |
| 85 | + 'icon' => array( |
| 86 | + 'criteria' => array( |
| 87 | + 'not_empty' => array() |
| 88 | + ) |
| 89 | + ), |
85 | 90 | )); |
86 | 91 | } |
87 | 92 | |
Index: trunk/extensions/Maps/ParserFunctions/DisplayPoint/Maps_BasePointMap.php |
— | — | @@ -97,17 +97,32 @@ |
98 | 98 | $markerData = MapsUtils::getLatLon($args[0]); |
99 | 99 | |
100 | 100 | if (count($args) > 1) { |
| 101 | + // Parse and add the point specific title if it's present. |
101 | 102 | $markerData['title'] = $this->doEscaping( $parser->recursiveTagParse( $args[1] ) ); |
102 | 103 | |
103 | 104 | if (count($args) > 2) { |
| 105 | + // Parse and add the point specific label if it's present. |
104 | 106 | $markerData['label'] = $this->doEscaping( $parser->recursiveTagParse( $args[2] ) ); |
105 | 107 | |
106 | 108 | if (count($args) > 3) { |
| 109 | + // Add the point specific icon if it's present. |
107 | 110 | $markerData['icon'] = $args[3]; |
108 | | - } |
| 111 | + } |
109 | 112 | } |
110 | 113 | } |
111 | | - |
| 114 | + |
| 115 | + // If there is no point specific icon, use the general icon parameter when available. |
| 116 | + if (! array_key_exists('icon', $markerData) && strlen($this->icon) > 0) $markerData['icon'] = $this->icon; |
| 117 | + |
| 118 | + // Get the url for the icon when there is one, else set the icon to an empty string. |
| 119 | + if (array_key_exists('icon', $markerData)) { |
| 120 | + $icon_image_page = new ImagePage( Title::newFromText( $markerData['icon'] ) ); |
| 121 | + $markerData['icon'] = $icon_image_page->getDisplayedFile()->getURL(); |
| 122 | + } |
| 123 | + else { |
| 124 | + $markerData['icon'] = ''; |
| 125 | + } |
| 126 | + |
112 | 127 | $this->markerData[] = $markerData; |
113 | 128 | } |
114 | 129 | } |
— | — | @@ -124,10 +139,8 @@ |
125 | 140 | $title = array_key_exists('title', $markerData) ? $markerData['title'] : $this->title; |
126 | 141 | $label = array_key_exists('label', $markerData) ? $markerData['label'] : $this->label; |
127 | 142 | |
128 | | - $icon = array_key_exists('icon', $markerData) ? $markerData['icon'] : ''; |
129 | | - |
130 | 143 | $markerItems[] = str_replace( array('lon', 'lat', 'title', 'label', 'icon'), |
131 | | - array($markerData['lon'], $markerData['lat'], $title, $label, $icon), |
| 144 | + array($markerData['lon'], $markerData['lat'], $title, $label, $markerData['icon']), |
132 | 145 | $this->markerStringFormat |
133 | 146 | ); |
134 | 147 | } |
Index: trunk/extensions/Maps/Maps.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | echo '<b>Warning:</b> You need to have <a href="http://www.mediawiki.org/wiki/Extension:Validator">Validator</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Maps">Maps</a>.'; |
35 | 35 | } |
36 | 36 | else { |
37 | | - define('Maps_VERSION', '0.5.2 rc1'); |
| 37 | + define('Maps_VERSION', '0.5.2 rc2'); |
38 | 38 | |
39 | 39 | $egMapsScriptPath = $wgScriptPath . '/extensions/Maps'; |
40 | 40 | $egMapsIP = $IP . '/extensions/Maps'; |
Index: trunk/extensions/Maps/Maps_Mapper.php |
— | — | @@ -31,12 +31,14 @@ |
32 | 32 | 'zoom' => array( |
33 | 33 | 'type' => 'integer', |
34 | 34 | 'criteria' => array( |
| 35 | + 'not_empty' => array(), |
35 | 36 | 'in_range' => array(0, 15) |
36 | | - ) |
| 37 | + ) |
37 | 38 | ), |
38 | 39 | 'width' => array( |
39 | 40 | 'type' => 'integer', |
40 | 41 | 'criteria' => array( |
| 42 | + 'not_empty' => array(), |
41 | 43 | 'in_range' => $egMapsSizeRestrictions['width'] |
42 | 44 | ), |
43 | 45 | 'default' => $egMapsMapWidth |
— | — | @@ -44,6 +46,7 @@ |
45 | 47 | 'height' => array( |
46 | 48 | 'type' => 'integer', |
47 | 49 | 'criteria' => array( |
| 50 | + 'not_empty' => array(), |
48 | 51 | 'in_range' => $egMapsSizeRestrictions['height'] |
49 | 52 | ), |
50 | 53 | 'default' => $egMapsMapHeight |