Difference between revisions of "PsyCrit/archive/skin"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
 
m (→‎Contents: now with syntax highlighting (note: apostrophe in comment in HTML causes highlighting bug))
Line 4: Line 4:
 
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.
 
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==
 
==Contents==
<pre>
+
<php>
 
<?php
 
<?php
 
/**
 
/**
Line 203: Line 203:
 
<?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
 
<?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
 
<h1 class="firstHeading"><?php $this->data['displaytitle']!=""?$this->text('title'):$this->html('title') ?></h1>
 
<h1 class="firstHeading"><?php $this->data['displaytitle']!=""?$this->text('title'):$this->html('title') ?></h1>
 +
<div id="bodyContent">
 +
<h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
 +
<div id="contentSub"><?php $this->html('subtitle') ?></div>
 +
<?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['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 -->
 +
<?php $this->html('bodytext') ?>
 +
<?php if($this->data['catlinks']) { ?><div id="catlinks"><?php      $this->html('catlinks') ?></div><?php } ?>
 +
<!-- end content -->
 +
<div class="visualClear"></div>
 +
</div>
 +
</div>
 +
</div>
 +
<div id="column-one">
 +
 +
<!--
 +
2006-07-26 This section normally displays the per-user options at the top; we are turning those off.
 +
2006-07-31 This would need to be relocated anyway, to fit in with the HTML-based layout
 +
 +
<div class="portlet" id="p-personal">
 +
<h5><?php $this->msg('personaltools') ?></h5>
 +
<div class="pBody">
 +
<ul>
 +
<?php foreach($this->data['personal_urls'] as $key => $item) { ?>
 +
<li id="pt-<?php echo htmlspecialchars($key) ?>"<?php
 +
if ($item['active']) { ?> class="active"<?php } ?>><a href="<?php
 +
echo htmlspecialchars($item['href']) ?>"<?php
 +
if(!empty($item['class'])) { ?> class="<?php
 +
echo htmlspecialchars($item['class']) ?>"<?php } ?>><?php
 +
echo htmlspecialchars($item['text']) ?></a></li>
 +
<?php } ?>
 +
</ul>
 +
</div>
 +
</div>
 +
-->
 +
 +
<div class="visualClear"></div>
 +
<?php
 +
if($this->data['poweredbyico']) { ?>
 +
<div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div>
 +
<?php }
 +
if($this->data['copyrightico']) { ?>
 +
<div id="f-copyrightico"><?php $this->html('copyrightico') ?></div>
 +
<?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>
 +
</div>
 +
<?php $this->html('reporttime') ?>
 +
<div id="footer">
 +
<ul id="f-list">
 +
<?php
 +
// Generate additional footer links
 +
foreach( $footerlinks as $aLink ) {
 +
if( $this->data[$aLink] ) {
 +
?> <li id="<?php echo$aLink?>"><?php $this->html($aLink) ?></li>
 +
<?php }
 +
}
 +
?>
 +
</ul>
 +
</div>
 +
</body></html>
 +
<?php
 +
wfRestoreWarnings();
 +
} // end of execute() method
 +
} // end of class
 +
?>
 +
</php>
 +
 +
<h1 class="firstHeading"><?php $this->data['displaytitle']!=""?$this->text('title'):$this->html('title') ?></h1>
 
<div id="bodyContent">
 
<div id="bodyContent">
 
<h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
 
<h3 id="siteSub"><?php $this->msg('tagline') ?></h3>

Revision as of 01:32, 15 May 2007

Navigation

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') ?> <?php $this->text('pagetitle') ?> data['printable']) ) { ?>media="print" href="text('stylepath') ?>/common/commonPrint.css" /> data['jsvarurl' ]) { ?> data['pagecss' ]) { ?> data['usercss' ]) { ?> data['userjs' ]) { ?> data['userjsprev']) { ?> data['trackbackhtml']) print $this->data['trackbackhtml']; ?> html('headscripts') ?> data['body_ondblclick']) { ?>ondblclick="text('body_ondblclick') ?>" data['body_onload' ]) { ?>onload="text('body_onload') ?>" class="text('nsclass') ?> text('dir') ?>">

href="data['nav_urls']['mainpage']['href'])?>" title="msg('mainpage') ?>">
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['sitenotice']) { ?>
html('sitenotice') ?>

data['displaytitle']!=""?$this->text('title'):$this->html('title') ?>

msg('tagline') ?>

html('subtitle') ?>
data['undelete']) { ?>
html('undelete') ?>
data['newtalk'] ) { ?>
html('newtalk') ?>
data['showjumplinks']) { ?> html('bodytext') ?> data['catlinks']) { ?>
data['poweredbyico']) { ?>
html('poweredbyico') ?>
data['copyrightico']) { ?>
html('copyrightico') ?>
html('reporttime') ?> <?php wfRestoreWarnings(); } // end of execute() method } // end of class ?> </php>

<?php $this->data['displaytitle']!=""?$this->text('title'):$this->html('title') ?>

<?php $this->msg('tagline') ?>

<?php $this->html('subtitle') ?>
<?php if($this->data['undelete']) { ?>
<?php $this->html('undelete') ?>
<?php } ?> <?php if($this->data['newtalk'] ) { ?>
<?php $this->html('newtalk') ?>
<?php } ?> <?php if($this->data['showjumplinks']) { ?>
<?php $this->msg('jumpto') ?> <a href="#column-one"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a>
<?php } ?>

<?php $this->html('bodytext') ?>

<?php if($this->data['catlinks']) { ?><?php } ?>


<?php if($this->data['poweredbyico']) { ?>

<?php $this->html('poweredbyico') ?>

<?php } if($this->data['copyrightico']) { ?>

<?php $this->html('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 ?>