skinname = 'TW4MW'; $this->stylename = 'TW4MW'; $this->template = 'TW4MWTemplate'; } } class TW4MWTemplate extends QuickTemplate { /* hijack and modify category functions to create a proper list -- DEBUG: properly implemented? */ function getCategories() { $catlinks=$this->getCategoryLinks(); if(!empty($catlinks)) { return ""; } } function getCategoryLinks() { global $wgOut, $wgUser, $wgTitle, $wgUseCategoryBrowser; global $wgContLang; if( count( $wgOut->mCategoryLinks ) == 0 ) return ''; $skin = $wgUser->getSkin(); # Separator $sep = ""; // Use Unicode bidi embedding override characters, // to make sure links don't smash each other up in ugly ways. $dir = $wgContLang->isRTL() ? 'rtl' : 'ltr'; $embed = "
  • "; $pop = '
  • '; $t = $embed . implode ( "{$pop} {$sep} {$embed}" , $wgOut->mCategoryLinks ) . $pop; $msg = wfMsgExt( 'pagecategories', array( 'parsemag', 'escape' ), count( $wgOut->mCategoryLinks ) ); $s = $skin->makeLinkObj( Title::newFromText( wfMsgForContent('pagecategorieslink') ), $msg ) . $t; # optional 'dmoz-like' category browser. Will be shown under the list # of categories an article belong to if($wgUseCategoryBrowser) { $s .= '

    '; # get a big array of the parents tree $parenttree = $wgTitle->getParentCategoryTree(); # Skin object passed by reference cause it can not be # accessed under the method subfunction drawCategoryBrowser $tempout = explode("\n", Skin::drawCategoryBrowser($parenttree, $this) ); # Clean out bogus first entry and sort them unset($tempout[0]); asort($tempout); # Output one per line $s .= implode("
    \n", $tempout); } return $s; } /* compose page layout */ function execute() { global $wgUser, $wgSitename; $skin = $wgUser->getSkin(); // set certain data parts which aren't created by default $this->set('sitename', $wgSitename); // suppress warnings to prevent notices about missing indexes in $this->data wfSuppressWarnings(); $this->set( 'catlinks', $this->getCategories()); ?> data['xhtmlnamespaces'] as $tag => $ns) { ?>xmlns:xml:lang="text('lang') ?>" lang="text('lang') ?>" dir="text('dir') ?>"> html('headlinks') ?> <?php $this->text('pagetitle') ?> data['printable'])) { ?>media="print" href="text('stylepath') ?>/common/commonPrint.css?" /> Hide Handheld.css till we find some use for it */ ?> data); ?> 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="mediawiki text('nsclass') ?> text('dir') ?> text('pageclass') ?>"> data['sitenotice']) { ?>
    html('sitenotice') ?>
    data['catlinks']) { ?>
    html('catlinks') // DEBUG: messy formatting ?>

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

    html('subtitle') // DEBUG: conditional!? ?>
    data['undelete']) { ?>
    html('undelete') ?>
    html('bodytext') ?>
    html('bottomscripts'); // JavaScript call to runBodyOnloadHook ?> html('reporttime') ?> data['debug']): ?>