Index: trunk/extensions/SemanticMediaWiki/includes/parserhooks/SMW_SMWDoc.php |
— | — | @@ -116,17 +116,25 @@ |
117 | 117 | */ |
118 | 118 | protected function getParameterTable( array $parameters ) { |
119 | 119 | $tableRows = array(); |
120 | | - |
| 120 | + $hasAliases = false; |
| 121 | + |
121 | 122 | foreach ( $parameters as $parameter ) { |
122 | | - $tableRows[] = $this->getDescriptionRow( $parameter ); |
| 123 | + $hasAliases = count( $parameter->getAliases() ) != 0; |
| 124 | + if ( $hasAliases ) break; |
123 | 125 | } |
| 126 | + |
| 127 | + foreach ( $parameters as $parameter ) { |
| 128 | + if ( $parameter->getName() != 'format' ) { |
| 129 | + $tableRows[] = $this->getDescriptionRow( $parameter, $hasAliases ); |
| 130 | + } |
| 131 | + } |
124 | 132 | |
125 | 133 | $table = ''; |
126 | 134 | |
127 | 135 | if ( count( $tableRows ) > 0 ) { |
128 | 136 | $tableRows = array_merge( array( |
129 | 137 | '!' . $this->msg( 'validator-describe-header-parameter' ) ."\n" . |
130 | | - '!' . $this->msg( 'validator-describe-header-aliases' ) ."\n" . |
| 138 | + ( $hasAliases ? '!' . $this->msg( 'validator-describe-header-aliases' ) ."\n" : '' ) . |
131 | 139 | '!' . $this->msg( 'validator-describe-header-type' ) ."\n" . |
132 | 140 | '!' . $this->msg( 'validator-describe-header-default' ) ."\n" . |
133 | 141 | '!' . $this->msg( 'validator-describe-header-description' ) |
— | — | @@ -149,13 +157,17 @@ |
150 | 158 | * @since 1.6 |
151 | 159 | * |
152 | 160 | * @param Parameter $parameter |
| 161 | + * @param boolean $hasAliases |
153 | 162 | * |
154 | 163 | * @return string |
155 | 164 | */ |
156 | | - protected function getDescriptionRow( Parameter $parameter ) { |
157 | | - $aliases = $parameter->getAliases(); |
158 | | - $aliases = count( $aliases ) > 0 ? implode( ', ', $aliases ) : '-'; |
| 165 | + protected function getDescriptionRow( Parameter $parameter, $hasAliases ) { |
| 166 | + if ( $hasAliases ) { |
| 167 | + $aliases = $parameter->getAliases(); |
| 168 | + $aliases = count( $aliases ) > 0 ? implode( ', ', $aliases ) : '-'; |
| 169 | + } |
159 | 170 | |
| 171 | + |
160 | 172 | $description = $parameter->getMessage(); |
161 | 173 | if ( $description === false ) { |
162 | 174 | $description = $parameter->getDescription(); |
— | — | @@ -177,9 +189,9 @@ |
178 | 190 | |
179 | 191 | if ( $default === '' ) $default = "''" . $this->msg( 'validator-describe-empty' ) . "''"; |
180 | 192 | |
181 | | - return <<<EOT |
182 | | -| {$parameter->getName()} |
183 | | -| {$aliases} |
| 193 | + return "| {$parameter->getName()}\n" |
| 194 | +. ( $hasAliases ? '| ' . $aliases . "\n" : '' ) . |
| 195 | +<<<EOT |
184 | 196 | | {$type} |
185 | 197 | | {$default} |
186 | 198 | | {$description} |