<?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);
}
return $s;
}
-function getAuthorCredits($article) {
-
+/**
+ *
+ */
+function getAuthorCredits($article) {
global $wgLang;
$last_author = $article->getUser();
return wfMsg('lastmodifiedby', $d, $author_credit);
}
+/**
+ *
+ */
function getContributorCredits($article, $cnt, $showIfMax) {
global $wgLang, $wgAllowRealName;
# "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');
}
?>