Index: trunk/extensions/SemanticResultFormats/Gallery/SRF_Gallery.php |
— | — | @@ -1,4 +1,4 @@ |
2 | | -<?php |
| 2 | +<?php |
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Result printer that prints query results as a gallery. |
— | — | @@ -34,21 +34,21 @@ |
35 | 35 | if ( $this->m_params['galleryformat'] == 'carousel' ) { |
36 | 36 | // Set attributes for jcarousel |
37 | 37 | $mAttribs['id'] = 'carousel'; |
38 | | - $mAttribs['class'] = 'jcarousel-skin-smw'; |
39 | | - |
| 38 | + $mAttribs['class'] = 'jcarousel-skin-smw'; |
| 39 | + |
40 | 40 | // 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;'; |
42 | 42 | |
43 | 43 | // Horizontal or vertical orientation |
44 | | - $mAttribs['orientation'] = 'horizontal'; |
| 44 | + $mAttribs['orientation'] = 'horizontal'; |
45 | 45 | |
46 | 46 | // 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'; |
48 | 48 | |
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 { |
53 | 53 | $mAttribs['scroll'] = $this->m_params['perrow']; |
54 | 54 | $mAttribs['visible'] = $this->m_params['perrow']; |
55 | 55 | } |
— | — | @@ -59,7 +59,7 @@ |
60 | 60 | SMWOutputs::requireResource( 'ext.srf.jcarousel' ); |
61 | 61 | } |
62 | 62 | |
63 | | - // In case galleryformat = carousel, perrow should not be set |
| 63 | + // In case galleryformat = carousel, perrow should not be set |
64 | 64 | if ( $this->m_params['perrow'] !== '' && $this->m_params['galleryformat'] !== 'carousel' ) { |
65 | 65 | $ig->setPerRow( $this->m_params['perrow'] ); |
66 | 66 | } |
— | — | @@ -123,7 +123,7 @@ |
124 | 124 | |
125 | 125 | foreach ( $images as $imgTitle ) { |
126 | 126 | if ( $imgTitle->exists() ) { |
127 | | - $imgCaption= $hasCaption ? ( $amountMatches ? array_shift( $captions ) : $captions[0] ) : ''; |
| 127 | + $imgCaption = $hasCaption ? ( $amountMatches ? array_shift( $captions ) : $captions[0] ) : ''; |
128 | 128 | $this->addImageToGallery( $ig, $imgTitle, $imgCaption ); |
129 | 129 | } |
130 | 130 | } |
— | — | @@ -149,7 +149,7 @@ |
150 | 150 | |
151 | 151 | // Is there a property queried for display with ?property |
152 | 152 | if ( isset( $row[1] ) ) { |
153 | | - $imgCaption =$row[1]->getNextDataValue(); |
| 153 | + $imgCaption = $row[1]->getNextDataValue(); |
154 | 154 | if ( is_object( $imgCaption ) ) { |
155 | 155 | $imgCaption = $imgCaption->getShortText( SMW_OUTPUT_HTML, $this->getLinker( true ) ); |
156 | 156 | } |
— | — | @@ -176,7 +176,7 @@ |
177 | 177 | if ( empty( $imgCaption ) ) { |
178 | 178 | if ( $this->m_params['autocaptions'] ) { |
179 | 179 | $imgCaption = $imgTitle->getBaseText(); |
180 | | - |
| 180 | + |
181 | 181 | if ( !$this->m_params['fileextensions'] ) { |
182 | 182 | $imgCaption = preg_replace( '#\.[^.]+$#', '', $imgCaption ); |
183 | 183 | } |
— | — | @@ -185,17 +185,17 @@ |
186 | 186 | $imgCaption = ''; |
187 | 187 | } |
188 | 188 | } |
189 | | - else { |
190 | | - $imgCaption = $wgParser->recursiveTagParse( $imgCaption ); |
| 189 | + else { |
| 190 | + $imgCaption = $wgParser->recursiveTagParse( $imgCaption ); |
191 | 191 | // the above call creates getMaxIncludeSize() fatal error on Special Pages |
192 | 192 | // below might fix this |
193 | | - // $imgCaption = $wgParser->transformMsg( $imgCaption, ParserOptions::newFromUser( null ) ); |
| 193 | + // $imgCaption = $wgParser->transformMsg( $imgCaption, ParserOptions::newFromUser( null ) ); |
194 | 194 | } |
195 | 195 | |
196 | 196 | $ig->add( $imgTitle, $imgCaption ); |
197 | 197 | |
198 | 198 | // 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() ) ) { |
200 | 200 | $wgParser->mOutput->addImage( $imgTitle->getDBkey() ); |
201 | 201 | } |
202 | 202 | } |
— | — | @@ -232,15 +232,15 @@ |
233 | 233 | $params['autocaptions'] = new Parameter( 'autocaptions', Parameter::TYPE_BOOLEAN ); |
234 | 234 | $params['autocaptions']->setMessage( 'srf_paramdesc_autocaptions' ); |
235 | 235 | $params['autocaptions']->setDefault( true ); |
236 | | - |
| 236 | + |
237 | 237 | $params['fileextensions'] = new Parameter( 'fileextensions', Parameter::TYPE_BOOLEAN ); |
238 | 238 | $params['fileextensions']->setMessage( 'srf_paramdesc_fileextensions' ); |
239 | 239 | $params['fileextensions']->setDefault( false ); |
240 | | - |
| 240 | + |
241 | 241 | $params['captionproperty'] = new Parameter( 'captionproperty' ); |
242 | 242 | $params['captionproperty']->setMessage( 'srf_paramdesc_captionproperty' ); |
243 | 243 | $params['captionproperty']->setDefault( '' ); |
244 | | - |
| 244 | + |
245 | 245 | $params['imageproperty'] = new Parameter( 'imageproperty' ); |
246 | 246 | $params['imageproperty']->setMessage( 'srf_paramdesc_imageproperty' ); |
247 | 247 | $params['imageproperty']->setDefault( '' ); |