<?php
-# This is not a valid entry point, perform no further processing unless MEDIAWIKI is defined
+/**
+ *
+ * @package MediaWiki
+ */
+
+/**
+ * This is not a valid entry point, perform no further processing unless MEDIAWIKI is defined
+ */
if( defined( "MEDIAWIKI" ) ) {
# See skin.doc
-
-require_once( 'Feed.php' ); // should not be called if the actual page isn't feed enabled
require_once( 'Image.php' );
# These are the INTERNAL names, which get mapped directly to class names and
# file names in ./skins/. For display purposes, the Language class has
# internationalized names
#
-/* private */ $wgValidSkinNames = array(
+/*
+$wgValidSkinNames = array(
'standard' => 'Standard',
'nostalgia' => 'Nostalgia',
'cologneblue' => 'CologneBlue'
$wgValidSkinNames['myskin'] = 'MySkin';
$wgValidSkinNames['chick'] = 'Chick';
}
+*/
+
+# Get a list of all skins available in /skins/
+# Build using the regular expression '^(.*).php$'
+# Array keys are all lower case, array value keep the case used by filename
+#
+
+$skinDir = dir($IP.'/skins');
+
+# while code from www.php.net
+while (false !== ($file = $skinDir->read())) {
+ if(preg_match('/^(.*).php$/',$file, $matches)) {
+ $aSkin = $matches[1];
+ $wgValidSkinNames[strtolower($aSkin)] = $aSkin;
+ }
+}
+$skinDir->close();
+unset($matches);
require_once( 'RecentChange.php' );
+/**
+ * @todo document
+ * @package MediaWiki
+ */
class RCCacheEntry extends RecentChange
{
var $secureName, $link;
} ;
-# The main skin class that provide methods and properties for all other skins
-# including PHPTal skins.
-# This base class is also the "Standard" skin.
-
+/**
+ * The main skin class that provide methods and properties for all other skins
+ * including PHPTal skins.
+ * This base class is also the "Standard" skin.
+ * @package MediaWiki
+ */
class Skin {
-
- /* private */ var $lastdate, $lastline;
+ /**#@+
+ * @access private
+ */
+ var $lastdate, $lastline;
var $linktrail ; # linktrail regexp
var $rc_cache ; # Cache for Enhanced Recent Changes
var $rcCacheIndex ; # Recent Changes Cache Counter for visibility toggle
var $rcMoveIndex;
var $postParseLinkColour = true;
+ /**#@-*/
function Skin() {
global $wgUseOldExistenceCheck;
}
function getStylesheet() {
- return 'wikistandard.css';
+ return 'common/wikistandard.css';
}
-
+
function getSkinName() {
return 'standard';
}
- # Get/set accessor for delayed link colouring
+ /**
+ * Get/set accessor for delayed link colouring
+ */
function postParseLinkColour( $setting = NULL ) {
return wfSetVar( $this->postParseLinkColour, $setting );
}
function getHeadScripts() {
global $wgStylePath, $wgUser, $wgLang, $wgAllowUserJs;
- $r = "<script type=\"text/javascript\" src=\"{$wgStylePath}/wikibits.js\"></script>\n";
+ $r = "<script type=\"text/javascript\" src=\"{$wgStylePath}/common/wikibits.js\"></script>\n";
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'));
$sheet = $this->getStylesheet();
$action = $wgRequest->getText('action');
$s = "@import \"$wgStylePath/$sheet\";\n";
- if($wgLang->isRTL()) $s .= "@import \"$wgStylePath/common_rtl.css\";\n";
+ if($wgLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_rtl.css\";\n";
if( $wgAllowUserCss && $wgUser->getID() != 0 ) { # logged in
if($wgTitle->isCssSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
$s .= $wgRequest->getText('wpTextbox1');
$s .= $this->doGetUserStyles();
return $s."\n";
}
-
- # placeholder, returns generated js in monobook
+
+ /**
+ * placeholder, returns generated js in monobook
+ */
function getUserJs() { return; }
- # Return html code that include User stylesheets
+ /**
+ * Return html code that include User stylesheets
+ */
function getUserStyles() {
global $wgOut, $wgStylePath, $wgLang;
$s = "<style type='text/css'>\n";
return $s;
}
- # Some styles that are set by user through the user settings interface.
+ /**
+ * Some styles that are set by user through the user settings interface.
+ */
function doGetUserStyles() {
global $wgUser, $wgLang;
return $s;
}
- function getBodyOptions()
- {
+ function getBodyOptions() {
global $wgUser, $wgTitle, $wgNamespaceBackgrounds, $wgOut, $wgRequest;
extract( $wgRequest->getValues( 'oldid', 'redirect', 'diff' ) );
return $a;
}
- function getExternalLinkAttributes( $link, $text, $class='' )
- {
+ function getExternalLinkAttributes( $link, $text, $class='' ) {
global $wgUser, $wgOut, $wgLang;
$link = urldecode( $link );
return $r;
}
- function getInternalLinkAttributes( $link, $text, $broken = false )
- {
+ function getInternalLinkAttributes( $link, $text, $broken = false ) {
global $wgUser, $wgOut;
$link = urldecode( $link );
return $r;
}
- function getInternalLinkAttributesObj( &$nt, $text, $broken = false )
- {
+ /**
+ * @param bool $broken
+ */
+ function getInternalLinkAttributesObj( &$nt, $text, $broken = false ) {
global $wgUser, $wgOut;
if ( $broken == 'stub' ) {
return $r;
}
- # URL to the logo
+ /**
+ * URL to the logo
+ */
function getLogo() {
global $wgLogo;
return $wgLogo;
}
- # This will be called immediately after the <body> tag. Split into
- # two functions to make it easier to subclass.
- #
- function beforeContent()
- {
+ /**
+ * This will be called immediately after the <body> tag. Split into
+ * two functions to make it easier to subclass.
+ */
+ function beforeContent() {
global $wgUser, $wgOut;
return $this->doBeforeContent();
}
- function doBeforeContent()
- {
+ function doBeforeContent() {
global $wgUser, $wgOut, $wgTitle, $wgLang, $wgSiteNotice;
$fname = 'Skin::doBeforeContent';
wfProfileIn( $fname );
# of categories an article belong to
if($wgUseCategoryBrowser) {
$s .= '<br/><hr/>';
-
+
# get a big array of the parents tree
$parenttree = $wgTitle->getCategorieBrowser();
}
return $return;
}
-
+
$s .= walkThrough($parenttree);
}
Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}",
wfMsg('newmessageslink') );
$s.= ' | <strong>'. wfMsg( 'newmessages', $tl ) . '</strong>';
+ # disable caching
+ $wgOut->setSquidMaxage(0);
}
}
$sub = $wgOut->getSubtitle();
if ( '' == $sub ) {
global $wgExtraSubtitle;
- $sub = wfMsg( 'fromwikipedia' ) . $wgExtraSubtitle;
+ $sub = wfMsg( 'tagline' ) . $wgExtraSubtitle;
}
$subpages = $this->subPageSubtitle();
$sub .= !empty($subpages)?"</p><p class='subpages'>$subpages":'';
function getPoweredBy() {
global $wgStylePath;
- $url = htmlspecialchars( "$wgStylePath/images/poweredby_mediawiki_88x31.png" );
+ $url = htmlspecialchars( "$wgStylePath/common/images/poweredby_mediawiki_88x31.png" );
$img = '<a href="http://www.mediawiki.org/"><img src="'.$url.'" alt="MediaWiki" /></a>';
return $img;
}
function aboutLink() {
$s = $this->makeKnownLink( wfMsg( 'aboutpage' ),
- wfMsg( 'aboutwikipedia' ) );
+ wfMsg( 'aboutsite' ) );
return $s;
}
return $s;
}
- # After all the page content is transformed into HTML, it makes
- # a final pass through here for things like table backgrounds.
- #
+ /**
+ * After all the page content is transformed into HTML, it makes
+ * a final pass through here for things like table backgrounds.
+ * @todo probably deprecated [AV]
+ */
function transformContent( $text ) {
return $text;
}
- # Note: This function MUST call getArticleID() on the link,
- # otherwise the cache won't get updated properly. See LINKCACHE.DOC.
- #
+ /**
+ * Note: This function MUST call getArticleID() on the link,
+ * otherwise the cache won't get updated properly. See LINKCACHE.DOC.
+ */
function makeLink( $title, $text = '', $query = '', $trail = '' ) {
wfProfileIn( 'Skin::makeLink' );
$nt = Title::newFromText( $title );
}
}
- # Pass a title object, not a title string
+ /**
+ * Pass a title object, not a title string
+ */
function makeLinkObj( &$nt, $text= '', $query = '', $trail = '', $prefix = '' ) {
global $wgOut, $wgUser;
$fname = 'Skin::makeLinkObj';
return $retVal;
}
- # Pass a title object, not a title string
+ /**
+ * Pass a title object, not a title string
+ */
function makeKnownLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '' ) {
global $wgOut, $wgTitle, $wgInputEncoding;
return $r;
}
- # Pass a title object, not a title string
+ /**
+ * Pass a title object, not a title string
+ */
function makeBrokenLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
global $wgOut, $wgUser;
return $s;
}
- # Pass a title object, not a title string
+ /**
+ * Pass a title object, not a title string
+ */
function makeStubLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
global $wgOut, $wgUser;
return str_replace("\n", ' ',$prefix.$s.$postfix);
}
- # Make HTML for a thumbnail including image, border and caption
- # $img is an Image object
+ /**
+ * Make HTML for a thumbnail including image, border and caption
+ * $img is an Image object
+ */
function makeThumbLinkObj( $img, $label = '', $align = 'right', $boxwidth = 180, $boxheight=false, $framed=false , $manual_thumb = "" ) {
global $wgStylePath, $wgLang;
# $image = Title::makeTitleSafe( NS_IMAGE, $name );
} else {
$zoomicon = '<div class="magnify" style="float:'.$magnifyalign.'">'.
'<a href="'.$u.'" class="internal" title="'.$more.'">'.
- '<img src="'.$wgStylePath.'/images/magnify-clip.png" ' .
+ '<img src="'.$wgStylePath.'/common/images/magnify-clip.png" ' .
'width="15" height="11" alt="'.$more.'" /></a></div>';
}
}
return $s;
}
- # Returns text for the end of RC
- # If enhanced RC is in use, returns pretty much all the text
+ /**
+ * Returns text for the end of RC
+ * If enhanced RC is in use, returns pretty much all the text
+ */
function endRecentChangesList() {
$s = $this->recentChangesBlock() ;
if( $this->rclistOpen ) {
return $s;
}
- # Enhanced RC ungrouped line
+ /**
+ * Enhanced RC ungrouped line
+ */
function recentChangesBlockLine ( $rcObj ) {
global $wgStylePath, $wgLang ;
# Spacer image
$r = '' ;
- $r .= '<img src="'.$wgStylePath.'/images/Arr_.png" width="12" height="12" border="0" />' ;
+ $r .= '<img src="'.$wgStylePath.'/common/images/Arr_.png" width="12" height="12" border="0" />' ;
$r .= '<tt>' ;
if ( $rc_type == RC_MOVE || $rc_type == RC_MOVE_OVER_REDIRECT ) {
return $r ;
}
- # Enhanced RC group
+ /**
+ * Enhanced RC group
+ */
function recentChangesBlockGroup ( $block ) {
global $wgStylePath, $wgLang ;
$rcm = 'RCM'.$this->rcCacheIndex ;
$toggleLink = "javascript:toggleVisibility('$rci','$rcm','$rcl')" ;
$arrowdir = $wgLang->isRTL() ? 'l' : 'r';
- $tl = '<span id="'.$rcm.'"><a href="'.$toggleLink.'"><img src="'.$wgStylePath.'/images/Arr_'.$arrowdir.'.png" width="12" height="12" /></a></span>' ;
- $tl .= '<span id="'.$rcl.'" style="display:none"><a href="'.$toggleLink.'"><img src="'.$wgStylePath.'/images/Arr_d.png" width="12" height="12" /></a></span>' ;
+ $tl = '<span id="'.$rcm.'"><a href="'.$toggleLink.'"><img src="'.$wgStylePath.'/common/images/Arr_'.$arrowdir.'.png" width="12" height="12" /></a></span>' ;
+ $tl .= '<span id="'.$rcl.'" style="display:none"><a href="'.$toggleLink.'"><img src="'.$wgStylePath.'/common/images/Arr_d.png" width="12" height="12" /></a></span>' ;
$r .= $tl ;
# Main line
# Get rc_xxxx variables
extract( $rcObj->mAttribs );
- $r .= '<img src="'.$wgStylePath.'/images/Arr_.png" width="12" height="12" />';
+ $r .= '<img src="'.$wgStylePath.'/common/images/Arr_.png" width="12" height="12" />';
$r .= '<tt> ' ;
if ( $rc_new ) $r .= $N ;
else $r .= ' ' ;
return $r ;
}
- # If enhanced RC is in use, this function takes the previously cached
- # RC lines, arranges them, and outputs the HTML
+ /**
+ * If enhanced RC is in use, this function takes the previously cached
+ * RC lines, arranges them, and outputs the HTML
+ */
function recentChangesBlock () {
global $wgStylePath ;
if ( count ( $this->rc_cache ) == 0 ) return '' ;
return '<div>'.$blockOut.'</div>' ;
}
- # Called in a loop over all displayed RC entries
- # Either returns the line, or caches it for later use
+ /**
+ * Called in a loop over all displayed RC entries
+ * Either returns the line, or caches it for later use
+ */
function recentChangesLine( &$rc, $watched = false ) {
global $wgUser ;
$usenew = $wgUser->getOption( 'usenewrc' );
return $s;
}
- /* This function is called by all recent changes variants, by the page history,
- and by the user contributions list. It is responsible for formatting edit
- comments. It escapes any HTML in the comment, but adds some CSS to format
- auto-generated comments (from section editing) and formats [[wikilinks]].
-
- The &$title parameter must be a title OBJECT. It is used to generate a
- direct link to the section in the autocomment.
- Main author: Erik Moeller (moeller@scireview.de)
- */
- # 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
+ /**
+ * This function is called by all recent changes variants, by the page history,
+ * and by the user contributions list. It is responsible for formatting edit
+ * comments. It escapes any HTML in the comment, but adds some CSS to format
+ * auto-generated comments (from section editing) and formats [[wikilinks]].
+ *
+ * The &$title parameter must be a title OBJECT. It is used to generate a
+ * direct link to the section in the autocomment.
+ * @author Erik Moeller <moeller@scireview.de>
+ *
+ * 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) {
global $wgLang;
$comment = htmlspecialchars( $comment );
$link='';
if($title) {
$section=$auto;
-
+
# This is hackish but should work in most cases.
$section=str_replace('[[','',$section);
$section=str_replace(']]','',$section);
return str_repeat( "</div>\n", $level>0 ? $level : 0 );
}
- # parameter level defines if we are on an indentation level
+ /**
+ * parameter level defines if we are on an indentation level
+ */
function tocLine( $anchor, $tocline, $level ) {
$link = '<a href="#'.$anchor.'">'.$tocline.'</a><br />';
if($level) {
$toc."</td></tr></table>\n";
}
- # These two do not check for permissions: check $wgTitle->userCanEdit before calling them
+ /**
+ * These two do not check for permissions: check $wgTitle->userCanEdit
+ * before calling them
+ */
function editSectionScript( $section, $head ) {
global $wgTitle, $wgRequest;
if( $wgRequest->getInt( 'oldid' ) && ( $wgRequest->getVal( 'diff' ) != '0' ) ) {
}
- // This function is called by EditPage.php and shows a bulletin board style
- // toolbar for common editing functions. It can be disabled in the user preferences.
- // The necsesary JavaScript code can be found in style/wikibits.js.
+ /**
+ * This function is called by EditPage.php and shows a bulletin board style
+ * toolbar for common editing functions. It can be disabled in the user
+ * preferences.
+ * The necessary JavaScript code can be found in style/wikibits.js.
+ */
function getEditToolbar() {
global $wgStylePath, $wgLang, $wgMimeType;
- // toolarray an array of arrays which each include the filename of
- // the button image (without path), the opening tag, the closing tag,
- // and optionally a sample text that is inserted between the two when no
- // selection is highlighted.
- // The tip text is shown when the user moves the mouse over the button.
-
- // Already here are accesskeys (key), which are not used yet until someone
- // can figure out a way to make them work in IE. However, we should make
- // sure these keys are not defined on the edit page.
+ /**
+ * toolarray an array of arrays which each include the filename of
+ * the button image (without path), the opening tag, the closing tag,
+ * and optionally a sample text that is inserted between the two when no
+ * selection is highlighted.
+ * The tip text is shown when the user moves the mouse over the button.
+ *
+ * Already here are accesskeys (key), which are not used yet until someone
+ * can figure out a way to make them work in IE. However, we should make
+ * sure these keys are not defined on the edit page.
+ */
$toolarray=array(
array( 'image'=>'button_bold.png',
'open' => "\'\'\'",
$toolbar.="document.writeln(\"<div id='toolbar'>\");\n";
foreach($toolarray as $tool) {
- $image=$wgStylePath.'/images/'.$tool['image'];
+ $image=$wgStylePath.'/common/images/'.$tool['image'];
$open=$tool['open'];
$close=$tool['close'];
$sample = addslashes( $tool['sample'] );
return $toolbar;
}
- /* public */ function suppressUrlExpansion() {
+ /**
+ * @access public
+ */
+ function suppressUrlExpansion() {
return false;
}
}