Difference between revisions of "PsyCrit/archive/skin"
m (→Contents: now with syntax highlighting (note: apostrophe in comment in HTML causes highlighting bug)) |
(some code-tidying; there was a whole section repeated...) |
||
Line 208: | Line 208: | ||
<?php if($this->data['undelete']) { ?><div id="contentSub2"><?php $this->html('undelete') ?></div><?php } ?> | <?php if($this->data['undelete']) { ?><div id="contentSub2"><?php $this->html('undelete') ?></div><?php } ?> | ||
<?php if($this->data['newtalk'] ) { ?><div class="usermessage"><?php $this->html('newtalk') ?></div><?php } ?> | <?php if($this->data['newtalk'] ) { ?><div class="usermessage"><?php $this->html('newtalk') ?></div><?php } ?> | ||
− | <?php if($this->data['showjumplinks']) { ?><div id="jump-to-nav"><?php $this->msg('jumpto') ?> <a href="#column-one"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div><?php } ?> | + | <?php if($this->data['showjumplinks']) { ?><div id="jump-to-nav"><?php $this->msg('jumpto') ?> |
+ | <a href="#column-one"><?php $this->msg('jumptonavigation') ?></a>, | ||
+ | <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div><?php } ?> | ||
<!-- start content --> | <!-- start content --> | ||
<?php $this->html('bodytext') ?> | <?php $this->html('bodytext') ?> | ||
Line 271: | Line 273: | ||
<?php } | <?php } | ||
} | } | ||
− | ?> | + | ?><li>This website is in no way affiliated with "psyccritiques" or the American Psychological Association. |
</ul> | </ul> | ||
</div> | </div> | ||
Line 281: | Line 283: | ||
?> | ?> | ||
</php> | </php> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 01:40, 15 May 2007
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