- global $wgPageProps;
-
- $ret = array(
- 'prop' => array(
- 'Which additional properties to get:',
- ),
- 'continue' => 'When more results are available, use this to continue',
- );
-
- //This mess of code first gets the length of the biggest propname, and adds two onto it to make
- //the number of characters should be used before the dash. If the biggest propname is shorter than 12 characters,
- //the number of characters before the dash become 14.
- $maxLen = max( array_map( 'strlen', array_keys( $wgPageProps ) ) );
- $matchLen = $maxLen + 2;
- if( $maxLen < 12 ) {
- $matchLen = 14;
- }
-
- foreach( $wgPageProps as $propName => $desc ) {
- $pretext = " $propName" . str_repeat( ' ', $matchLen - strlen( $propName ) );
-
- $ret['prop'][] = "$pretext- $desc";
- }
-
- return $ret;