r76637 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76636‎ | r76637 | r76638 >
Date:18:08, 13 November 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Split up method
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_List.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/queryprinters/SMW_QP_List.php
@@ -111,42 +111,10 @@
112112 if ( $this->mOutroTemplate != '' ) {
113113 $result .= "{{" . $this->mOutroTemplate . "}}";
114114 }
115 -
 115+
116116 // Make label for finding further results
117117 if ( $this->linkFurtherResults( $res ) && ( ( $this->mFormat != 'ol' ) || ( $this->getSearchLabel( SMW_OUTPUT_WIKI ) ) ) ) {
118 - $link = $res->getQueryLink();
119 - if ( $this->getSearchLabel( SMW_OUTPUT_WIKI ) ) {
120 - $link->setCaption( $this->getSearchLabel( SMW_OUTPUT_WIKI ) );
121 - }
122 - if ( $this->mSep != '' ) {
123 - $link->setParameter( $this->mSep, 'sep' );
124 - }
125 - $link->setParameter( $this->mFormat, 'format' );
126 - if ( $this->mTemplate != '' ) {
127 - $link->setParameter( $this->mTemplate, 'template' );
128 - if ( array_key_exists( 'link', $this->m_params ) ) { // linking may interfere with templates
129 - $link->setParameter( $this->m_params['link'], 'link' );
130 - }
131 - }
132 - if ( $this->mUserParam != '' ) {
133 - $link->setParameter( $this->mUserParam, 'userparam' );
134 - }
135 - if ( $this->mColumns != '' ) {
136 - $link->setParameter( $this->mColumns, 'columns' );
137 - }
138 - if ( $this->mIntro != '' ) {
139 - $link->setParameter( $this->mIntro, 'intro' );
140 - }
141 - if ( $this->mOutro != '' ) {
142 - $link->setParameter( $this->mOutro, 'outro' );
143 - }
144 - if ( $this->mIntroTemplate != '' ) {
145 - $link->setParameter( $this->mIntroTemplate, 'introtemplate' );
146 - }
147 - if ( $this->mOutroTemplate != '' ) {
148 - $link->setParameter( $this->mOutroTemplate, 'outrotemplate' );
149 - }
150 - $result .= $rowstart . $link->getText( SMW_OUTPUT_WIKI, $this->mLinker ) . $rowend . "\n";
 118+ $this->showFurtherResults( $result, $res, $rowstart, $rowend );
151119 }
152120
153121 if ( $this->mColumns > 1 ) {
@@ -238,6 +206,53 @@
239207
240208 $result .= $rowend;
241209 }
 210+
 211+ protected function showFurtherResults( &$result, $res, $rowstart, $rowend ) {
 212+ $link = $res->getQueryLink();
 213+
 214+ if ( $this->getSearchLabel( SMW_OUTPUT_WIKI ) ) {
 215+ $link->setCaption( $this->getSearchLabel( SMW_OUTPUT_WIKI ) );
 216+ }
 217+
 218+ if ( $this->mSep != '' ) {
 219+ $link->setParameter( $this->mSep, 'sep' );
 220+ }
 221+
 222+ $link->setParameter( $this->mFormat, 'format' );
 223+
 224+ if ( $this->mTemplate != '' ) {
 225+ $link->setParameter( $this->mTemplate, 'template' );
 226+ if ( array_key_exists( 'link', $this->m_params ) ) { // linking may interfere with templates
 227+ $link->setParameter( $this->m_params['link'], 'link' );
 228+ }
 229+ }
 230+
 231+ if ( $this->mUserParam != '' ) {
 232+ $link->setParameter( $this->mUserParam, 'userparam' );
 233+ }
 234+
 235+ if ( $this->mColumns != '' ) {
 236+ $link->setParameter( $this->mColumns, 'columns' );
 237+ }
 238+
 239+ if ( $this->mIntro != '' ) {
 240+ $link->setParameter( $this->mIntro, 'intro' );
 241+ }
 242+
 243+ if ( $this->mOutro != '' ) {
 244+ $link->setParameter( $this->mOutro, 'outro' );
 245+ }
 246+
 247+ if ( $this->mIntroTemplate != '' ) {
 248+ $link->setParameter( $this->mIntroTemplate, 'introtemplate' );
 249+ }
 250+
 251+ if ( $this->mOutroTemplate != '' ) {
 252+ $link->setParameter( $this->mOutroTemplate, 'outrotemplate' );
 253+ }
 254+
 255+ $result .= $rowstart . $link->getText( SMW_OUTPUT_WIKI, $this->mLinker ) . $rowend . "\n";
 256+ }
242257
243258 public function getParameters() {
244259 $params = parent::getParameters();

Status & tagging log