Remove a single space that breaks a parser test
[lhc/web/wiklou.git] / includes / Credits.php
index 23e74a1..1a9462a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
-
-/* Credits.php -- formats credits for articles
+/**
+ * Credits.php -- formats credits for articles
  * Copyright 2004, Evan Prodromou <evan@wikitravel.org>.
  * 
  *  This program is free software; you can redistribute it and/or modify
  *  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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * @author <evan@wikitravel.org>
+ * @package MediaWiki
  */
 
-/* This is largely cadged from PageHistory::history */
-
-function showCreditsPage($article)
-{
+/**
+ * This is largely cadged from PageHistory::history
+ */
+function showCreditsPage($article) {
     global $wgOut;
 
-    $fname = "showCreditsPage";
+    $fname = 'showCreditsPage';
     
     wfProfileIn( $fname );
 
     $wgOut->setPageTitle( $article->mTitle->getPrefixedText() );
-    $wgOut->setSubtitle( wfMsg( "creditspage" ) );
+    $wgOut->setSubtitle( wfMsg( 'creditspage' ) );
     $wgOut->setArticleFlag( false );
     $wgOut->setArticleRelated( true );
-    $wgOut->setRobotpolicy( "noindex,nofollow" );
+    $wgOut->setRobotpolicy( 'noindex,nofollow' );
 
     if( $article->mTitle->getArticleID() == 0 ) {
-       $s = wfMsg( "nocredits" );
+       $s = wfMsg( 'nocredits' );
     } else {
        $s = getCredits($article, -1);
     }
@@ -59,8 +62,10 @@ function getCredits($article, $cnt, $showIfMax=true) {
     return $s;
 }
 
-function getAuthorCredits($article) {
-    
+/**
+ *
+ */
+function getAuthorCredits($article) {    
     global $wgLang;
     
     $last_author = $article->getUser();
@@ -88,6 +93,9 @@ function getAuthorCredits($article) {
     return wfMsg('lastmodifiedby', $d, $author_credit);
 }
 
+/**
+ *
+ */
 function getContributorCredits($article, $cnt, $showIfMax) {
            
     global $wgLang, $wgAllowRealName;
@@ -153,20 +161,26 @@ function getContributorCredits($article, $cnt, $showIfMax) {
 
     # "Based on work by ..."
     
-    return wfMsg('othercontribs', $creds);
+    return (empty($creds)) ? '' : wfMsg('othercontribs', $creds);
 }
 
+/**
+ *
+ */
 function creditLink($user_name, $link_text = '') {
     global $wgUser, $wgLang;
     $skin = $wgUser->getSkin();
-    return $skin->makeKnownLink($wgLang->getNsText(NS_USER) . ":" . $user_name,
-                               (empty($link_text)) ? $user_name : $link_text);
+    return $skin->makeLink($wgLang->getNsText(NS_USER) . ':' . $user_name,
+                          (empty($link_text)) ? $user_name : $link_text);
 }
 
+/**
+ *
+ */
 function creditOthersLink($article) {
     global $wgUser, $wgLang;
     $skin = $wgUser->getSkin();
-    return $skin->makeKnownLink($article->mTitle->getPrefixedText(), wfMsg('others'), "action=credits");
+    return $skin->makeKnownLink($article->mTitle->getPrefixedText(), wfMsg('others'), 'action=credits');
 }
 
 ?>