r76638 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76637‎ | r76638 | r76639 >
Date:18:27, 13 November 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Sme stylizing
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
@@ -31,21 +31,26 @@
3232 if ( array_key_exists( 'sep', $params ) ) {
3333 $this->mSep = str_replace( '_', ' ', $params['sep'] );
3434 }
 35+
3536 if ( array_key_exists( 'template', $params ) ) {
3637 $this->mTemplate = trim( $params['template'] );
3738 }
 39+
3840 if ( array_key_exists( 'userparam', $params ) ) {
3941 $this->mUserParam = trim( $params['userparam'] );
4042 }
 43+
4144 if ( array_key_exists( 'columns', $params ) ) {
4245 $columns = trim( $params['columns'] );
4346 if ( $columns > 1 && $columns <= 10 ) { // allow a maximum of 10 columns
4447 $this->mColumns = (int)$columns;
4548 }
4649 }
 50+
4751 if ( array_key_exists( 'introtemplate', $params ) ) {
4852 $this->mIntroTemplate = $params['introtemplate'];
4953 }
 54+
5055 if ( array_key_exists( 'outrotemplate', $params ) ) {
5156 $this->mOutroTemplate = $params['outrotemplate'];
5257 }
@@ -62,6 +67,7 @@
6368 $res->addErrors( array( wfMsgForContent( 'smw_notemplategiven' ) ) );
6469 return '';
6570 }
 71+
6672 // Determine mark-up strings used around list items:
6773 if ( ( $this->mFormat == 'ul' ) || ( $this->mFormat == 'ol' ) ) {
6874 $header = '<' . $this->mFormat . '>';
@@ -75,6 +81,7 @@
7682 $rowstart = '';
7783 $rowend = '';
7884 $plainlist = true;
 85+
7986 if ( $this->mSep != '' ) { // always respect custom separator
8087 $listsep = $this->mSep;
8188 $finallistsep = $listsep;
@@ -87,6 +94,7 @@
8895 $finallistsep = '';
8996 }
9097 }
 98+
9199 // Print header
92100 $result = $header;
93101
@@ -97,6 +105,7 @@
98106 $rows_per_column = ceil( $res->getCount() / $this->mColumns );
99107 $rows_in_cur_column = 0;
100108 }
 109+
101110 if ( $this->mIntroTemplate != '' ) {
102111 $result .= "{{" . $this->mIntroTemplate . "}}";
103112 }
@@ -123,6 +132,7 @@
124133
125134 // Print footer
126135 $result .= $footer;
 136+
127137 if ( $this->mColumns > 1 ) {
128138 $result .= '<br style="clear: both">' . "\n";
129139 }
@@ -219,7 +229,7 @@
220230 }
221231
222232 $link->setParameter( $this->mFormat, 'format' );
223 -
 233+
224234 if ( $this->mTemplate != '' ) {
225235 $link->setParameter( $this->mTemplate, 'template' );
226236 if ( array_key_exists( 'link', $this->m_params ) ) { // linking may interfere with templates
@@ -269,6 +279,7 @@
270280 if ( ! $plainlist ) {
271281 $params[] = array( 'name' => 'columns', 'type' => 'int', 'description' => wfMsg( 'smw_paramdesc_columns', 1 ) );
272282 }
 283+
273284 $params[] = array( 'name' => 'userparam', 'type' => 'string', 'description' => wfMsg( 'smw_paramdesc_userparam' ) );
274285 $params[] = array( 'name' => 'introtemplate', 'type' => 'string', 'description' => wfMsg( 'smw_paramdesc_introtemplate' ) );
275286 $params[] = array( 'name' => 'outrotemplate', 'type' => 'string', 'description' => wfMsg( 'smw_paramdesc_outrotemplate' ) );

Status & tagging log