http://www.mediawiki.org/wiki/Special:Code/MediaWiki/54148

Revision: 54148
Author:   ialex
Date:     2009-08-01 13:12:04 +0000 (Sat, 01 Aug 2009)

Log Message:
-----------
Updated daddio skin to work currently with current MediaWiki.
Only tested with 1.16alpha, not sure it'll work on older versions.

Modified Paths:
--------------
    trunk/extensions/skins/Daddio/Daddio.class.php
    trunk/extensions/skins/Daddio/daddio/main.css

Modified: trunk/extensions/skins/Daddio/Daddio.class.php
===================================================================
--- trunk/extensions/skins/Daddio/Daddio.class.php      2009-08-01 13:01:24 UTC 
(rev 54147)
+++ trunk/extensions/skins/Daddio/Daddio.class.php      2009-08-01 13:12:04 UTC 
(rev 54148)
@@ -8,6 +8,10 @@
 if( !defined( 'MEDIAWIKI' ) )
        die( -1 );
 
+global $IP;
+// @todo Fixme: autoload ModernTemplate
+require_once( "$IP/skins/Modern.php" );
+
 /**
  * Inherit main code from SkinTemplate, set the CSS and template filter.
  * @todo document
@@ -20,13 +24,26 @@
                $this->stylename = 'daddio';
                $this->template  = 'DaddioTemplate';
        }
+
+       function setupSkinUserCss( OutputPage $out ){
+               global $wgScriptPath;
+
+               $path = "{$wgScriptPath}/extensions/skins/Daddio";
+
+               // Do not call parent::setupSkinUserCss(), we have our own 
print style
+               $out->addStyle( 'common/shared.css', 'screen' );
+               $out->addStyle( "$path/daddio/main.css", 'screen' );
+               $out->addStyle( "$path/daddio/print.css", 'print' );
+               $out->addStyle( "$path/daddio/rtl.css", 'screen', '', 'rtl' );
+       }
+
 }
 
 /**
  * @todo document
  * @addtogroup Skins
  */
