[MediaWiki-commits] [Gerrit] Call Linker methods statically - change (mediawiki...SolrStore)

2014-01-23 Thread Parent5446 (Code Review)
Parent5446 has submitted this change and it was merged.

Change subject: Call Linker methods statically
..


Call Linker methods statically

Change-Id: I7796ed1a285bfe50b6701bf1d2738c40fb01ff6f
---
M SpecialSolrSearch.php
1 file changed, 12 insertions(+), 21 deletions(-)

Approvals:
  Parent5446: Verified; Looks good to me, approved



diff --git a/SpecialSolrSearch.php b/SpecialSolrSearch.php
index 220e670..f98068d 100644
--- a/SpecialSolrSearch.php
+++ b/SpecialSolrSearch.php
@@ -2,14 +2,13 @@
 
 /**
  * SolrStore: The SolrStore Extesion is Semantic Mediawiki Searchprovieder 
based on Apache Solr.
- * 
+ *
  * This is the SpecialPage, displaying the SearchSets and Results
- * 
+ *
  * @defgroup SolrStore
  * @author Simon Bachenberg, Sascha Schueller
  */
 class SpecialSolrSearch extends SpecialPage {
-
/**
 * Set up basic search parameters from the request and user settings.
 * Typically you'll pass $wgRequest and $wgUser.
@@ -19,12 +18,10 @@
 */
public function __construct() {
parent::__construct( SolrSearch );
-   global $wgRequest, $wgUser;
-   $user = $wgUser;
+   global $wgRequest;
$request = $wgRequest;
list( $this-limit, $this-offset ) = $request-getLimitOffset( 
20, 'searchlimit' );
 
-   $this-sk = $user-getSkin();
$this-didYouMeanHtml = ''; # html of did you mean... link
}
 
@@ -79,9 +76,6 @@
global $wgOut, $wgUser, $wgScript, $wgSolrFields;
wfProfileIn( __METHOD__ );
 
-   //$sk = $wgUser-getSkin ();
-
-
$wgOut-setPageTitle( wfMsg( 'solrstore-searchFieldSets-title' 
) );
$wgOut-setHTMLTitle( wfMsg( 'pagetitle', wfMsg( 
'solrstore-searchFieldSets-title', 'SolrSearch: Select FieldSet' ) ) );
 
@@ -105,10 +99,8 @@
 * @param $fieldSet String
 */
public function showResults( $fieldSet ) {
-   global $wgOut, $wgUser, $wgContLang, $wgScript, 
$wgSolrShowRelated, $wgSolrDebug;
+   global $wgOut, $wgContLang, $wgScript, $wgSolrShowRelated, 
$wgSolrDebug;
wfProfileIn( __METHOD__ );
-
-   $sk = $wgUser-getSkin();
 
$this-searchEngine = SearchEngine::create();
$search =  $this-searchEngine;
@@ -166,7 +158,7 @@
if ( $suggestionSnippet == '' )
$suggestionSnippet = null;
 
-   $suggestLink = $sk-linkKnown(
+   $suggestLink = Linker::linkKnown(
$st, $suggestionSnippet, array( 
), $stParams
);
 
@@ -369,7 +361,7 @@
 * @param $fieldSets Array: terms to highlight
 */
protected function showHit( $result, $fieldSets ) {
-   global $wgLang, $wgUser;
+   global $wgLang;
wfProfileIn( __METHOD__ );
 
if ( $result-isBrokenTitle() ) {
@@ -377,7 +369,6 @@
return !-- Broken link in search result --\n;
}
 
-   $sk = $wgUser-getSkin();
$t = $result-getTitle();
 
$titleSnippet = $result-getTitleSnippet( $fieldSets );
@@ -389,7 +380,7 @@
 
wfRunHooks( 'ShowSearchHitTitle', array( $link_t, 
$titleSnippet, $result, $fieldSets, $this ) );
 
-   $link = $this-sk-linkKnown(
+   $link = Linker::linkKnown(
$link_t, $titleSnippet
);
// FÜLLEN
@@ -423,7 +414,7 @@
$redirectText = null;
 
$redirect = span class='searchalttitle' .
-   wfMsg( 'search-redirect', 
$this-sk-linkKnown( $redirectTitle, $redirectText ) ) .
+   wfMsg( 'search-redirect', 
Linker::linkKnown( $redirectTitle, $redirectText ) ) .
/span;
}
 
@@ -435,7 +426,7 @@
$sectionText = null;
 
$section = span class='searchalttitle' .
-   wfMsg( 'search-section', 
$this-sk-linkKnown( $sectionTitle, $sectionText ) ) .
+   wfMsg( 'search-section', 
Linker::linkKnown( $sectionTitle, $sectionText ) ) .
/span;
}
 
@@ -455,7 +446,7 @@
$byteSize = $result-getByteSize();
$wordCount = $result-getWordCount();
$timestamp = $result-getTimestamp();
-   $size = wfMsgExt( 'search-result-size', array( 'parsemag', 
'escape' ), $this-sk-formatSize( $byteSize ), $wgLang-formatNum( $wordCount 
) );
+   

[MediaWiki-commits] [Gerrit] Call Linker methods statically - change (mediawiki...SolrStore)

2014-01-11 Thread Siebrand (Code Review)
Siebrand has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/106932


Change subject: Call Linker methods statically
..

Call Linker methods statically

Change-Id: I7796ed1a285bfe50b6701bf1d2738c40fb01ff6f
---
M SpecialSolrSearch.php
1 file changed, 12 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SolrStore 
refs/changes/32/106932/1

diff --git a/SpecialSolrSearch.php b/SpecialSolrSearch.php
index 220e670..f98068d 100644
--- a/SpecialSolrSearch.php
+++ b/SpecialSolrSearch.php
@@ -2,14 +2,13 @@
 
 /**
  * SolrStore: The SolrStore Extesion is Semantic Mediawiki Searchprovieder 
based on Apache Solr.
- * 
+ *
  * This is the SpecialPage, displaying the SearchSets and Results
- * 
+ *
  * @defgroup SolrStore
  * @author Simon Bachenberg, Sascha Schueller
  */
 class SpecialSolrSearch extends SpecialPage {
-
/**
 * Set up basic search parameters from the request and user settings.
 * Typically you'll pass $wgRequest and $wgUser.
@@ -19,12 +18,10 @@
 */
public function __construct() {
parent::__construct( SolrSearch );
-   global $wgRequest, $wgUser;
-   $user = $wgUser;
+   global $wgRequest;
$request = $wgRequest;
list( $this-limit, $this-offset ) = $request-getLimitOffset( 
20, 'searchlimit' );
 
-   $this-sk = $user-getSkin();
$this-didYouMeanHtml = ''; # html of did you mean... link
}
 
@@ -79,9 +76,6 @@
global $wgOut, $wgUser, $wgScript, $wgSolrFields;
wfProfileIn( __METHOD__ );
 
-   //$sk = $wgUser-getSkin ();
-
-
$wgOut-setPageTitle( wfMsg( 'solrstore-searchFieldSets-title' 
) );
$wgOut-setHTMLTitle( wfMsg( 'pagetitle', wfMsg( 
'solrstore-searchFieldSets-title', 'SolrSearch: Select FieldSet' ) ) );
 
@@ -105,10 +99,8 @@
 * @param $fieldSet String
 */
public function showResults( $fieldSet ) {
-   global $wgOut, $wgUser, $wgContLang, $wgScript, 
$wgSolrShowRelated, $wgSolrDebug;
+   global $wgOut, $wgContLang, $wgScript, $wgSolrShowRelated, 
$wgSolrDebug;
wfProfileIn( __METHOD__ );
-
-   $sk = $wgUser-getSkin();
 
$this-searchEngine = SearchEngine::create();
$search =  $this-searchEngine;
@@ -166,7 +158,7 @@
if ( $suggestionSnippet == '' )
$suggestionSnippet = null;
 
-   $suggestLink = $sk-linkKnown(
+   $suggestLink = Linker::linkKnown(
$st, $suggestionSnippet, array( 
), $stParams
);
 
@@ -369,7 +361,7 @@
 * @param $fieldSets Array: terms to highlight
 */
protected function showHit( $result, $fieldSets ) {
-   global $wgLang, $wgUser;
+   global $wgLang;
wfProfileIn( __METHOD__ );
 
if ( $result-isBrokenTitle() ) {
@@ -377,7 +369,6 @@
return !-- Broken link in search result --\n;
}
 
-   $sk = $wgUser-getSkin();
$t = $result-getTitle();
 
$titleSnippet = $result-getTitleSnippet( $fieldSets );
@@ -389,7 +380,7 @@
 
wfRunHooks( 'ShowSearchHitTitle', array( $link_t, 
$titleSnippet, $result, $fieldSets, $this ) );
 
-   $link = $this-sk-linkKnown(
+   $link = Linker::linkKnown(
$link_t, $titleSnippet
);
// FÜLLEN
@@ -423,7 +414,7 @@
$redirectText = null;
 
$redirect = span class='searchalttitle' .
-   wfMsg( 'search-redirect', 
$this-sk-linkKnown( $redirectTitle, $redirectText ) ) .
+   wfMsg( 'search-redirect', 
Linker::linkKnown( $redirectTitle, $redirectText ) ) .
/span;
}
 
@@ -435,7 +426,7 @@
$sectionText = null;
 
$section = span class='searchalttitle' .
-   wfMsg( 'search-section', 
$this-sk-linkKnown( $sectionTitle, $sectionText ) ) .
+   wfMsg( 'search-section', 
Linker::linkKnown( $sectionTitle, $sectionText ) ) .
/span;
}
 
@@ -455,7 +446,7 @@
$byteSize = $result-getByteSize();
$wordCount = $result-getWordCount();
$timestamp = $result-getTimestamp();
-   $size = wfMsgExt( 'search-result-size', array( 'parsemag', 
'escape' ),