Index: trunk/extensions/SemanticMaps/RELEASE-NOTES |
— | — | @@ -10,6 +10,7 @@ |
11 | 11 | === Semantic Maps 1.0.5 === |
12 | 12 | (201x-xx-xx) |
13 | 13 | |
| 14 | +* Allow properties of type string to be used as title. (bug 32632) |
14 | 15 | |
15 | 16 | === Semantic Maps 1.0.4 === |
16 | 17 | (2011-10-15) |
Index: trunk/extensions/SemanticMaps/includes/queryprinters/SM_QueryHandler.php |
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | * |
62 | 62 | * @var boolean |
63 | 63 | */ |
64 | | - public $titleLinkSeperate; |
| 64 | + public $titleLinkSeparate; |
65 | 65 | |
66 | 66 | /** |
67 | 67 | * Should link targets be made absolute (instead of relative)? |
— | — | @@ -115,13 +115,13 @@ |
116 | 116 | * @param SMWQueryResult $queryResult |
117 | 117 | * @param integer $outputmode |
118 | 118 | */ |
119 | | - public function __construct( SMWQueryResult $queryResult, $outputmode, $linkAbsolute = false, $pageLinkText = '$1', $titleLinkSeperate = false ) { |
| 119 | + public function __construct( SMWQueryResult $queryResult, $outputmode, $linkAbsolute = false, $pageLinkText = '$1', $titleLinkSeparate = false ) { |
120 | 120 | $this->queryResult = $queryResult; |
121 | 121 | $this->outputmode = $outputmode; |
122 | 122 | |
123 | 123 | $this->linkAbsolute = $linkAbsolute; |
124 | 124 | $this->pageLinkText = $pageLinkText; |
125 | | - $this->titleLinkSeperate = $titleLinkSeperate; |
| 125 | + $this->titleLinkSeparate = $titleLinkSeparate; |
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
— | — | @@ -269,10 +269,14 @@ |
270 | 270 | if ( $dataValue->getTypeID() == '_wpg' && $i == 0 ) { |
271 | 271 | list( $title, $text ) = $this->handleResultSubject( $dataValue ); |
272 | 272 | } |
273 | | - elseif ( $dataValue->getTypeID() != '_geo' && $i != 0 ) { |
| 273 | + else if ( $dataValue->getTypeID() == '_str' && $i == 0 ) { |
| 274 | + $title = $dataValue->getLongText( $this->outputmode, null ); |
| 275 | + $text = $dataValue->getLongText( $this->outputmode, $GLOBALS['wgUser']->getSkin() ); |
| 276 | + } |
| 277 | + else if ( $dataValue->getTypeID() != '_geo' && $i != 0 ) { |
274 | 278 | $properties[] = $this->handleResultProperty( $dataValue, $printRequest ); |
275 | 279 | } |
276 | | - elseif ( $printRequest->getMode() == SMWPrintRequest::PRINT_PROP && $printRequest->getTypeID() == '_geo' ) { |
| 280 | + else if ( $printRequest->getMode() == SMWPrintRequest::PRINT_PROP && $printRequest->getTypeID() == '_geo' ) { |
277 | 281 | $dataItem = $dataValue->getDataItem(); |
278 | 282 | |
279 | 283 | $location = MapsLocation::newFromLatLon( $dataItem->getLatitude(), $dataItem->getLongitude() ); |
— | — | @@ -295,23 +299,23 @@ |
296 | 300 | } |
297 | 301 | |
298 | 302 | /** |
299 | | - * Handles a SMWDataValue subject value. |
| 303 | + * Handles a SMWWikiPageValue subject value. |
300 | 304 | * Gets the plain text title and creates the HTML text with headers and the like. |
301 | 305 | * |
302 | 306 | * @since 1.0 |
303 | 307 | * |
304 | | - * @param SMWDataValue $object |
| 308 | + * @param SMWWikiPageValue $object |
305 | 309 | * |
306 | 310 | * @return array with title and text |
307 | 311 | */ |
308 | | - protected function handleResultSubject( SMWDataValue $object ) { |
| 312 | + protected function handleResultSubject( SMWWikiPageValue $object ) { |
309 | 313 | global $wgUser; |
310 | 314 | |
311 | 315 | $title = $object->getLongText( $this->outputmode, null ); |
312 | 316 | $text = ''; |
313 | 317 | |
314 | 318 | if ( $this->showSubject ) { |
315 | | - if ( !$this->titleLinkSeperate && $this->linkAbsolute ) { |
| 319 | + if ( !$this->titleLinkSeparate && $this->linkAbsolute ) { |
316 | 320 | $text = Html::element( |
317 | 321 | 'a', |
318 | 322 | array( 'href' => $object->getTitle()->getFullUrl() ), |
— | — | @@ -326,7 +330,7 @@ |
327 | 331 | $text = '<b>' . $text . '</b>'; |
328 | 332 | } |
329 | 333 | |
330 | | - if ( $this->titleLinkSeperate ) { |
| 334 | + if ( $this->titleLinkSeparate ) { |
331 | 335 | $txt = $object->getTitle()->getText(); |
332 | 336 | |
333 | 337 | if ( $this->pageLinkText !== '' ) { |