Index: branches/SemanticMaps0.8/SM_Settings.php |
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | |
47 | 47 | # Boolean. The default value for the forceshow parameter. Will force a map to be shown even when there are no query results |
48 | 48 | # when set to true. This value will only be used when the user does not provide one. |
49 | | - $smgQPForceShow = false; |
| 49 | + $smgQPForceShow = true; |
50 | 50 | |
51 | 51 | # Boolean. The default value for the showtitle parameter. Will hide the title in the marker pop-ups when set to true. |
52 | 52 | # This value will only be used when the user does not provide one. |
Index: branches/SemanticMaps0.8/includes/queryprinters/SM_MapPrinter.php |
— | — | @@ -165,6 +165,8 @@ |
166 | 166 | $params = $this->parameters; |
167 | 167 | |
168 | 168 | $queryHandler = new SMQueryHandler( $res, $outputmode ); |
| 169 | + $queryHandler->setShowSubject( $params['showtitle'] ); |
| 170 | + |
169 | 171 | $this->handleMarkerData( $params, $queryHandler->getLocations() ); |
170 | 172 | $locationAmount = count( $params['locations'] ); |
171 | 173 | |
Index: branches/SemanticMaps0.8/includes/queryprinters/SM_QueryHandler.php |
— | — | @@ -93,6 +93,15 @@ |
94 | 94 | protected $boldSubject = true; |
95 | 95 | |
96 | 96 | /** |
| 97 | + * Show the subject in the text or not? |
| 98 | + * |
| 99 | + * @since 0.8 |
| 100 | + * |
| 101 | + * @var boolean |
| 102 | + */ |
| 103 | + protected $showSubject = true; |
| 104 | + |
| 105 | + /** |
97 | 106 | * Constructor. |
98 | 107 | * |
99 | 108 | * @since 0.7.3 |
— | — | @@ -162,9 +171,20 @@ |
163 | 172 | */ |
164 | 173 | public function setBoldSubject( $boldSubject ) { |
165 | 174 | $this->boldSubject = $boldSubject; |
166 | | - } |
| 175 | + } |
167 | 176 | |
168 | 177 | /** |
| 178 | + * Sets if the subject should shown in the text. |
| 179 | + * |
| 180 | + * @since 0.8 |
| 181 | + * |
| 182 | + * @param string $showSubject |
| 183 | + */ |
| 184 | + public function setShowSubject( $showSubject ) { |
| 185 | + $this->showSubject = $showSubject; |
| 186 | + } |
| 187 | + |
| 188 | + /** |
169 | 189 | * Gets the query result as a list of locations. |
170 | 190 | * |
171 | 191 | * @since 0.7.3 |
— | — | @@ -258,28 +278,30 @@ |
259 | 279 | $title = $object->getLongText( $this->outputmode, null ); |
260 | 280 | $text = ''; |
261 | 281 | |
262 | | - if ( !$this->titleLinkSeperate && $this->linkAbsolute ) { |
263 | | - $text = Html::element( |
264 | | - 'a', |
265 | | - array( 'href' => $object->getTitle()->getFullUrl() ), |
266 | | - $object->getTitle()->getText() |
267 | | - ); |
| 282 | + if ( $this->showSubject ) { |
| 283 | + if ( !$this->titleLinkSeperate && $this->linkAbsolute ) { |
| 284 | + $text = Html::element( |
| 285 | + 'a', |
| 286 | + array( 'href' => $object->getTitle()->getFullUrl() ), |
| 287 | + $object->getTitle()->getText() |
| 288 | + ); |
| 289 | + } |
| 290 | + else { |
| 291 | + $text = $object->getLongText( $this->outputmode, $wgUser->getSkin() ); |
| 292 | + } |
| 293 | + |
| 294 | + if ( $this->boldSubject ) { |
| 295 | + $text = '<b>' . $text . '</b>'; |
| 296 | + } |
| 297 | + |
| 298 | + if ( $this->titleLinkSeperate ) { |
| 299 | + $text .= Html::element( |
| 300 | + 'a', |
| 301 | + array( 'href' => $object->getTitle()->getFullUrl() ), |
| 302 | + str_replace( '$1', $object->getTitle()->getText(), $this->params['pagelinktext'] ) |
| 303 | + ); |
| 304 | + } |
268 | 305 | } |
269 | | - else { |
270 | | - $text = $object->getLongText( $this->outputmode, $wgUser->getSkin() ); |
271 | | - } |
272 | | - |
273 | | - if ( $this->boldSubject ) { |
274 | | - $text = '<b>' . $text . '</b>'; |
275 | | - } |
276 | | - |
277 | | - if ( $this->titleLinkSeperate ) { |
278 | | - $text .= Html::element( |
279 | | - 'a', |
280 | | - array( 'href' => $object->getTitle()->getFullUrl() ), |
281 | | - str_replace( '$1', $object->getTitle()->getText(), $this->params['pagelinktext'] ) |
282 | | - ); |
283 | | - } |
284 | 306 | |
285 | 307 | return array( $title, $text ); |
286 | 308 | } |