-class DaddioTemplate extends QuickTemplate {
+class DaddioTemplate extends ModernTemplate {
        /**
         * Template filter callback for Daddio skin.
         * Takes an associative array of data set from a SkinTemplate-based
@@ -36,56 +53,19 @@
         * @access private
         */
        function execute() {
-               global $wgUser, $wgScriptPath;
-               $skin = $wgUser->getSkin();
-               $this->path = "{$wgScriptPath}/extensions/skins/Daddio";
+               global $wgRequest, $wgOut;
+               $this->skin = $skin = $this->data['skin'];
+               $action = $wgRequest->getText( 'action' );
                
                // 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";>
-<html xmlns="<?php $this->text('xhtmldefaultnamespace') ?>" <?php 
-       foreach($this->data['xhtmlnamespaces'] as $tag => $ns) {
-               ?>xmlns:<?php echo "{$tag}=\"{$ns}\" ";
-       } ?>xml:lang="<?php $this->text('lang') ?>" lang="<?php 
$this->text('lang') ?>" dir="<?php $this->text('dir') ?>">
-       <head>
-               <meta http-equiv="Content-Type" content="<?php 
$this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
-               <?php $this->html('headlinks') ?>
-               <?php $this->html('csslinks') ?>
-               <title><?php $this->text('pagetitle') ?></title>
-               <style type="text/css" media="screen, projection">/*<![CDATA[*/
-                       @import "<?php $this->text('stylepath') 
?>/common/shared.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";
-                       @import "<?php echo $this->path ?>/<?php 
$this->text('stylename') ?>/main.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";
-               /*]]>*/</style>
-               <link rel="stylesheet" type="text/css" <?php 
if(empty($this->data['printable']) ) { ?>media="print"<?php } ?> href="<?php 
echo $this->path ?>/<?php $this->text('stylename') ?>/print.css?<?php echo 
$GLOBALS['wgStyleVersion'] ?>" />
-               <!--[if lt IE 7]><meta http-equiv="imagetoolbar" content="no" 
/><![endif]-->
-               
-               <?php print Skin::makeGlobalVariablesScript( $this->data ); ?>
-                
-               <script type="<?php $this->text('jsmimetype') ?>" src="<?php 
$this->text('stylepath' ) ?>/common/wikibits.js?<?php echo 
$GLOBALS['wgStyleVersion'] ?>"><!-- wikibits js --></script>
-               <!-- Head Scripts -->
-<?php $this->html('headscripts') ?>
-<?php  if($this->data['jsvarurl'  ]) { ?>
-               <script type="<?php $this->text('jsmimetype') ?>" src="<?php 
$this->text('jsvarurl'  ) ?>"><!-- site js --></script>
-<?php  } ?>
-<?php  if($this->data['pagecss'   ]) { ?>
-               <style type="text/css"><?php $this->html('pagecss'   ) 
?></style>
-<?php  }
-               if($this->data['usercss'   ]) { ?>
-               <style type="text/css"><?php $this->html('usercss'   ) 
?></style>
-<?php  }
-               if($this->data['userjs'    ]) { ?>
-               <script type="<?php $this->text('jsmimetype') ?>" src="<?php 
$this->text('userjs' ) ?>"></script>
-<?php  }
-               if($this->data['userjsprev']) { ?>
-               <script type="<?php $this->text('jsmimetype') ?>"><?php 
$this->html('userjsprev') ?></script>
-<?php  }
-               if($this->data['trackbackhtml']) print 
$this->data['trackbackhtml']; ?>
-       </head>
-<body<?php if($this->data['body_ondblclick']) { ?> ondblclick="<?php 
$this->text('body_ondblclick') ?>"<?php } ?>
-<?php if($this->data['body_onload'    ]) { ?> onload="<?php     
$this->text('body_onload')     ?>"<?php } ?>
- class="mediawiki <?php $this->text('nsclass') ?> <?php $this->text('dir') ?> 
<?php $this->text('pageclass') ?>">
+               echo $wgOut->headElement( $this->skin );
 
+?><body<?php if( $this->data['body_ondblclick'] ) { ?> ondblclick="<?php 
$this->text( 'body_ondblclick' ) ?>"<?php } ?>
+<?php if( $this->data['body_onload'] ) { ?> onload="<?php $this->text( 
'body_onload' ) ?>"<?php } ?>
+ class="mediawiki <?php $this->text('dir' ) ?> <?php $this->text( 'pageclass' 
) ?> <?php $this->text( 'skinnameclass' ) ?>">
+
        <!-- heading -->
 
        <div id="mw_main">
@@ -137,109 +117,25 @@
 
        <div id="mw_portlets">
 
-       <!-- other portlets -->
-       <?php foreach ($this->data['sidebar'] as $bar => $cont) { ?>
-       <div class='portlet' id='p-<?php echo Sanitizer::escapeId($bar) 
?>'<?php echo $skin->tooltip('p-'.$bar) ?>>
-               <div class="navbox">
-               <h4><?php $out = wfMsg( $bar ); if (wfEmptyMsg($bar, $out)) 
echo $bar; else echo $out; ?></h4>
-               </div>
-               <div class='pBody'>
-                       <ul>
-<?php                  foreach($cont as $key => $val) { ?>
-                               <li id="<?php echo 
Sanitizer::escapeId($val['id']) ?>"<?php
-                                       if ( $val['active'] ) { ?> 
class="active" <?php }
-                               ?>><a href="<?php echo 
htmlspecialchars($val['href']) ?>"<?php echo 
$skin->tooltipAndAccesskey($val['id']) ?>><?php echo 
htmlspecialchars($val['text']) ?></a>
-                               </li>
-<?php                  } ?>
-                       </ul>
-               </div><!-- pBody -->
-       </div><!-- portlet -->
-       <?php } ?>
+       <?php 
+               $sidebar = $this->data['sidebar'];              
+               if ( !isset( $sidebar['SEARCH'] ) ) $sidebar['SEARCH'] = true;
+               if ( !isset( $sidebar['TOOLBOX'] ) ) $sidebar['TOOLBOX'] = true;
+               if ( !isset( $sidebar['LANGUAGES'] ) ) $sidebar['LANGUAGES'] = 
true;
 
-       <!-- search -->
-       <div class="portlet" id="p-search">
-               <div class="searchbox"><h4><label for="searchInput"><?php 
$this->msg('search') ?></label></h4></div>
-               <div id="searchBody" class="pBody">
-                       <form action="<?php $this->text('searchaction') ?>" 
id="searchform"><div>
-                               <input id="searchInput" name="search" 
type="text"<?php echo $skin->tooltipAndAccesskey('search');
-                                       if( isset( $this->data['search'] ) ) {
-                                               ?> value="<?php 
$this->text('search') ?>"<?php } ?> />
-                               <input type='submit' name="go" 
class="searchButton" id="searchGoButton" value="<?php 
$this->msg('searcharticle') ?>"<?php echo $skin->tooltipAndAccesskey( 
'search-go' ); ?> />&nbsp;
-                               <input type='submit' name="fulltext" 
class="searchButton" id="mw-searchButton" value="<?php 
$this->msg('searchbutton') ?>"<?php echo $skin->tooltipAndAccesskey( 
'search-fulltext' ); ?> />
-                       </div></form>
-               </div><!-- pBody -->
-       </div><!-- portlet -->
-
-       <!-- toolbox -->
-       <div class="portlet" id="p-tb">
-                 <div class="toolbox">
-                 <h4><?php $this->msg('toolbox') ?></h4>
-      </div>
-               <div class="pBody">
-                       <ul>
-<?php
-               if($this->data['notspecialpage']) { ?>
-                               <li id="t-whatlinkshere"><a href="<?php
-                               echo 
htmlspecialchars($this->data['nav_urls']['whatlinkshere']['href'])
-                               ?>"<?php echo 
$skin->tooltipAndAccesskey('t-whatlinkshere') ?>><?php 
$this->msg('whatlinkshere') ?></a></li>
-<?php
-                       if( $this->data['nav_urls']['recentchangeslinked'] ) { 
?>
-                               <li id="t-recentchangeslinked"><a href="<?php
-                               echo 
htmlspecialchars($this->data['nav_urls']['recentchangeslinked']['href'])
-                               ?>"<?php echo 
$skin->tooltipAndAccesskey('t-recentchangeslinked') ?>><?php 
$this->msg('recentchangeslinked') ?></a></li>
-<?php          }
+               foreach ($sidebar as $boxName => $cont) {
+                       if ( $boxName == 'SEARCH' ) {
+                               $this->searchBox();
+                       } elseif ( $boxName == 'TOOLBOX' ) {
+                               $this->toolbox();
+                       } elseif ( $boxName == 'LANGUAGES' ) {
+                               $this->languageBox();
+                       } else {
+                               $this->customBox( $boxName, $cont );
+                       }
                }
-               if(isset($this->data['nav_urls']['trackbacklink'])) { ?>
-                       <li id="t-trackbacklink"><a href="<?php
-                               echo 
htmlspecialchars($this->data['nav_urls']['trackbacklink']['href'])
-                               ?>"<?php echo 
$skin->tooltipAndAccesskey('t-trackbacklink') ?>><?php 
$this->msg('trackbacklink') ?></a></li>
-<?php  }
-               if($this->data['feeds']) { ?>
-                       <li id="feedlinks"><?php foreach($this->data['feeds'] 
as $key => $feed) {
-                                       ?><span id="feed-<?php echo 
Sanitizer::escapeId($key) ?>"><a href="<?php
-                                       echo htmlspecialchars($feed['href']) 
?>"<?php echo $skin->tooltipAndAccesskey('feed-'.$key) ?>><?php echo 
htmlspecialchars($feed['text'])?></a>&nbsp;</span>
-                                       <?php } ?></li><?php
-               }
+       ?>
 
-               foreach( array('contributions', 'log', 'blockip', 'emailuser', 
'upload', 'specialpages') as $special ) {
-                       if($this->data['nav_urls'][$special]) {
-                               ?><li id="t-<?php echo $special ?>"><a 
href="<?php echo htmlspecialchars($this->data['nav_urls'][$special]['href'])
-                               ?>"<?php echo 
$skin->tooltipAndAccesskey('t-'.$special) ?>><?php $this->msg($special) 
?></a></li>
-<?php          }
-               }
-
-               if(!empty($this->data['nav_urls']['print']['href'])) { ?>
-                               <li id="t-print"><a href="<?php echo 
htmlspecialchars($this->data['nav_urls']['print']['href'])
-                               ?>"<?php echo 
$skin->tooltipAndAccesskey('t-print') ?>><?php $this->msg('printableversion') 
?></a></li><?php
-               }
-
-               if(!empty($this->data['nav_urls']['permalink']['href'])) { ?>
-                               <li id="t-permalink"><a href="<?php echo 
htmlspecialchars($this->data['nav_urls']['permalink']['href'])
-                               ?>"<?php echo 
$skin->tooltipAndAccesskey('t-permalink') ?>><?php $this->msg('permalink') 
?></a></li><?php
-               } elseif ($this->data['nav_urls']['permalink']['href'] === '') 
{ ?>
-                               <li id="t-ispermalink"<?php echo 
$skin->tooltip('t-ispermalink') ?>><?php $this->msg('permalink') ?></li><?php
-               }
-?>
-                       </ul>
-               </div><!-- pBody -->
-       </div><!-- portlet -->
-
-       <!-- languages -->
-<?php
-               if( $this->data['language_urls'] ) { ?>
-       <div id="p-lang" class="portlet">
-               <h5><?php $this->msg('otherlanguages') ?></h5>
-               <div class="pBody">
-                       <ul>
-<?php          foreach($this->data['language_urls'] as $langlink) { ?>
-                               <p class="<?php echo 
htmlspecialchars($langlink['class'])?>"><?php
-                               ?><a href="<?php echo 
htmlspecialchars($langlink['href']) ?>"><?php echo $langlink['text'] ?></a></p>
-<?php          } ?>
-                       </ul>
-               </div><!-- pBody -->
-       </div><!-- portlet -->
-<?php  } ?>
-
        </div><!-- mw_portlets -->
 
 
@@ -297,4 +193,5 @@
        wfRestoreWarnings();
        } // end of execute() method
 } // end of class
-?>
+
+?>
\ No newline at end of file

Modified: trunk/extensions/skins/Daddio/daddio/main.css
===================================================================
--- trunk/extensions/skins/Daddio/daddio/main.css       2009-08-01 13:01:24 UTC 
(rev 54147)
+++ trunk/extensions/skins/Daddio/daddio/main.css       2009-08-01 13:12:04 UTC 
(rev 54148)
@@ -162,42 +162,28 @@
 div.portlet h5 {
        padding: 0.1em 0 0.3em 1em;
        margin: 0 0 0 0;
-       background-color: #dddddd;
        font-weight: bold;
-       border-bottom: solid 1px #3c78b5;
-       height: 1em;
-}
-
-div.portlet h4 {
-       padding: 0.1em 0 0.3em 1em;
-       margin: 0 0 0 0;
-       font-weight: bold;
        height: 1.1em;
 }
 
-div.portlet P {
+div.portlet p {
        margin-top: 0;
        line-height: 0.5em;
 }
 
-div.navbox {
-       padding: 0 0 0 0;
-       margin: 0 0 0 0;
+.generated-sidebar.portlet h5 {
        width: 90%;
        height: 64px;
        background: url(navbox.png) center right no-repeat;
 }
-div.searchbox {
-       padding: 0 0 0 0;
-       margin: 0 0 0 0;
+
+#p-search h5 {
        width: 90%;
        height: 64px;
        background: url(searchbox.png) center right no-repeat;
 }
 
-div.toolbox {
-       padding: 0 0 0 0;
-       margin: 0 0 0 0;
+#p-tb h5 {
        width: 90%;
        height: 64px;
        background: url(toolbox.png) center right no-repeat;



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to