r2854 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r2853‎ | r2854 | r2855 >
Date:23:13, 26 March 2004
Author:gabrielwicke
Status:old
Tags:
Comment:
* Mono Skin added
* oldid edit link in SkinPHPTal
* more extensive footer
Modified paths:
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/includes/SkinPHPTal.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SkinPHPTal.php
@@ -33,15 +33,16 @@
3434
3535 function initPage() {
3636 $this->skinname = "davinci";
 37+ $this->template = "xhtml_slim";
3738 }
3839
3940 function outputPage( &$out ) {
4041 global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgOut;
4142 global $wgScriptPath, $wgStyleSheetPath, $wgLanguageCode, $wgUseNewInterlanguage;
42 - global $wgOutputEncoding, $wgUseDatabaseMessages, $action;
 43+ global $wgOutputEncoding, $wgUseDatabaseMessages, $action, $oldid, $diff;
4344
4445 $this->initPage();
45 - $tpl = new PHPTAL($this->skinname . '.pt', 'templates');
 46+ $tpl = new PHPTAL($this->template . '.pt', 'templates');
4647 #if ( $wgUseDatabaseMessages ) { // uncomment this to fall back to GetText
4748
4849 $tpl->setTranslator(new MediaWiki_I18N());
@@ -53,6 +54,7 @@
5455 $tpl->setRef( "thispage", &$thispage );
5556 $tpl->set( "subtitle", $out->getSubtitle() );
5657 $tpl->setRef( 'charset', $wgOutputEncoding);
 58+ $tpl->setRef( 'skinname', $this->skinname );
5759
5860 $loggedin = $wgUser->getID() != 0;
5961 $tpl->setRef( "loggedin", &$loggedin );
@@ -85,6 +87,8 @@
8688 $tpl->setRef( "skin", &$this);
8789 $tpl->set( "logo", $this->logoText() );
8890 $tpl->set( "pagestats", $this->pageStats() );
 91+ $tpl->set( "disclaimer", $this->disclaimerLink() );
 92+ $tpl->set( "about", $this->aboutLink() );
8993
9094 $tpl->setRef( "debug", &$out->mDebugtext );
9195 $tpl->set( "reporttime", $out->reportTime() );
@@ -162,15 +166,21 @@
163167 'akey' => wfMsg('accesskey-talk'));
164168
165169 if ( $wgTitle->userCanEdit() ) {
 170+ if ( $oldid && ! isset( $diff ) ) {
 171+ $oid = "&oldid={$oldid}";
 172+ }
166173 $content_actions['edit'] = array('class' => ($action == 'edit' or $action == 'submit') ? 'selected' : '',
167174 'text' => wfMsg('edit'),
168 - 'href' => $this->makeUrl($thispage, 'action=edit'),
 175+ 'href' => $this->makeUrl($thispage, 'action=edit'.$oid),
169176 'ttip' => wfMsg('tooltip-edit'),
170177 'akey' => wfMsg('accesskey-edit'));
171178 } else {
 179+ if ( $oldid && ! isset( $diff ) ) {
 180+ $oid = "&oldid={$oldid}";
 181+ }
172182 $content_actions['edit'] = array('class' => ($action == 'edit') ? 'selected' : '',
173183 'text' => wfMsg('viewsource'),
174 - 'href' => $this->makeUrl($thispage, 'action=edit'),
 184+ 'href' => $this->makeUrl($thispage, 'action=edit'.$oid),
175185 'ttip' => wfMsg('tooltip-edit'),
176186 'akey' => wfMsg('accesskey-edit'));
177187 }
@@ -333,7 +343,16 @@
334344 function initPage() {
335345 SkinPHPTal::initPage();
336346 $this->skinname = "davinci";
 347+ $this->template = "xhtml_slim";
337348 }
338349 }
339350
 351+ class SkinMono extends SkinPHPTal {
 352+ function initPage() {
 353+ SkinPHPTal::initPage();
 354+ $this->skinname = "mono";
 355+ $this->template = "xhtml_slim";
 356+ }
 357+ }
 358+
340359 ?>
Index: trunk/phase3/includes/Skin.php
@@ -20,6 +20,7 @@
2121 if( $wgUsePHPTal ) {
2222 #$wgValidSkinNames[] = "PHPTal";
2323 $wgValidSkinNames['davinci'] = "DaVinci";
 24+ $wgValidSkinNames['mono'] = "Mono";
2425 }
2526
2627 include_once( "RecentChange.php" );
Index: trunk/phase3/languages/Language.php
@@ -99,7 +99,8 @@
100100 'cologneblue' => "Cologne Blue",
101101 'smarty' => "Paddington",
102102 'montparnasse' => "Montparnasse",
103 - 'davinci' => "DaVinci"
 103+ 'davinci' => "DaVinci",
 104+ 'mono' => "Mono"
104105 );
105106
106107 /* private */ $wgMathNamesEn = array(

Status & tagging log