Index: trunk/extensions/SemanticMaps/QueryPrinters/SM_QueryPrinters.php |
— | — | @@ -76,7 +76,13 @@ |
77 | 77 | 'not_empty' => array() |
78 | 78 | ), |
79 | 79 | 'default' => false, |
80 | | - ), |
| 80 | + ), |
| 81 | + 'showtitle' => array( |
| 82 | + 'type' => 'boolean', |
| 83 | + 'aliases' => array('show title'), |
| 84 | + 'default' => true, |
| 85 | + 'output-type' => 'boolean' |
| 86 | + ), |
81 | 87 | // SMW #Ask: parameters |
82 | 88 | 'limit' => array( |
83 | 89 | 'type' => 'integer', |
Index: trunk/extensions/SemanticMaps/QueryPrinters/SM_MapPrinter.php |
— | — | @@ -174,6 +174,7 @@ |
175 | 175 | $skin = $wgUser->getSkin(); |
176 | 176 | |
177 | 177 | $title = ''; |
| 178 | + $titleForTemplate = ''; |
178 | 179 | $text = ''; |
179 | 180 | $lat = ''; |
180 | 181 | $lon = ''; |
— | — | @@ -188,7 +189,8 @@ |
189 | 190 | // Loop throught all the parts of the field value |
190 | 191 | while ( ($object = $field->getNextObject()) !== false ) { |
191 | 192 | if ($object->getTypeID() == '_wpg' && $i == 0) { |
192 | | - $title = $object->getLongText($outputmode, $skin); |
| 193 | + if($this->showtitle) $title = $object->getLongText($outputmode, $skin); |
| 194 | + if($this->template) $titleForTemplate = $object->getLongText($outputmode, NULL); |
193 | 195 | } |
194 | 196 | |
195 | 197 | if ($object->getTypeID() != '_geo' && $i != 0) { |
— | — | @@ -206,17 +208,19 @@ |
207 | 209 | } |
208 | 210 | } |
209 | 211 | |
210 | | - if ($this->template) { |
211 | | - global $wgParser; |
212 | | - $text = $wgParser->recursiveTagParse('{{' . $this->template . '|' . implode('|', $label) . '}}'); |
213 | | - } |
214 | | - |
215 | 212 | foreach ($coords as $coord) { |
216 | 213 | if (count($coord) == 2) { |
217 | 214 | list($lat, $lon) = $coord; |
218 | 215 | |
219 | 216 | if (strlen($lat) > 0 && strlen($lon) > 0) { |
220 | 217 | $icon = $this->getLocationIcon($row); |
| 218 | + |
| 219 | + if ($this->template) { |
| 220 | + global $wgParser; |
| 221 | + $segments = array_merge(array($this->template, $titleForTemplate, $lat, $lon), $label); |
| 222 | + $text = $wgParser->recursiveTagParse('{{' . implode('|', $segments) . '}}'); |
| 223 | + } |
| 224 | + |
221 | 225 | $this->m_locations[] = array($lat, $lon, $title, $text, $icon); |
222 | 226 | } |
223 | 227 | |