Index: trunk/extensions/SemanticResultFormats/Gallery/SRF_Gallery.php |
— | — | @@ -14,25 +14,19 @@ |
15 | 15 | /** |
16 | 16 | * Result printer that prints query results as a gallery. |
17 | 17 | */ |
18 | | -class SRFGallery extends SMWResultPrinter |
19 | | -{ |
| 18 | +class SRFGallery extends SMWResultPrinter { |
20 | 19 | |
21 | | - public function getName() |
22 | | - { |
| 20 | + public function getName() { |
23 | 21 | return wfMsg( 'srf_printername_gallery' ); |
24 | 22 | } |
25 | 23 | |
26 | | - |
27 | | - public function getResult( $results, $params, $outputmode ) |
28 | | - { |
| 24 | + public function getResult( $results, $params, $outputmode ) { |
29 | 25 | // skip checks, results with 0 entries are normal |
30 | 26 | $this->readParameters( $params, $outputmode ); |
31 | 27 | return $this->getResultText( $results, SMW_OUTPUT_HTML ); |
32 | 28 | } |
33 | 29 | |
34 | | - |
35 | | - public function getResultText( $results, $outputmode ) |
36 | | - { |
| 30 | + public function getResultText( $results, $outputmode ) { |
37 | 31 | global $wgUser, $wgParser; |
38 | 32 | |
39 | 33 | $ig = new ImageGallery(); |
— | — | @@ -167,4 +161,23 @@ |
168 | 162 | } |
169 | 163 | } |
170 | 164 | |
| 165 | + /** |
| 166 | + * @see SMWResultPrinter::getParameters |
| 167 | + * |
| 168 | + * @since 1.5.3 |
| 169 | + * |
| 170 | + * @return array |
| 171 | + */ |
| 172 | + public function getParameters() { |
| 173 | + $params = parent::getParameters(); |
| 174 | + |
| 175 | + $params[] = array( 'name' => 'perrow', 'type' => 'int', 'description' => wfMsg( 'srf_paramdesc_perrow' ) ); |
| 176 | + $params[] = array( 'name' => 'widths', 'type' => 'int', 'description' => wfMsg( 'srf_paramdesc_widths' ) ); |
| 177 | + $params[] = array( 'name' => 'heights', 'type' => 'int', 'description' => wfMsg( 'srf_paramdesc_heights' ) ); |
| 178 | + |
| 179 | + $params[] = array( 'name' => 'autocaptions', 'type' => 'enumeration', 'description' => wfMsg( 'srf_paramdesc_autocaptions' ), 'values' => array( 'on', 'off' ) ); |
| 180 | + |
| 181 | + return $params; |
| 182 | + } |
| 183 | + |
171 | 184 | } |
Index: trunk/extensions/SemanticResultFormats/SRF_Messages.php |
— | — | @@ -70,8 +70,13 @@ |
71 | 71 | 'srf_paramdesc_barcolor' => 'The color of the bars', |
72 | 72 | 'srf_paramdesc_bardirection'=> 'The direction of the bar chart', |
73 | 73 | 'srf_paramdesc_barnumbersaxislabel' => 'The label for the numbers axis', |
74 | | - // format "gallery" |
| 74 | + |
| 75 | + // "gallery" format |
75 | 76 | 'srf_printername_gallery' => 'Gallery', |
| 77 | + 'srf_paramdesc_perrow' => 'The amount of images per row', |
| 78 | + 'srf_paramdesc_widths' => 'The width of the images', |
| 79 | + 'srf_paramdesc_heights' => 'The height of the images', |
| 80 | + 'srf_paramdesc_autocaptions' => 'Use file name as caption when none is provided', |
76 | 81 | |
77 | 82 | // "tagcloud" format |
78 | 83 | 'srf_printername_tagcloud' => 'Tag cloud', |