<?php
+# See skin.doc
-require_once( 'Feed.php' );
+require_once( 'Feed.php' ); // should not be called if the actual page isn't feed enabled
require_once( 'Image.php' );
-# See skin.doc
-
# These are the INTERNAL names, which get mapped
# directly to class names. For display purposes, the
# Language class has internationalized names
#
/* private */ $wgValidSkinNames = array(
- 'standard' => 'Standard',
- 'nostalgia' => 'Nostalgia',
- 'cologneblue' => 'CologneBlue'
+ 'standard' => 'Standard',
+ 'nostalgia' => 'Nostalgia',
+ 'cologneblue' => 'CologneBlue'
);
if( $wgUsePHPTal ) {
#$wgValidSkinNames[] = 'PHPTal';
class RCCacheEntry extends RecentChange
{
var $secureName, $link;
- var $curlink , $lastlink , $usertalklink , $versionlink ;
+ var $curlink , $difflink, $lastlink , $usertalklink , $versionlink ;
var $userlink, $timestamp, $watched;
function newFromParent( $rc )
}
function getHeadScripts() {
- global $wgStylePath, $wgUser, $wgLang;
+ global $wgStylePath, $wgUser, $wgLang, $wgAllowUserJs;
$r = "<script type=\"text/javascript\" src=\"{$wgStylePath}/wikibits.js\"></script>\n";
- if( $wgUser->getID() != 0 ) { # logged in
+ if( $wgAllowUserJs && $wgUser->getID() != 0 ) { # logged in
$userpage = $wgLang->getNsText( Namespace::getUser() ) . ":" . $wgUser->getName();
$userjs = htmlspecialchars($this->makeUrl($userpage.'/'.$this->getSkinName().'.js', 'action=raw&ctype=text/javascript'));
$r .= '<script type="text/javascript" src="'.$userjs."\"></script>\n";
# get the user/site-specific stylesheet, SkinPHPTal called from RawPage.php (settings are cached that way)
function getUserStylesheet() {
- global $wgOut, $wgStylePath, $wgLang, $wgUser, $wgRequest, $wgTitle;
+ global $wgOut, $wgStylePath, $wgLang, $wgUser, $wgRequest, $wgTitle, $wgAllowUserCss;
$sheet = $this->getStylesheet();
$action = $wgRequest->getText('action');
$s = "@import \"$wgStylePath/$sheet\";\n";
if($wgLang->isRTL()) $s .= "@import \"$wgStylePath/common_rtl.css\";\n";
- if( $wgUser->getID() != 0 ) { # logged in
+ if( $wgAllowUserCss && $wgUser->getID() != 0 ) { # logged in
if($wgTitle->isCssSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
$s .= $wgRequest->getText('wpTextbox1');
} else {
function getCategoryLinks () {
global $wgOut, $wgTitle, $wgUser, $wgParser;
global $wgUseCategoryMagic, $wgUseCategoryBrowser, $wgLang;
+
if( !$wgUseCategoryMagic ) return '' ;
if( count( $wgOut->mCategoryLinks ) == 0 ) return '';
- if( !$wgOut->isArticle() ) return '';
+
+ # Taken out so that they will be displayed in previews -- TS
+ #if( !$wgOut->isArticle() ) return '';
$t = implode ( ' | ' , $wgOut->mCategoryLinks ) ;
$s = $this->makeKnownLink( 'Special:Categories',
function pageStats()
{
global $wgOut, $wgLang, $wgArticle, $wgRequest;
- global $wgDisableCounters;
+ global $wgDisableCounters, $wgMaxCredits, $wgShowCreditsIfMax;
extract( $wgRequest->getValues( 'oldid', 'diff' ) );
if ( ! $wgOut->isArticle() ) { return ''; }
}
}
- $s .= ' ' . $this->getCredits();
-
- return $s . ' ' . $this->getCopyright();
- }
-
- function getCredits() {
- global $wgMaxCredits;
-
- $s = '';
-
- if (!isset($wgMaxCredits) || $wgMaxCredits == 0) {
- $s = $this->lastModified();
- } else {
- $s = $this->getAuthorCredits();
- if ($wgMaxCredits > 1) {
- $s .= ' ' . $this->getContributorCredits();
- }
- }
-
- return $s;
- }
-
- function getAuthorCredits() {
- global $wgLang, $wgArticle;
-
- $last_author = $wgArticle->getUser();
-
- if ($last_author == 0) {
- $author_credit = wfMsg('anonymous');
+ if (isset($wgMaxCredits) && $wgMaxCredits != 0) {
+ require_once("Credits.php");
+ $s .= ' ' . getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax);
} else {
- $real_name = User::whoIsReal($last_author);
- if (!empty($real_name)) {
- $author_credit = $real_name;
- } else {
- $author_credit = wfMsg('siteuser', User::whoIs($last_author));
- }
+ $s .= $this->lastModified();
}
- $timestamp = $wgArticle->getTimestamp();
- if ( $timestamp ) {
- $d = $wgLang->timeanddate( $wgArticle->getTimestamp(), true );
- } else {
- $d = '';
- }
- return wfMsg('lastmodifiedby', $d, $author_credit);
+ return $s . ' ' . $this->getCopyright();
}
-
- function getContributorCredits() {
-
- global $wgArticle, $wgMaxCredits, $wgLang;
-
- # don't count last editor
-
- $contributors = $wgArticle->getContributors($wgMaxCredits - 1);
-
- $real_names = array();
- $user_names = array();
-
- # Sift for real versus user names
+
+ function getCopyright() {
+ global $wgRightsPage, $wgRightsUrl, $wgRightsText, $wgRequest;
- foreach ($contributors as $user_id => $user_parts) {
- if ($user_id != 0) {
- if (!empty($user_parts[1])) {
- $real_names[$user_id] = $user_parts[1];
- } else {
- $user_names[$user_id] = $user_parts[0];
- }
- }
- }
-
- $real = $wgLang->listToText(array_values($real_names));
- $user = $wgLang->listToText(array_values($user_names));
-
- if (!empty($user)) {
- $user = wfMsg('siteusers', $user);
- }
-
- if ($contributors[0] && $contributors[0][0] > 0) {
- $anon = wfMsg('anonymous');
+
+ $oldid = $wgRequest->getVal( 'oldid' );
+ $diff = $wgRequest->getVal( 'diff' );
+
+ if ( !is_null( $oldid ) && is_null( $diff ) && wfMsg( 'history_copyright' ) !== '-' ) {
+ $msg = 'history_copyright';
} else {
- $anon = '';
+ $msg = 'copyright';
}
-
- $creds = $wgLang->listToText(array($real, $user, $anon));
-
- return wfMsg('othercontribs', $creds);
- }
-
- function getCopyright() {
- global $wgRightsPage, $wgRightsUrl, $wgRightsText;
+
$out = '';
if( $wgRightsPage ) {
$link = $this->makeKnownLink( $wgRightsPage, $wgRightsText );
# Give up now
return $out;
}
- $out .= wfMsg( 'copyright', $link );
+ $out .= wfMsg( $msg, $link );
return $out;
}
function specialPagesList()
{
global $wgUser, $wgOut, $wgLang, $wgServer, $wgRedirectScript;
+ require_once('SpecialPage.php');
$a = array();
$pages = SpecialPage::getPages();
$fname = 'Skin::makeKnownLinkObj';
wfProfileIn( $fname );
+ if ( !is_object( $nt ) ) {
+ return $text;
+ }
$link = $nt->getPrefixedURL();
if ( '' == $link ) {
if(!is_object($title)) {
$title = Title::newFromText( $name );
if(!is_object($title)) {
- $title = Title::newFromText( '<error: link target missing>' );
+ $title = Title::newFromText( '--error: link target missing--' );
}
}
}
$r .= '<img src="'.$wgStylePath.'/images/Arr_.png" width="12" height="12" border="0" />' ;
$r .= '<tt>' ;
- if ( $rc_type == RC_MOVE ) {
+ if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
$r .= ' ';
} else {
# M & N (minor & new)
if ( $rcObj->watched ) $link = '<strong>'.$link.'</strong>' ;
$r .= $link ;
- # Cur
+ # Diff
$r .= ' (' ;
- $r .= $rcObj->curlink ;
+ $r .= $rcObj->difflink ;
$r .= '; ' ;
# Hist
$r .= $rcObj->usertalklink ;
# Comment
- if ( $rc_comment != '' && $rc_type != RC_MOVE ) {
+ if ( $rc_comment != '' && $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) {
$rc_comment=$this->formatComment($rc_comment);
$r .= $wgLang->emphasize( ' ('.$rc_comment.')' );
}
}
$s .= '<li> ';
- if ( $rc_type == RC_MOVE ) {
+ if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
# Diff
$s .= '(' . wfMsg( 'diff' ) . ') (';
# Hist
') . . ';
# "[[x]] moved to [[y]]"
-
- $s .= wfMsg( '1movedto2', $this->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ),
+ if ( $rc_type == RC_MOVE ) {
+ $msg = '1movedto2';
+ } else {
+ $msg = '1movedto2_redir';
+ }
+ $s .= wfMsg( $msg, $this->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ),
$this->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) );
-
} else {
# Diff link
if ( $rc_type == RC_NEW || $rc_type == RC_LOG ) {
if($userTalkLink) $s.=' ('.$userTalkLink.')';
# Add comment
- if ( '' != $rc_comment && '*' != $rc_comment && $rc_type != RC_MOVE ) {
+ if ( '' != $rc_comment && '*' != $rc_comment && $rc_type != RC_MOVE && $rc_type != RC_MOVE_OVER_REDIRECT ) {
$rc_comment=$this->formatComment($rc_comment);
$s .= $wgLang->emphasize(' (' . $rc_comment . ')');
}
}
# Make article link
- if ( $rc_type == RC_MOVE ) {
- $clink = $this->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' );
- $clink .= ' ' . wfMsg('movedto') . ' ';
- $clink .= $this->makeKnownLinkObj( $rc->getMovedToTitle(), '' );
+ if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
+ if ( $rc_type == RC_MOVE ) {
+ $msg = "1movedto2";
+ } else {
+ $msg = "1movedto2_redir";
+ }
+ $clink = wfMsg( $msg, $this->makeKnownLinkObj( $rc->getTitle(), '', 'redirect=no' ),
+ $this->makeKnownLinkObj( $rc->getMovedToTitle(), '' ) );
} else {
$clink = $this->makeKnownLinkObj( $rc->getTitle(), '' ) ;
}
$rc->link = $clink ;
$rc->timestamp = $time;
- # Make "cur" link
- if ( ( $rc_type == RC_NEW && $rc_this_oldid == 0 ) || $rc_type == RC_LOG || $rc_type == RC_MOVE) {
+ # Make "cur" and "diff" links
+ if ( ( $rc_type == RC_NEW && $rc_this_oldid == 0 ) || $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
$curLink = wfMsg( 'cur' );
- } else {
- $curLink = $this->makeKnownLinkObj( $rc->getTitle(), wfMsg( 'cur' ),
- $curIdEq.'&diff=0&oldid='.$rc_this_oldid ,'' ,'' , ' tabindex="'.$baseRC->counter.'"' );
+ $diffLink = wfMsg( 'diff' );
+ } else {
+ $query = $curIdEq.'&diff=0&oldid='.$rc_this_oldid;
+ $aprops = ' tabindex="'.$baseRC->counter.'"';
+ $curLink = $this->makeKnownLinkObj( $rc->getTitle(), wfMsg( 'cur' ), $query, '' ,'' , $aprops );
+ $diffLink = $this->makeKnownLinkObj( $rc->getTitle(), wfMsg( 'diff'), $query, '' ,'' , $aprops );
}
# Make "last" link
$titleObj = $rc->getTitle();
- if ( $rc_last_oldid == 0 || $rc_type == RC_LOG || $rc_type == RC_MOVE ) {
+ if ( $rc_last_oldid == 0 || $rc_type == RC_LOG || $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
$lastLink = wfMsg( 'last' );
} else {
$lastLink = $this->makeKnownLinkObj( $rc->getTitle(), wfMsg( 'last' ),
$rc->userlink = $userLink ;
$rc->lastlink = $lastLink ;
$rc->curlink = $curLink ;
+ $rc->difflink = $diffLink;
+
# Make user talk link
$utns=$wgLang->getNsText(NS_USER_TALK);
# Page moves go on their own line
$title = $rc->getTitle();
$secureName = $title->getPrefixedDBkey();
- if ( $rc_type == RC_MOVE ) {
+ if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
# Use an @ character to prevent collision with page names
$this->rc_cache['@@' . ($this->rcMoveIndex++)] = array($rc);
} else {
}
}
-
-require_once( 'SkinStandard.php' );
-require_once( 'SkinNostalgia.php' );
-require_once( 'SkinCologneBlue.php' );
-
-if( $wgUsePHPTal ) {
- require_once( 'SkinPHPTal.php' );
-}
-
-
?>