r98036 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98035‎ | r98036 | r98037 >
Date:21:39, 24 September 2011
Author:jeroendedauw
Status:deferred (Comments)
Tags:
Comment:
throw out b/c code as this compat has been lost already anyway
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QueryPrinter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QueryPrinter.php
@@ -96,8 +96,6 @@
9797 /// This can be set in LocalSettings.php, but only after enableSemantics().
9898 public static $maxRecursionDepth = 2;
9999
100 - protected $useValidator;
101 -
102100 /**
103101 * Return serialised results in specified format.
104102 * Implemented by subclasses.
@@ -110,16 +108,16 @@
111109 *
112110 * @param string $format
113111 * @param $inline
114 - * @param boolean $useValidator Since 1.6
 112+ * @param boolean $useValidator Depracted since 1.6.2
115113 */
116114 public function __construct( $format, $inline, $useValidator = false ) {
117115 global $smwgQDefaultLinking;
 116+
118117 $this->mFormat = $format;
119118 $this->mInline = $inline;
120119 $this->mLinkFirst = ( $smwgQDefaultLinking != 'none' );
121120 $this->mLinkOthers = ( $smwgQDefaultLinking == 'all' );
122121 $this->mLinker = class_exists( 'DummyLinker' ) ? new DummyLinker : new Linker; ///TODO: how can we get the default or user skin here (depending on context)?
123 - $this->useValidator = $useValidator;
124122 }
125123
126124 /**
@@ -157,12 +155,7 @@
158156 $this->isHTML = false;
159157 $this->hasTemplates = false;
160158
161 - if ( $this->useValidator ) {
162 - $this->handleParameters( $params, $outputmode );
163 - }
164 - else {
165 - $this->readParameters( $params, $outputmode );
166 - }
 159+ $this->handleParameters( $params, $outputmode );
167160
168161 // Default output for normal printers:
169162 if ( ( $outputmode != SMW_OUTPUT_FILE ) && // not in FILE context,
@@ -329,64 +322,7 @@
330323 $this->mShowHeaders = SMW_HEADERS_SHOW;
331324 }
332325 }
333 -
334 - /**
335 - * Read an array of parameter values given as key-value-pairs and
336 - * initialise internal member fields accordingly. Possibly overwritten
337 - * (extended) by subclasses.
338 - *
339 - * @param array $params
340 - * @param $outputmode
341 - *
342 - * @deprecated Use handleParameters instead
343 - */
344 - protected function readParameters( $params, $outputmode ) {
345 - $this->m_params = $params;
346326
347 - if ( array_key_exists( 'intro', $params ) ) {
348 - $this->mIntro = $params['intro'];
349 - }
350 -
351 - if ( array_key_exists( 'outro', $params ) ) {
352 - $this->mOutro = $params['outro'];
353 - }
354 -
355 - if ( array_key_exists( 'searchlabel', $params ) ) {
356 - $this->mSearchlabel = $params['searchlabel'];
357 - }
358 -
359 - if ( array_key_exists( 'link', $params ) ) {
360 - switch ( strtolower( trim( $params['link'] ) ) ) {
361 - case 'head': case 'subject':
362 - $this->mLinkFirst = true;
363 - $this->mLinkOthers = false;
364 - break;
365 - case 'all':
366 - $this->mLinkFirst = true;
367 - $this->mLinkOthers = true;
368 - break;
369 - case 'none':
370 - $this->mLinkFirst = false;
371 - $this->mLinkOthers = false;
372 - break;
373 - }
374 - }
375 -
376 - if ( array_key_exists( 'default', $params ) ) {
377 - $this->mDefault = str_replace( '_', ' ', $params['default'] );
378 - }
379 -
380 - if ( array_key_exists( 'headers', $params ) ) {
381 - if ( strtolower( trim( $params['headers'] ) ) == 'hide' ) {
382 - $this->mShowHeaders = SMW_HEADERS_HIDE;
383 - } elseif ( strtolower( trim( $params['headers'] ) ) == 'plain' ) {
384 - $this->mShowHeaders = SMW_HEADERS_PLAIN;
385 - } else {
386 - $this->mShowHeaders = SMW_HEADERS_SHOW;
387 - }
388 - }
389 - }
390 -
391327 /**
392328 * Depending on current linking settings, returns a linker object
393329 * for making hyperlinks or NULL if no links should be created.

Follow-up revisions

RevisionCommit summaryAuthorDate
r98064Follow up to r98036;jeroendedauw13:37, 25 September 2011
r98488refactoring nessasery because of changes in r98036...dasch23:20, 29 September 2011

Comments

#Comment by Nikerabbit (talk | contribs)   07:06, 25 September 2011

Typo Depracted.