r112205 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112204‎ | r112205 | r112206 >
Date:14:09, 23 February 2012
Author:nikerabbit
Status:ok
Tags:
Comment:
Removed BOM and stylize, ping r112201
Modified paths:
  • /trunk/extensions/SemanticResultFormats/Gallery/SRF_Gallery.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticResultFormats/Gallery/SRF_Gallery.php
@@ -1,4 +1,4 @@
2 -<?php
 2+<?php
33
44 /**
55 * Result printer that prints query results as a gallery.
@@ -34,21 +34,21 @@
3535 if ( $this->m_params['galleryformat'] == 'carousel' ) {
3636 // Set attributes for jcarousel
3737 $mAttribs['id'] = 'carousel';
38 - $mAttribs['class'] = 'jcarousel-skin-smw';
39 -
 38+ $mAttribs['class'] = 'jcarousel-skin-smw';
 39+
4040 // Aoid js loading issues by not displaying anything until js is able to do so
41 - $mAttribs['style'] = 'display:none;';
 41+ $mAttribs['style'] = 'display:none;';
4242
4343 // Horizontal or vertical orientation
44 - $mAttribs['orientation'] = 'horizontal';
 44+ $mAttribs['orientation'] = 'horizontal';
4545
4646 // Whether to wrap at the first/last item (or both) and jump back to the start/end
47 - $mAttribs['wrap'] = 'both';
 47+ $mAttribs['wrap'] = 'both';
4848
49 - // Use perrow parameter to determine the scroll sequence
50 - if( empty($this->m_params['perrow']) ){
51 - $mAttribs['scroll'] = 1; // default 1
52 - }else{
 49+ // Use perrow parameter to determine the scroll sequence
 50+ if ( empty( $this->m_params['perrow'] ) ) {
 51+ $mAttribs['scroll'] = 1; // default 1
 52+ } else {
5353 $mAttribs['scroll'] = $this->m_params['perrow'];
5454 $mAttribs['visible'] = $this->m_params['perrow'];
5555 }
@@ -59,7 +59,7 @@
6060 SMWOutputs::requireResource( 'ext.srf.jcarousel' );
6161 }
6262
63 - // In case galleryformat = carousel, perrow should not be set
 63+ // In case galleryformat = carousel, perrow should not be set
6464 if ( $this->m_params['perrow'] !== '' && $this->m_params['galleryformat'] !== 'carousel' ) {
6565 $ig->setPerRow( $this->m_params['perrow'] );
6666 }
@@ -123,7 +123,7 @@
124124
125125 foreach ( $images as $imgTitle ) {
126126 if ( $imgTitle->exists() ) {
127 - $imgCaption= $hasCaption ? ( $amountMatches ? array_shift( $captions ) : $captions[0] ) : '';
 127+ $imgCaption = $hasCaption ? ( $amountMatches ? array_shift( $captions ) : $captions[0] ) : '';
128128 $this->addImageToGallery( $ig, $imgTitle, $imgCaption );
129129 }
130130 }
@@ -149,7 +149,7 @@
150150
151151 // Is there a property queried for display with ?property
152152 if ( isset( $row[1] ) ) {
153 - $imgCaption =$row[1]->getNextDataValue();
 153+ $imgCaption = $row[1]->getNextDataValue();
154154 if ( is_object( $imgCaption ) ) {
155155 $imgCaption = $imgCaption->getShortText( SMW_OUTPUT_HTML, $this->getLinker( true ) );
156156 }
@@ -176,7 +176,7 @@
177177 if ( empty( $imgCaption ) ) {
178178 if ( $this->m_params['autocaptions'] ) {
179179 $imgCaption = $imgTitle->getBaseText();
180 -
 180+
181181 if ( !$this->m_params['fileextensions'] ) {
182182 $imgCaption = preg_replace( '#\.[^.]+$#', '', $imgCaption );
183183 }
@@ -185,17 +185,17 @@
186186 $imgCaption = '';
187187 }
188188 }
189 - else {
190 - $imgCaption = $wgParser->recursiveTagParse( $imgCaption );
 189+ else {
 190+ $imgCaption = $wgParser->recursiveTagParse( $imgCaption );
191191 // the above call creates getMaxIncludeSize() fatal error on Special Pages
192192 // below might fix this
193 - // $imgCaption = $wgParser->transformMsg( $imgCaption, ParserOptions::newFromUser( null ) );
 193+ // $imgCaption = $wgParser->transformMsg( $imgCaption, ParserOptions::newFromUser( null ) );
194194 }
195195
196196 $ig->add( $imgTitle, $imgCaption );
197197
198198 // Only add real images (bug #5586)
199 - if ( $imgTitle->getNamespace() == NS_IMAGE && !is_null($imgTitle->getDBkey()) ) {
 199+ if ( $imgTitle->getNamespace() == NS_IMAGE && !is_null( $imgTitle->getDBkey() ) ) {
200200 $wgParser->mOutput->addImage( $imgTitle->getDBkey() );
201201 }
202202 }
@@ -232,15 +232,15 @@
233233 $params['autocaptions'] = new Parameter( 'autocaptions', Parameter::TYPE_BOOLEAN );
234234 $params['autocaptions']->setMessage( 'srf_paramdesc_autocaptions' );
235235 $params['autocaptions']->setDefault( true );
236 -
 236+
237237 $params['fileextensions'] = new Parameter( 'fileextensions', Parameter::TYPE_BOOLEAN );
238238 $params['fileextensions']->setMessage( 'srf_paramdesc_fileextensions' );
239239 $params['fileextensions']->setDefault( false );
240 -
 240+
241241 $params['captionproperty'] = new Parameter( 'captionproperty' );
242242 $params['captionproperty']->setMessage( 'srf_paramdesc_captionproperty' );
243243 $params['captionproperty']->setDefault( '' );
244 -
 244+
245245 $params['imageproperty'] = new Parameter( 'imageproperty' );
246246 $params['imageproperty']->setMessage( 'srf_paramdesc_imageproperty' );
247247 $params['imageproperty']->setDefault( '' );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112201slightly modified patch by MWJames from bug 34411jeroendedauw13:16, 23 February 2012

Status & tagging log