<?php
/**
- * Credits.php -- formats credits for articles
+ * Formats credits for articles
+ *
* Copyright 2004, Evan Prodromou <evan@wikitravel.org>.
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
+ * @file
* @author <evan@wikitravel.org>
*/
$cnt--;
if ( $user->isLoggedIn() ) {
$link = self::link( $user );
- if ( !in_array( 'realname', $wgHiddenPrefs ) && $user->getRealName() )
+ if ( !in_array( 'realname', $wgHiddenPrefs ) && $user->getRealName() ) {
$real_names[] = $link;
- else
+ } else {
$user_names[] = $link;
+ }
} else {
$anon_ips[] = self::link( $user );
}
- if ( $cnt == 0 ) break;
+
+ if ( $cnt == 0 ) {
+ break;
+ }
}
if ( count( $real_names ) ) {
# "ThisSite user(s) A, B and C"
if ( count( $user_names ) ) {
- $user = wfMsgExt( 'siteusers', array( 'parsemag' ),
- $wgLang->listToText( $user_names ), count( $user_names ) );
+ $user = wfMsgExt(
+ 'siteusers',
+ 'parsemag',
+ $wgLang->listToText( $user_names ), count( $user_names )
+ );
} else {
$user = false;
}
if ( count( $anon_ips ) ) {
- $anon = wfMsgExt( 'anonusers', array( 'parsemag' ),
- $wgLang->listToText( $anon_ips ), count( $anon_ips ) );
+ $anon = wfMsgExt(
+ 'anonusers',
+ 'parsemag',
+ $wgLang->listToText( $anon_ips ), count( $anon_ips )
+ );
} else {
$anon = false;
}
*/
protected static function link( User $user ) {
global $wgUser, $wgHiddenPrefs;
- if ( !in_array( 'realname', $wgHiddenPrefs ) && !$user->isAnon() )
+ if ( !in_array( 'realname', $wgHiddenPrefs ) && !$user->isAnon() ) {
$real = $user->getRealName();
- else
+ } else {
$real = false;
+ }
$skin = $wgUser->getSkin();
$page = $user->isAnon() ?
return wfMsgExt( 'anonuser', array( 'parseinline', 'replaceafter' ), $link );
} else {
global $wgHiddenPrefs;
- if ( !in_array( 'realname', $wgHiddenPrefs ) && $user->getRealName() )
+ if ( !in_array( 'realname', $wgHiddenPrefs ) && $user->getRealName() ) {
return $link;
- else
- return wfMsgExt( 'siteuser', array( 'parseinline', 'replaceafter' ), $link );
+ } else {
+ return wfMsgExt( 'siteuser', 'parsemag', $link, $user->getName() );
+ }
}
}