Index: trunk/extensions/SemanticResultFormats/Gallery/SRF_Gallery.php |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | $ig->setHeights( $this->m_params['heights'] ); |
45 | 45 | } |
46 | 46 | |
47 | | - $this->m_params['autocaptions'] = isset( $this->m_params['autocaptions'] ) ? $this->m_params['autocaptions'] != 'off' : true; |
| 47 | + $this->m_params['autocaptions'] = isset( $this->m_params['autocaptions'] ) ? trim( $this->m_params['autocaptions'] ) != 'off' : true; |
48 | 48 | |
49 | 49 | $printReqLabels = array(); |
50 | 50 | |
— | — | @@ -148,7 +148,7 @@ |
149 | 149 | global $wgParser; |
150 | 150 | |
151 | 151 | if ( empty( $imgCaption ) ) { |
152 | | - $imgCaption = $this->m_params['autocaptions'] ? preg_replace( '#\.[^.]+$#', '', $imgTitle->getBaseText() ) : ''; |
| 152 | + $imgCaption = $this->m_params['autocaptions'] ? preg_replace( '#\.[^.]+$#', '', $imgTitle->getBaseText() ) : ''; |
153 | 153 | } |
154 | 154 | else { |
155 | 155 | $imgCaption = $wgParser->recursiveTagParse( $imgCaption ); |
— | — | @@ -188,12 +188,22 @@ |
189 | 189 | $params['autocaptions'] = new Parameter( 'autocaptions', Parameter::TYPE_BOOLEAN ); |
190 | 190 | $params['autocaptions']->setDescription( wfMsg( 'srf_paramdesc_autocaptions' ) ); |
191 | 191 | $params['autocaptions']->setDefault( true ); |
| 192 | + |
| 193 | + $params['captionproperty'] = new Parameter( 'captionproperty' ); |
| 194 | + $params['captionproperty']->setDescription( wfMsg( 'srf_paramdesc_captionproperty' ) ); |
| 195 | + $params['captionproperty']->setDefault( '' ); |
| 196 | + |
| 197 | + $params['imageproperty'] = new Parameter( 'imageproperty' ); |
| 198 | + $params['imageproperty']->setDescription( wfMsg( 'srf_paramdesc_imageproperty' ) ); |
| 199 | + $params['imageproperty']->setDefault( '' ); |
192 | 200 | } |
193 | 201 | else { |
194 | 202 | // This if for b/c with SMW 1.5.x; SMW 1.6 directly accepts Parameter objects. |
195 | 203 | $params[] = array( 'name' => 'perrow', 'type' => 'int', 'description' => wfMsg( 'srf_paramdesc_perrow' ) ); |
196 | 204 | $params[] = array( 'name' => 'widths', 'type' => 'int', 'description' => wfMsg( 'srf_paramdesc_widths' ) ); |
197 | 205 | $params[] = array( 'name' => 'heights', 'type' => 'int', 'description' => wfMsg( 'srf_paramdesc_heights' ) ); |
| 206 | + $params[] = array( 'name' => 'captionproperty', 'type' => 'string', 'description' => wfMsg( 'srf_paramdesc_captionproperty' ) ); |
| 207 | + $params[] = array( 'name' => 'imageproperty', 'type' => 'string', 'description' => wfMsg( 'srf_paramdesc_imageproperty' ) ); |
198 | 208 | |
199 | 209 | $params[] = array( 'name' => 'autocaptions', 'type' => 'enumeration', 'description' => wfMsg( 'srf_paramdesc_autocaptions' ), 'values' => array( 'on', 'off' ) ); |
200 | 210 | } |