Skip to content

Instantly share code, notes, and snippets.

@dantman
Created February 27, 2012 23:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dantman/1927993 to your computer and use it in GitHub Desktop.
Save dantman/1927993 to your computer and use it in GitHub Desktop.
Scalar skin (Example of a Vector derived skin)
<?php
/**
* Scalar skin
*
* @file
* @ingroup Skins
*/
if( !defined( 'MEDIAWIKI' ) ) die( "This is an extension to the MediaWiki package and cannot be run standalone." );
$wgValidSkinNames['scalar'] = 'Scalar';
$wgAutoloadClasses['SkinScalar'] = dirname(__FILE__).'/Scalar.skin.php';
$wgResourceModules['skins.scalar'] = array(
'styles' => array(
'scalar/screen.css' => array( 'media' => 'screen' ),
),
'remoteBasePath' => &$GLOBALS['wgStylePath'],
'localBasePath' => &$GLOBALS['wgStyleDirectory'],
);
<?php
/**
* Scalar
*
* @file
* @ingroup Skins
*/
if( !defined( 'MEDIAWIKI' ) )
die( -1 );
require_once( dirname( __FILE__ ) . '/../Vector.php' );
/**
* @ingroup Skins
*/
class SkinScalar extends SkinVector {
var $skinname = 'scalar', $stylename = 'scalar';
/**
* @param $out OutputPage
*/
function setupSkinUserCss( OutputPage $out ) {
global $wgHandheldStyle;
parent::setupSkinUserCss( $out );
$out->addModuleStyles( 'skins.scalar' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment