Add some more spacing due to long parameter names
authorSam Reed <reedy@users.mediawiki.org>
Sat, 23 Apr 2011 13:29:11 +0000 (13:29 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 23 Apr 2011 13:29:11 +0000 (13:29 +0000)
Use str_repeat for ease rather than "     " etc

Fix MiserMode to MiserMode

includes/api/ApiBase.php
includes/api/ApiQueryLogEvents.php

index 5e9419f..4ba17a7 100644 (file)
@@ -293,7 +293,8 @@ abstract class ApiBase {
 
                        $paramsDescription = $this->getFinalParamDescription();
                        $msg = '';
-                       $paramPrefix = "\n" . str_repeat( ' ', 19 );
+                       $paramPrefix = "\n" . str_repeat( ' ', 24 );
+                       $descWordwrap = "\n" . str_repeat( ' ', 28 );
                        foreach ( $params as $paramName => $paramSettings ) {
                                $desc = isset( $paramsDescription[$paramName] ) ? $paramsDescription[$paramName] : '';
                                if ( is_array( $desc ) ) {
@@ -338,7 +339,7 @@ abstract class ApiBase {
                                                }
                                                $desc .= $paramPrefix . $nothingPrompt . $prompt;
                                                $choicesstring = implode( ', ', $choices );
-                                               $desc .= wordwrap( $choicesstring, 100, "\n                       " );
+                                               $desc .= wordwrap( $choicesstring, 100, $descWordwrap );
                                        } else {
                                                switch ( $type ) {
                                                        case 'namespace':
@@ -388,7 +389,7 @@ abstract class ApiBase {
                                        $desc .= $paramPrefix . "Default: $default";
                                }
 
-                               $msg .= sprintf( "  %-14s - %s\n", $this->encodeParamName( $paramName ), $desc );
+                               $msg .= sprintf( "  %-19s - %s\n", $this->encodeParamName( $paramName ), $desc );
                        }
                        return $msg;
 
index 2e51c3f..8cb9b6b 100644 (file)
@@ -422,7 +422,7 @@ class ApiQueryLogEvents extends ApiQueryBase {
                        'dir' => $this->getDirectionDescription( $p ),
                        'user' => 'Filter entries to those made by the given user',
                        'title' => 'Filter entries to those related to a page',
-                       'prefix' => 'Filter entries that start with this prefix. Disabled in MiserMode',
+                       'prefix' => 'Filter entries that start with this prefix. Disabled in Miser Mode',
                        'limit' => 'How many total event entries to return',
                        'tag' => 'Only list event entries tagged with this tag',
                );