## Normally you don't need to change these once the above are set...
#
-$wgStylePath = "{$wgScriptPath}/style";
-$wgStyleSheetDirectory = "{$IP}/style";
+$wgStylePath = "{$wgScriptPath}/skins";
+$wgStyleSheetDirectory = "{$IP}/skins";
$wgUploadPath = "{$wgScriptPath}/upload";
$wgUploadDirectory = "{$IP}/upload";
* Support for faster C++ diff module (WikiDiff extension)
* More scary link caching modes
* Old manually maintained log pages replaced with searchable Special:Log
+* Skins system more modular : templates and css are now in /skins/
* ... and more!
=== Caveats ===
<div id="credit">
<center>
<a href="http://www.mediawiki.org/"><img
- src="../stylesheets/images/wiki.png" width="135" height="135" alt="" border="0" /></a>
+ src="../skins/common/images/wiki.png" width="135" height="135" alt="" border="0" /></a>
</center>
<b><a href="http://www.mediawiki.org/">MediaWiki</a></b> is
$conf->RightsUrl = "http://www.gnu.org/copyleft/fdl.html";
$conf->RightsText = "GNU Free Documentation License 1.2";
$conf->RightsCode = "gfdl";
- $conf->RightsIcon = '${wgStylePath}/images/gnu-fdl.png';
+ $conf->RightsIcon = '${wgStylePath}/common/images/gnu-fdl.png';
} elseif( $conf->License == "none" ) {
$conf->RightsUrl = $conf->RightsText = $conf->RightsCode = $conf->RightsIcon = "";
} else {
{$pretty}\$wgArticlePath = \"\$wgScript/\$1\";
{$ugly}\$wgArticlePath = \"\$wgScript?title=\$1\";
-\$wgStylePath = \"\$wgScriptPath/stylesheets\";
-\$wgStyleDirectory = \"\$IP/stylesheets\";
-\$wgLogo = \"\$wgStylePath/images/wiki.png\";
+\$wgStylePath = \"\$wgScriptPath/skins\";
+\$wgStyleDirectory = \"\$IP/skins\";
+\$wgLogo = \"\$wgStylePath/common/images/wiki.png\";
\$wgUploadPath = \"\$wgScriptPath/images\";
\$wgUploadDirectory = \"\$IP/images\";
$wgOut->addHTML( '<pre>'.htmlspecialchars($this->mContent)."\n</pre>" );
} else if ( $rt = Title::newFromRedirect( $text ) ) {
# Display redirect
- $imageUrl = $wgStylePath.'/images/redirect.png';
+ $imageUrl = $wgStylePath.'/common/images/redirect.png';
$targetUrl = $rt->escapeLocalURL();
$titleText = htmlspecialchars( $rt->getPrefixedText() );
$link = $sk->makeLinkObj( $rt );
} else {
$media = "media='print'";
}
- $printsheet = htmlspecialchars( "$wgStylePath/wikiprintable.css" );
+ $printsheet = htmlspecialchars( "$wgStylePath/common/wikiprintable.css" );
$ret .= "<link rel='stylesheet' type='text/css' $media href='$printsheet' />\n";
$sk = $wgUser->getSkin();
}
function getStylesheet() {
- return 'wikistandard.css';
+ return 'common/wikistandard.css';
}
function getSkinName() {
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');
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;
}
} 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>';
}
}
# 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 ) {
$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 .= ' ' ;
* 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.
+ * The necessary JavaScript code can be found in style/wikibits.js.
*/
function getEditToolbar() {
global $wgStylePath, $wgLang, $wgMimeType;
$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'] );
require_once $IP.'/PHPTAL-NP-0.7.0/libs/PHPTAL.php';
/**
- *
+ * @todo document
* @package MediaWiki
*/
class MediaWiki_I18N extends PHPTAL_I18N {
* @package MediaWiki
*/
class SkinPHPTal extends Skin {
+ /**#@+
+ * @access private
+ */
+
+ /**
+ * Name of our skin, set in initPage()
+ * It probably need to be all lower case.
+ */
+ var $skinname;
+
+ /**
+ * Stylesheets set to use
+ * Sub directory in ./skins/ where various stylesheets are located
+ */
+ var $stylename;
+
+ /**
+ * PHPTal template to be used.
+ * '.pt' will be automaticly added to it on PHPTAL object creation
+ */
var $template;
+ /**#@-*/
+
+ /** */
function initPage( &$out ) {
parent::initPage( $out );
- $this->skinname = 'monobook';
- $this->template = 'MonoBook';
+ $this->skinname = 'monobook';
+ $this->stylename = 'monobook';
+ $this->template = 'MonoBook';
}
/**
$tpl->setRef( 'mimetype', $wgMimeType );
$tpl->setRef( 'charset', $wgOutputEncoding );
$tpl->set( 'headlinks', $out->getHeadLinks() );
+ $tpl->setRef( 'wgScript', $wgScript );
$tpl->setRef( 'skinname', $this->skinname );
+ $tpl->setRef( 'stylename', $this->stylename );
$tpl->setRef( 'loggedin', $this->loggedin );
$tpl->set('nsclass', 'ns-'.$wgTitle->getNamespace());
/* XXX currently unused, might get useful later
$action = $wgRequest->getText('action');
$maxage = $wgRequest->getText('maxage');
$s = "/* generated user stylesheet */\n";
- if($wgLang->isRTL()) $s .= '@import "'.$wgStylePath.'/'.$this->skinname.'/rtl.css";'."\n";
+ if($wgLang->isRTL()) $s .= '@import "'.$wgStylePath.'/'.$this->stylename.'/rtl.css";'."\n";
$s .= '@import "'.
$this->makeNSUrl(ucfirst($this->skinname).'.css', 'action=raw&ctype=text/css&smaxage='.$wgSquidMaxage, NS_MEDIAWIKI)."\";\n";
if($wgUser->getID() != 0) {
<meta http-equiv="Content-Type" content="${mimetype}; charset=${charset}" />
${headlinks}
<title tal:content="pagetitle">Exciting xhtml slimfast</title>
- <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "${stylepath}/${skinname}/main.css"; /*]]>*/</style>
+ <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "${stylepath}/${stylename}/main.css"; /*]]>*/</style>
<script type="text/javascript" tal:attributes="src jsvarurl"></script>
- <script type="text/javascript" src="${stylepath}/wikibits.js"></script>
+ <script type="text/javascript" src="${stylepath}/common/wikibits.js"></script>
<style tal:condition="usercss" type="text/css">/*<![CDATA[*/ ${usercss} /*]]>*/</style>
<script tal:condition="userjs" type="text/javascript" tal:attributes="src userjs"></script><script
tal:condition="userjsprev" type="text/javascript">/*<![CDATA[*/${userjsprev}/*]]>*/</script>
class SkinCologneBlue extends Skin {
function getStylesheet() {
- return "cologneblue.css";
+ return "common/cologneblue.css";
}
function getSkinName() {
return "cologneblue";
function initPage( &$out ) {
SkinPHPTal::initPage( $out );
$this->skinname = 'mono';
+ $this->stylename = 'monobook';
$this->template = 'MonoBook';
}
}
require_once('includes/SkinPHPTal.php');
/**
+ * Inherit everything from SkinPHPTal
+ * This is a dummy skin as MonoBook is the default PHPTal skin.
* @todo document
* @package MediaWiki
* @subpackage Skins
*/
class SkinMonoBook extends SkinPHPTal {
+ /** Using monobook. */
function initPage( &$out ) {
SkinPHPTal::initPage( $out );
- $this->skinname = 'monobook';
+ $this->skinname = 'monobook';
+ $this->stylename = 'monobook';
+ $this->template = 'MonoBook';
}
}
<meta http-equiv="Content-Type" content="${mimetype}; charset=${charset}" />
${headlinks}
<title tal:content="pagetitle">Exciting xhtml slimfast</title>
- <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "${stylepath}/${skinname}/main.css"; /*]]>*/</style>
- <link rel="stylesheet" type="text/css" media="print" href="${stylepath}/commonPrint.css" />
- <!--[if IE]><style type="text/css" media="all">@import "${stylepath}/${skinname}/IEFixes.css";</style>
- <script type="text/javascript" src="${stylepath}/IEFixes.js"></script>
+ <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "${stylepath}/${stylename}/main.css"; /*]]>*/</style>
+ <link rel="stylesheet" type="text/css" media="print" href="${stylepath}/common/commonPrint.css" />
+ <!--[if IE]><style type="text/css" media="all">@import "${stylepath}/${stylename}/IEFixes.css";</style>
+ <script type="text/javascript" src="${stylepath}/common/IEFixes.js"></script>
<meta http-equiv="imagetoolbar" content="no" /><![endif]-->
<script type="text/javascript" tal:attributes="src jsvarurl"></script>
- <script type="text/javascript" src="${stylepath}/wikibits.js"></script>
+ <script type="text/javascript" src="${stylepath}/common/wikibits.js"></script>
<style tal:condition="usercss" type="text/css">/*<![CDATA[*/ ${usercss} /*]]>*/</style>
<script tal:condition="userjs" type="text/javascript" tal:attributes="src userjs"></script><script
tal:condition="userjsprev" type="text/javascript">/*<![CDATA[*/${userjsprev}/*]]>*/</script>
}
function getStylesheet() {
- return 'nostalgia.css';
+ return 'common/nostalgia.css';
}
function getSkinName() {
return "nostalgia";
$s = parent::getHeadScripts();
if ( 3 == $this->qbSetting() ) { # Floating left
$s .= "<script language='javascript' type='text/javascript' " .
- "src='{$wgStylePath}/sticky.js'></script>\n";
+ "src='{$wgStylePath}/common/sticky.js'></script>\n";
}
return $s;
}
$s = '';
if ( 3 == $this->qbSetting() ) { # Floating left
$s .= "<style type='text/css'>\n" .
- "@import '{$wgStylePath}/quickbar.css';\n</style>\n";
+ "@import '{$wgStylePath}/common/quickbar.css';\n</style>\n";
}
$s .= parent::getUserStyles();
return $s;
function initPage( &$out ) {
SkinPHPTal::initPage( $out );
$this->skinname = 'wikimediawiki';
+ $this->stylename = 'monobook';
$this->template = 'WikimediaWiki';
}
<meta http-equiv="Content-Type" content="${mimetype}; charset=${charset}" />
${headlinks}
<title tal:content="pagetitle">Exciting xhtml slimfast</title>
- <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "${stylepath}/${skinname}/main.css"; /*]]>*/</style>
- <link rel="stylesheet" type="text/css" media="print" href="${stylepath}/commonPrint.css" />
- <!--[if IE]><style type="text/css" media="all">@import "${stylepath}/${skinname}/IEFixes.css";</style>
+ <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "${stylepath}/${stylename}/main.css"; /*]]>*/</style>
+ <link rel="stylesheet" type="text/css" media="print" href="${stylepath}/common/commonPrint.css" />
+ <!--[if IE]><style type="text/css" media="all">@import "${stylepath}/${stylename}/common/IEFixes.css";</style>
<script type="text/javascript" src="${stylepath}/IEFixes.js"></script>
<meta http-equiv="imagetoolbar" content="no" /><![endif]-->
<script type="text/javascript" tal:attributes="src jsvarurl"></script>
- <script type="text/javascript" src="${stylepath}/wikibits.js"></script>
+ <script type="text/javascript" src="${stylepath}/common/wikibits.js"></script>
<style tal:condition="usercss" type="text/css">/*<![CDATA[*/ ${usercss} /*]]>*/</style>
<script tal:condition="userjs" type="text/javascript" tal:attributes="src userjs"></script><script
tal:condition="userjsprev" type="text/javascript">/*<![CDATA[*/${userjsprev}/*]]>*/</script>