}
} ;
+
+# The main skin class that provide methods and properties for all other skins
+# including PHPTal skins.
+# This base class is also the "Standard" skin.
+
class Skin {
/* private */ var $lastdate, $lastline;
var $rcMoveIndex;
var $postParseLinkColour = true;
- function Skin()
- {
+ function Skin() {
global $wgUseOldExistenceCheck;
$postParseLinkColour = !$wgUseOldExistenceCheck;
$this->linktrail = wfMsg('linktrail');
}
- function getSkinNames()
- {
+ function getSkinNames() {
global $wgValidSkinNames;
return $wgValidSkinNames;
}
- function getStylesheet()
- {
+ function getStylesheet() {
return 'wikistandard.css';
}
+
function getSkinName() {
- return "standard";
+ return 'standard';
}
# Get/set accessor for delayed link colouring
return wfSetVar( $this->postParseLinkColour, $setting );
}
- function qbSetting()
- {
+ function qbSetting() {
global $wgOut, $wgUser;
if ( $wgOut->isQuickbarSuppressed() ) { return 0; }
return $q;
}
- function initPage( &$out )
- {
+ function initPage( &$out ) {
$fname = 'Skin::initPage';
wfProfileIn( $fname );
$s .= $this->doGetUserStyles();
return $s."\n";
}
+
# placeholder, returns generated js in monobook
- function getUserJs() {
- return;
- }
+ function getUserJs() { return; }
- function getUserStyles()
- {
+ # Return html code that include User stylesheets
+ function getUserStyles() {
global $wgOut, $wgStylePath, $wgLang;
$s = "<style type='text/css'>\n";
$s .= "/*/*/ /*<![CDATA[*/\n"; # <-- Hide the styles from Netscape 4 without hiding them from IE/Mac
return $s;
}
- function doGetUserStyles()
- {
+ # Some styles that are set by user through the user settings interface.
+ function doGetUserStyles() {
global $wgUser, $wgLang;
- $csspage = $wgLang->getNsText( NS_MEDIAWIKI ) . ":" . $this->getSkinName() . ".css";
+ $csspage = $wgLang->getNsText( NS_MEDIAWIKI ) . ':' . $this->getSkinName() . '.css';
$s = '@import "'.$this->makeUrl($csspage, 'action=raw&ctype=text/css')."\";\n";
if ( 1 == $wgUser->getOption( 'underline' ) ) {
return $r;
}
- function getLogo()
- {
+ # URL to the logo
+ function getLogo() {
global $wgLogo;
return $wgLogo;
}
}
}
- function getQuickbarCompensator( $rows = 1 )
- {
+ function getQuickbarCompensator( $rows = 1 ) {
return "<td width='152' rowspan='{$rows}'> </td>";
}
# This gets called immediately before the </body> tag.
#
- function afterContent()
- {
+ function afterContent() {
global $wgUser, $wgOut, $wgServer;
global $wgTitle, $wgLang;
"</p>\n\n<p>" . $this->pageStats() . "</p>\n";
}
- function doAfterContent()
- {
+ function doAfterContent() {
global $wgUser, $wgOut, $wgLang;
$fname = 'Skin::doAfterContent';
wfProfileIn( $fname );
return $s;
}
- function pageTitleLinks()
- {
+ function pageTitleLinks() {
global $wgOut, $wgTitle, $wgUser, $wgLang, $wgUseApproval, $wgRequest;
extract( $wgRequest->getValues( 'oldid', 'diff' ) );
return '';
}
- function printableLink()
- {
+ function printableLink() {
global $wgOut, $wgFeedClasses, $wgRequest;
$baseurl = $_SERVER['REQUEST_URI'];
return $s;
}
- function pageTitle()
- {
+ function pageTitle() {
global $wgOut, $wgTitle, $wgUser;
$s = '<h1 class="pagetitle">' . htmlspecialchars( $wgOut->getPageTitle() ) . '</h1>';
return $s;
}
- function pageSubtitle()
- {
+ function pageSubtitle() {
global $wgOut;
$sub = $wgOut->getSubtitle();
return $s;
}
- function subPageSubtitle()
- {
+ function subPageSubtitle() {
global $wgOut,$wgTitle,$wgNamespacesWithSubpages;
$subpages = '';
if($wgOut->isArticle() && !empty($wgNamespacesWithSubpages[$wgTitle->getNamespace()])) {
return $subpages;
}
- function nameAndLogin()
- {
+ function nameAndLogin() {
global $wgUser, $wgTitle, $wgLang, $wgShowIPinHeader, $wgIP;
$li = $wgLang->specialPage( 'Userlogin' );
return htmlspecialchars( $this->getSearchLink() );
}
- function searchForm()
- {
+ function searchForm() {
global $wgRequest;
$search = $wgRequest->getText( 'search' );
return $s;
}
- function topLinks()
- {
+ function topLinks() {
global $wgOut;
$sep = " |\n";
return $s;
}
- function bottomLinks()
- {
+ function bottomLinks() {
global $wgOut, $wgUser, $wgTitle;
$sep = " |\n";
return $s;
}
- function pageStats()
- {
+ function pageStats() {
global $wgOut, $wgLang, $wgArticle, $wgRequest;
global $wgDisableCounters, $wgMaxCredits, $wgShowCreditsIfMax;
return $img;
}
- function lastModified()
- {
+ function lastModified() {
global $wgLang, $wgArticle;
$timestamp = $wgArticle->getTimestamp();
return $s;
}
- function logoText( $align = '' )
- {
+ function logoText( $align = '' ) {
if ( '' != $align ) { $a = " align='{$align}'"; }
else { $a = ''; }
return $s;
}
- function quickBar()
- {
+ function quickBar() {
global $wgOut, $wgTitle, $wgUser, $wgRequest, $wgLang;
global $wgDisableUploads, $wgRemoteUploads;
return $s;
}
- function specialPagesList()
- {
+ function specialPagesList() {
global $wgUser, $wgOut, $wgLang, $wgServer, $wgRedirectScript;
require_once('SpecialPage.php');
$a = array();
return $s;
}
- function mainPageLink()
- {
+ function mainPageLink() {
$mp = wfMsg( 'mainpage' );
$s = $this->makeKnownLink( $mp, $mp );
return $s;
}
- function copyrightLink()
- {
+ function copyrightLink() {
$s = $this->makeKnownLink( wfMsg( 'copyrightpage' ),
wfMsg( 'copyrightpagename' ) );
return $s;
}
- function aboutLink()
- {
+ function aboutLink() {
$s = $this->makeKnownLink( wfMsg( 'aboutpage' ),
wfMsg( 'aboutwikipedia' ) );
return $s;
}
- function disclaimerLink()
- {
+ function disclaimerLink() {
$s = $this->makeKnownLink( wfMsg( 'disclaimerpage' ),
wfMsg( 'disclaimers' ) );
return $s;
}
- function editThisPage()
- {
+ function editThisPage() {
global $wgOut, $wgTitle, $wgRequest;
$oldid = $wgRequest->getVal( 'oldid' );
if ( !is_null( $redirect ) ) { $red = "&redirect={$redirect}"; }
if ( $oldid && ! isset( $diff ) ) {
- $oid = "&oldid={$oldid}";
+ $oid = '&oldid='.$oldid;
}
$s = $this->makeKnownLink( $n, $t, "action=edit{$oid}{$red}" );
}
return $s;
}
- function deleteThisPage()
- {
+ function deleteThisPage() {
global $wgUser, $wgOut, $wgTitle, $wgRequest;
$diff = $wgRequest->getVal( 'diff' );
return $s;
}
- function protectThisPage()
- {
+ function protectThisPage() {
global $wgUser, $wgOut, $wgTitle, $wgRequest;
$diff = $wgRequest->getVal( 'diff' );
return $s;
}
- function watchThisPage()
- {
+ function watchThisPage() {
global $wgUser, $wgOut, $wgTitle;
if ( $wgOut->isArticleRelated() ) {
return $s;
}
- function moveThisPage()
- {
+ function moveThisPage() {
global $wgTitle, $wgLang;
if ( $wgTitle->userCanEdit() ) {
return $s;
}
- function historyLink()
- {
+ function historyLink() {
global $wgTitle;
$s = $this->makeKnownLink( $wgTitle->getPrefixedText(),
return $s;
}
- function whatLinksHere()
- {
+ function whatLinksHere() {
global $wgTitle, $wgLang;
$s = $this->makeKnownLink( $wgLang->specialPage( 'Whatlinkshere' ),
return $s;
}
- function userContribsLink()
- {
+ function userContribsLink() {
global $wgTitle, $wgLang;
$s = $this->makeKnownLink( $wgLang->specialPage( 'Contributions' ),
return $s;
}
- function emailUserLink()
- {
+ function emailUserLink() {
global $wgTitle, $wgLang;
$s = $this->makeKnownLink( $wgLang->specialPage( 'Emailuser' ),
return $s;
}
- function watchPageLinksLink()
- {
+ function watchPageLinksLink() {
global $wgOut, $wgTitle, $wgLang;
if ( ! $wgOut->isArticleRelated() ) {
return $s;
}
- function otherLanguages()
- {
+ function otherLanguages() {
global $wgOut, $wgLang, $wgTitle, $wgUseNewInterlanguage;
$a = $wgOut->getLanguageLinks();
return $s;
}
- function bugReportsLink()
- {
+ function bugReportsLink() {
$s = $this->makeKnownLink( wfMsg( 'bugreportspage' ),
wfMsg( 'bugreports' ) );
return $s;
}
- function dateLink()
- {
+ function dateLink() {
global $wgLinkCache;
$t1 = Title::newFromText( gmdate( 'F j' ) );
$t2 = Title::newFromText( gmdate( 'Y' ) );
return $s;
}
- function talkLink()
- {
+ function talkLink() {
global $wgLang, $wgTitle, $wgLinkCache;
$tns = $wgTitle->getNamespace();
return $s;
}
- function commentLink()
- {
+ function commentLink() {
global $wgLang, $wgTitle, $wgLinkCache;
$tns = $wgTitle->getNamespace();
# After all the page content is transformed into HTML, it makes
# a final pass through here for things like table backgrounds.
#
- function transformContent( $text )
- {
+ function transformContent( $text ) {
return $text;
}
}
# Pass a title object, not a title string
- function makeLinkObj( &$nt, $text= '', $query = '', $trail = '', $prefix = '' )
- {
+ function makeLinkObj( &$nt, $text= '', $query = '', $trail = '', $prefix = '' ) {
global $wgOut, $wgUser;
$fname = 'Skin::makeLinkObj';
}
# Pass a title object, not a title string
- function makeKnownLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '' )
- {
+ function makeKnownLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '' ) {
global $wgOut, $wgTitle, $wgInputEncoding;
$fname = 'Skin::makeKnownLinkObj';
}
# Pass a title object, not a title string
- function makeBrokenLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' )
- {
+ function makeBrokenLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
global $wgOut, $wgUser;
# Fail gracefully
}
# Pass a title object, not a title string
- function makeStubLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' )
- {
+ function makeStubLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
global $wgOut, $wgUser;
$link = $nt->getPrefixedURL();
return $s;
}
- function makeSelfLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' )
- {
+ function makeSelfLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
$u = $nt->escapeLocalURL( $query );
if ( '' == $text ) {
$text = htmlspecialchars( $nt->getPrefixedText() );
}
}
- function fnamePart( $url )
- {
+ function fnamePart( $url ) {
$basename = strrchr( $url, '/' );
if ( false === $basename ) {
$basename = $url;
return htmlspecialchars( $basename );
}
- function makeImage( $url, $alt = '' )
- {
+ function makeImage( $url, $alt = '' ) {
global $wgOut;
if ( '' == $alt ) {
return str_replace("\n", ' ', $s);
}
- function makeMediaLink( $name, $url, $alt = "" ) {
+ function makeMediaLink( $name, $url, $alt = '' ) {
$nt = Title::makeTitleSafe( Namespace::getMedia(), $name );
return $this->makeMediaLinkObj( $nt, $alt );
}
- function makeMediaLinkObj( $nt, $alt = "" )
- {
+ function makeMediaLinkObj( $nt, $alt = '' ) {
if ( ! isset( $nt ) )
{
### HOTFIX. Instead of breaking, return empty string.
return $s;
}
- function specialLink( $name, $key = "" )
- {
+ function specialLink( $name, $key = '' ) {
global $wgLang;
if ( '' == $key ) { $key = strtolower( $name ); }
#
# Returns text for the start of the tabular part of RC
- function beginRecentChangesList()
- {
+ function beginRecentChangesList() {
$this->rc_cache = array() ;
$this->rcMoveIndex = 0;
$this->rcCacheIndex = 0 ;
return '';
}
- function beginImageHistoryList()
- {
+ function beginImageHistoryList() {
$s = "\n<h2>" . wfMsg( 'imghistory' ) . "</h2>\n" .
"<p>" . wfMsg( 'imghistlegend' ) . "</p>\n".'<ul class="special">';
return $s;
# Returns text for the end of RC
# If enhanced RC is in use, returns pretty much all the text
- function endRecentChangesList()
- {
+ function endRecentChangesList() {
$s = $this->recentChangesBlock() ;
if( $this->rclistOpen ) {
$s .= "</ul>\n";
}
# Enhanced RC ungrouped line
- function recentChangesBlockLine ( $rcObj )
- {
+ function recentChangesBlockLine ( $rcObj ) {
global $wgStylePath, $wgLang ;
# Get rc_xxxx variables
}
# Enhanced RC group
- function recentChangesBlockGroup ( $block )
- {
+ function recentChangesBlockGroup ( $block ) {
global $wgStylePath, $wgLang ;
$r = '' ;
# If enhanced RC is in use, this function takes the previously cached
# RC lines, arranges them, and outputs the HTML
- function recentChangesBlock ()
- {
+ function recentChangesBlock () {
global $wgStylePath ;
if ( count ( $this->rc_cache ) == 0 ) return '' ;
$blockOut = '';
# Called in a loop over all displayed RC entries
# Either returns the line, or caches it for later use
- function recentChangesLine( &$rc, $watched = false )
- {
+ function recentChangesLine( &$rc, $watched = false ) {
global $wgUser ;
$usenew = $wgUser->getOption( 'usenewrc' );
if ( $usenew )
return $line ;
}
- function recentChangesLineOld( &$rc, $watched = false )
- {
+ function recentChangesLineOld( &$rc, $watched = false ) {
global $wgTitle, $wgLang, $wgUser, $wgRCSeconds, $wgUseRCPatrol, $wgOnlySysopsCanPatrol;
# Extract DB fields into local scope
return $s;
}
- function recentChangesLineNew( &$baseRC, $watched = false )
- {
+ function recentChangesLineNew( &$baseRC, $watched = false ) {
global $wgTitle, $wgLang, $wgUser, $wgRCSeconds;
# Create a specialised object
return $ret;
}
- function endImageHistoryList()
- {
+ function endImageHistoryList() {
$s = "</ul>\n";
return $s;
}
# Note: there's not always a title to pass to this function.
# Since you can't set a default parameter for a reference, I've turned it
# temporarily to a value pass. Should be adjusted further. --brion
- function formatComment($comment, $title = NULL)
- {
+ function formatComment($comment, $title = NULL) {
global $wgLang;
$comment = htmlspecialchars( $comment );
return $comment;
}
- function imageHistoryLine( $iscur, $timestamp, $img, $user, $usertext, $size, $description )
- {
+ function imageHistoryLine( $iscur, $timestamp, $img, $user, $usertext, $size, $description ) {
global $wgUser, $wgLang, $wgTitle;
$datetime = $wgLang->timeanddate( $timestamp, true );
// sure these keys are not defined on the edit page.
$toolarray=array(
array( 'image'=>'button_bold.png',
- 'open'=>"\'\'\'",
- 'close'=>"\'\'\'",
- 'sample'=>wfMsg('bold_sample'),
- 'tip'=>wfMsg('bold_tip'),
- 'key'=>'B'
+ 'open' => "\'\'\'",
+ 'close' => "\'\'\'",
+ 'sample'=> wfMsg('bold_sample'),
+ 'tip' => wfMsg('bold_tip'),
+ 'key' => 'B'
),
- array( "image"=>"button_italic.png",
- "open"=>"\'\'",
- "close"=>"\'\'",
- "sample"=>wfMsg("italic_sample"),
- "tip"=>wfMsg("italic_tip"),
- "key"=>"I"
+ array( 'image'=>'button_italic.png',
+ 'open' => "\'\'",
+ 'close' => "\'\'",
+ 'sample'=> wfMsg('italic_sample'),
+ 'tip' => wfMsg('italic_tip'),
+ 'key' => 'I'
),
- array( "image"=>"button_link.png",
- "open"=>"[[",
- "close"=>"]]",
- "sample"=>wfMsg("link_sample"),
- "tip"=>wfMsg("link_tip"),
- "key"=>"L"
+ array( 'image'=>'button_link.png',
+ 'open' => '[[',
+ 'close' => ']]',
+ 'sample'=> wfMsg('link_sample'),
+ 'tip' => wfMsg('link_tip'),
+ 'key' => 'L'
),
- array( "image"=>"button_extlink.png",
- "open"=>"[",
- "close"=>"]",
- "sample"=>wfMsg("extlink_sample"),
- "tip"=>wfMsg("extlink_tip"),
- "key"=>"X"
+ array( 'image'=>'button_extlink.png',
+ 'open' => '[',
+ 'close' => ']',
+ 'sample'=> wfMsg('extlink_sample'),
+ 'tip' => wfMsg('extlink_tip'),
+ 'key' => 'X'
),
- array( "image"=>"button_headline.png",
- "open"=>"\\n== ",
- "close"=>" ==\\n",
- "sample"=>wfMsg("headline_sample"),
- "tip"=>wfMsg("headline_tip"),
- "key"=>"H"
+ array( 'image'=>'button_headline.png',
+ 'open' => "\\n== ",
+ 'close' => " ==\\n",
+ 'sample'=> wfMsg('headline_sample'),
+ 'tip' => wfMsg('headline_tip'),
+ 'key' => 'H'
),
- array( "image"=>"button_image.png",
- "open"=>"[[".$wgLang->getNsText(NS_IMAGE).":",
- "close"=>"]]",
- "sample"=>wfMsg("image_sample"),
- "tip"=>wfMsg("image_tip"),
- "key"=>"D"
+ array( 'image'=>'button_image.png',
+ 'open' => '[['.$wgLang->getNsText(NS_IMAGE).":",
+ 'close' => ']]',
+ 'sample'=> wfMsg('image_sample'),
+ 'tip' => wfMsg('image_tip'),
+ 'key' => 'D'
),
- array( "image"=>"button_media.png",
- "open"=>"[[".$wgLang->getNsText(NS_MEDIA).":",
- "close"=>"]]",
- "sample"=>wfMsg("media_sample"),
- "tip"=>wfMsg("media_tip"),
- "key"=>"M"
+ array( 'image' => 'button_media.png',
+ 'open' => '[['.$wgLang->getNsText(NS_MEDIA).':',
+ 'close' => ']]',
+ 'sample'=> wfMsg('media_sample'),
+ 'tip' => wfMsg('media_tip'),
+ 'key' => 'M'
),
- array( "image"=>"button_math.png",
- "open"=>"\\<math\\>",
- "close"=>"\\</math\\>",
- "sample"=>wfMsg("math_sample"),
- "tip"=>wfMsg("math_tip"),
- "key"=>"C"
+ array( 'image' => 'button_math.png',
+ 'open' => "\\<math\\>",
+ 'close' => "\\</math\\>",
+ 'sample'=> wfMsg('math_sample'),
+ 'tip' => wfMsg('math_tip'),
+ 'key' => 'C'
),
- array( "image"=>"button_nowiki.png",
- "open"=>"\\<nowiki\\>",
- "close"=>"\\</nowiki\\>",
- "sample"=>wfMsg("nowiki_sample"),
- "tip"=>wfMsg("nowiki_tip"),
- "key"=>"N"
+ array( 'image' => 'button_nowiki.png',
+ 'open' => "\\<nowiki\\>",
+ 'close' => "\\</nowiki\\>",
+ 'sample'=> wfMsg('nowiki_sample'),
+ 'tip' => wfMsg('nowiki_tip'),
+ 'key' => 'N'
),
- array( "image"=>"button_sig.png",
- "open"=>"--~~~~",
- "close"=>"",
- "sample"=>"",
- "tip"=>wfMsg("sig_tip"),
- "key"=>"Y"
+ array( 'image' => 'button_sig.png',
+ 'open' => '--~~~~',
+ 'close' => '',
+ 'sample'=> '',
+ 'tip' => wfMsg('sig_tip'),
+ 'key' => 'Y'
),
- array( "image"=>"button_hr.png",
- "open"=>"\\n----\\n",
- "close"=>"",
- "sample"=>"",
- "tip"=>wfMsg("hr_tip"),
- "key"=>"R"
+ array( 'image' => 'button_hr.png',
+ 'open' => "\\n----\\n",
+ 'close' => '',
+ 'sample'=> '',
+ 'tip' => wfMsg('hr_tip'),
+ 'key' => 'R'
)
);
$toolbar ="<script type='text/javascript'>\n/*<![CDATA[*/\n";