Add some braces, fixup some indenting

This commit is contained in:
Sam Reed 2011-02-03 21:40:55 +00:00
parent 3d8c5a0f5a
commit 1d7fb709b1

View file

@ -633,31 +633,30 @@ class Cite {
*/ */
function referencesFormatEntry( $key, $val ) { function referencesFormatEntry( $key, $val ) {
// Anonymous reference // Anonymous reference
if ( ! is_array( $val ) ) if ( !is_array( $val ) ) {
return return wfMsgForContentNoTrans(
wfMsgForContentNoTrans(
'cite_references_link_one', 'cite_references_link_one',
$this->referencesKey( $key ), $this->referencesKey( $key ),
$this->refKey( $key ), $this->refKey( $key ),
$val $val
); );
else if ( isset( $val['follow'] ) ) } else if ( isset( $val['follow'] ) ) {
return return wfMsgForContentNoTrans(
wfMsgForContentNoTrans(
'cite_references_no_link', 'cite_references_no_link',
$this->referencesKey( $val['follow'] ), $this->referencesKey( $val['follow'] ),
$val['text'] $val['text']
); );
else if ( $val['text'] == '' ) return } else if ( $val['text'] == '' ) {
wfMsgForContentNoTrans( return wfMsgForContentNoTrans(
'cite_references_link_one', 'cite_references_link_one',
$this->referencesKey( $key ), $this->referencesKey( $key ),
$this->refKey( $key, $val['count'] ), $this->refKey( $key, $val['count'] ),
$this->error( 'cite_error_references_no_text', $key ) $this->error( 'cite_error_references_no_text', $key )
); );
if ( $val['count'] < 0 ) }
return
wfMsgForContentNoTrans( if ( $val['count'] < 0 ) {
return wfMsgForContentNoTrans(
'cite_references_link_one', 'cite_references_link_one',
$this->referencesKey( $val['key'] ), $this->referencesKey( $val['key'] ),
# $this->refKey( $val['key'], $val['count'] ), # $this->refKey( $val['key'], $val['count'] ),
@ -665,13 +664,12 @@ class Cite {
( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) ) ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) )
); );
// Standalone named reference, I want to format this like an // Standalone named reference, I want to format this like an
// anonymous reference because displaying "1. 1.1 Ref text" is // anonymous reference because displaying "1. 1.1 Ref text" is
// overkill and users frequently use named references when they // overkill and users frequently use named references when they
// don't need them for convenience // don't need them for convenience
else if ( $val['count'] === 0 ) } else if ( $val['count'] === 0 ) {
return return wfMsgForContentNoTrans(
wfMsgForContentNoTrans(
'cite_references_link_one', 'cite_references_link_one',
$this->referencesKey( $key . "-" . $val['key'] ), $this->referencesKey( $key . "-" . $val['key'] ),
# $this->refKey( $key, $val['count'] ), # $this->refKey( $key, $val['count'] ),
@ -679,9 +677,9 @@ class Cite {
( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) ) ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) )
); );
// Named references with >1 occurrences // Named references with >1 occurrences
else { } else {
$links = array(); $links = array();
// for group handling, we have an extra key here. // for group handling, we have an extra key here.
for ( $i = 0; $i <= $val['count']; ++$i ) { for ( $i = 0; $i <= $val['count']; ++$i ) {
$links[] = wfMsgForContentNoTrans( $links[] = wfMsgForContentNoTrans(
'cite_references_link_many_format', 'cite_references_link_many_format',
@ -693,8 +691,7 @@ class Cite {
$list = $this->listToText( $links ); $list = $this->listToText( $links );
return return wfMsgForContentNoTrans( 'cite_references_link_many',
wfMsgForContentNoTrans( 'cite_references_link_many',
$this->referencesKey( $key . "-" . $val['key'] ), $this->referencesKey( $key . "-" . $val['key'] ),
$list, $list,
( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) ) ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) )