(bug 14520) Don't load nonexistent CSS fix files for Chick, Myskin, Simple
authorAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 13 Jun 2008 00:51:52 +0000 (00:51 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 13 Jun 2008 00:51:52 +0000 (00:51 +0000)
RELEASE-NOTES
includes/SkinTemplate.php
skins/Chick.php
skins/MonoBook.php

index cebf30f..e80d114 100644 (file)
@@ -369,6 +369,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   recent changes page.
 * (bug 14511) MediaWiki:Delete-legend is no longer double escaped
 * Generate correct section anchors for numeric headers
+* (bug 14520) Don't load nonexistent CSS fix files for Chick, Myskin, Simple
 
 === API changes in 1.13 ===
 
index fa1ed86..042dc29 100644 (file)
@@ -87,6 +87,12 @@ class SkinTemplate extends Skin {
         */
        var $template;
 
+       /**
+        * An array of CSS fixes files to load for IE, in conditional comments.
+        * May include: 'IE', 'IE50', 'IE55', 'IE60', 'IE70'.
+        */
+       var $fixfiles;
+
        /**#@-*/
 
        /**
@@ -101,6 +107,7 @@ class SkinTemplate extends Skin {
                $this->skinname  = 'monobook';
                $this->stylename = 'monobook';
                $this->template  = 'QuickTemplate';
+               $this->fixfiles = array();
        }
 
        /**
index b7d9610..cfbdbc7 100644 (file)
@@ -23,6 +23,7 @@ class SkinChick extends SkinTemplate {
                $this->skinname  = 'chick';
                $this->stylename = 'chick';
                $this->template  = 'MonoBookTemplate';
+               $this->fixfiles  = array( 'IE50', 'IE55', 'IE60' );
        }
 }
 
index 146a270..f6f97c0 100644 (file)
@@ -25,6 +25,9 @@ class SkinMonoBook extends SkinTemplate {
                $this->skinname  = 'monobook';
                $this->stylename = 'monobook';
                $this->template  = 'MonoBookTemplate';
+               # Bug 14520: skins that just include this file shouldn't load nonexis-
+               # tent CSS fix files.
+               $this->fixfiles  = array( 'IE', 'IE50', 'IE55', 'IE60', 'IE70' );
        }
 }
 
@@ -62,12 +65,12 @@ class MonoBookTemplate extends QuickTemplate {
                        @import "<?php $this->text('stylepath') ?>/<?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 $this->text('printcss') ?>?<?php echo $GLOBALS['wgStyleVersion'] ?>" />
-               <!--[if lt IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style><![endif]-->
-               <!--[if IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style><![endif]-->
-               <!--[if IE 6]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style><![endif]-->
-               <!--[if IE 7]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE70Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style><![endif]-->
-               <!--[if lt IE 7]><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/common/IEFixes.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"></script>
-               <meta http-equiv="imagetoolbar" content="no" /><![endif]-->
+               <?php if( in_array( 'IE50', $skin->fixfiles ) ) { ?><!--[if lt IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style><![endif]-->
+               <?php } if( in_array( 'IE55', $skin->fixfiles ) ) { ?><!--[if IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style><![endif]-->
+               <?php } if( in_array( 'IE60', $skin->fixfiles ) ) { ?><!--[if IE 6]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style><![endif]-->
+               <?php } if( in_array( 'IE70', $skin->fixfiles ) ) { ?><!--[if IE 7]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE70Fixes.css?<?php echo $GLOBALS['wgStyleVersion'] ?>";</style><![endif]-->
+               <?php } ?><!--[if lt IE 7]><?php if( in_array( 'IE', $skin->fixfiles ) ) { ?><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/common/IEFixes.js?<?php echo $GLOBALS['wgStyleVersion'] ?>"></script>
+               <?php } ?><meta http-equiv="imagetoolbar" content="no" /><![endif]-->
                
                <?php print Skin::makeGlobalVariablesScript( $this->data ); ?>
                 
@@ -284,4 +287,3 @@ class MonoBookTemplate extends QuickTemplate {
        wfRestoreWarnings();
        } // end of execute() method
 } // end of class
-?>