PsyCrit/archive/skin
computing: software: MediaWiki: customization: outward-looking: modified skin
Overview
To create the custom skins for PsyCrit, I copied the "monobook" folder and "MonoBook.php" to "psycrit" and "PsyCrit.php" respectively. Then I edited PsyCrit.php, with the final results as follows.
Contents
<php> <?php /**
* MonoBook nouveau * * Translated from gwicke's previous TAL template version to remove * dependency on PHPTAL. * * @todo document * @package MediaWiki * @subpackage Skins */
if( !defined( 'MEDIAWIKI' ) ) die( -1 );
/** */ require_once('includes/SkinTemplate.php');
/**
* Inherit main code from SkinTemplate, set the CSS and template filter. * @todo document * @package MediaWiki * @subpackage Skins */
class SkinPsyCrit extends SkinTemplate { /** Using monobook. */ function initPage( &$out ) { SkinTemplate::initPage( $out ); $this->skinname = 'psycrit'; $this->stylename = 'psycrit'; $this->template = 'PsyCritTemplate'; } }
/**
* @todo document * @package MediaWiki * @subpackage Skins */
class PsyCritTemplate extends QuickTemplate { /** * Template filter callback for MonoBook skin. * Takes an associative array of data set from a SkinTemplate-based * class, and a wrapper for MediaWiki's localization database, and * outputs a formatted page. * * @access private */ function execute() { // Suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings();
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> text('lang') ?>" lang="text('lang') ?>" dir="text('dir') ?>"> html('headlinks') ?>
|
msg('views') ?>
-
data['content_actions'] as $key => $tab) {
# if ($wgUser->isAllowed($key)) { ? >
$tabOk = true;
if (($key == 'talk') || ($key == 'edit') || ($key == 'delete') || ($key == 'move')) {
switch ($key) {
case 'talk':
$tabOk = true;
break;
case 'edit':
$userGrps = $wgUser->getGroups();
$tabOk = in_array('sysop', $userGrps);
# $tabOk = true;
# $tabOk = false;
break;
case 'delete':
$tabOk = $wgUser->isAllowed('delete');
# $tabOk = true;
break;
case 'move':
$tabOk = $wgUser->isAllowed('move');
# $tabOk = true;
break;
}
}
if ($tabOk) { ?>
- class=""> */ // 2006-07-26 NEW CODE FOR JUST SHOWING JERS TABS // yes, there's a better way to do this which makes it easier to edit the tabs, // but I don't have time to figure it out now. $title = $this->data['title']; $kSelected = ' class="selected"'; switch ($title) { case 'Introduction': $class_Home = $kSelected; break; case 'About PsyCrit': $class_About = $kSelected; break; case 'Articles': $class_Main = $kSelected; break; case 'Instructions to Authors': $class_Auth = $kSelected; break; } ?>
- >introduction
- >about PsyCrit
- >articles
- >instructions to authors
data['displaytitle']!=""?$this->text('title'):$this->html('title') ?>
msg('tagline') ?>
<?php $this->data['displaytitle']!=""?$this->text('title'):$this->html('title') ?>
<?php $this->msg('tagline') ?>
<?php $this->html('bodytext') ?>
<?php if($this->data['catlinks']) { ?>
<?php if($this->data['poweredbyico']) { ?>
<?php } if($this->data['copyrightico']) { ?>
<?php }
?> <?php /* $footerlinks = array( 'lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright', 'privacy', 'about', 'disclaimer', 'tagline', */ $footerlinks = array( 'lastmod', 'viewcount', 'numberofwatchingusers', 'credits', 'copyright', 'tagline', ); ?> <script type="text/javascript"> if (window.runOnloadHook) runOnloadHook();</script>
<?php $this->html('reporttime') ?>
</body></html> <?php wfRestoreWarnings(); } // end of execute() method } // end of class ?>