`
isiqi
  • 浏览: 16026419 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

09暑假笔记(6)-更换皮肤(cavendish)后默认的编辑工具栏与FCK无法使用的问题

阅读更多

《更换皮肤(cavendish)后默认的编辑工具栏与FCK无法使用的问题》
修改cavendish.php文件(用下面一段代码更换<body>以前的部分,是从与monoskin皮肤对照中得出来的)
<?php
/**
* Mozilla cavendish theme
*
* Loosely based on the cavendish style by Gabriel Wicke
*
* @todo document
* @package MediaWiki
* @subpackage Skins
*/

if( !defined( 'MEDIAWIKI' ) )
die();

/**
* Inherit main code from SkinTemplate, set the CSS and template filter.
* @todo document
* @package MediaWiki
* @subpackage Skins
*/
class Skincavendish extends SkinTemplate {
/** Using cavendish. */
function initPage( OutputPage $out ) {
parent::initPage( $out );
$this->skinname = 'cavendish';
$this->stylename = 'cavendish';
$this->template = 'cavendishTemplate';

}

function setupSkinUserCss( OutputPage $out ) {
global $wgHandheldStyle;

parent::setupSkinUserCss( $out );

// Append to the default screen common & print styles...
$out->addStyle( 'cavendish/main.css', 'screen' );
if( $wgHandheldStyle ) {
// Currently in testing... try 'chick/main.css'
$out->addStyle( $wgHandheldStyle, 'handheld' );
}

$out->addStyle( 'cavendish/IE50Fixes.css', 'screen', 'lt IE 5.5000' );
$out->addStyle( 'cavendish/IE55Fixes.css', 'screen', 'IE 5.5000' );
$out->addStyle( 'cavendish/IE60Fixes.css', 'screen', 'IE 6' );
$out->addStyle( 'cavendish/IE70Fixes.css', 'screen', 'IE 7' );

$out->addStyle( 'cavendish/rtl.css', 'screen', '', 'rtl' );
}
}

class cavendishTemplate extends QuickTemplate {
var $skin;
/**
* Template filter callback for cavendish 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() {
global $wgRequest;
$this->skin = $skin = $this->data['skin'];
$action = $wgRequest->getText( 'action' );

// Suppress warnings to prevent notices about missing indexes in $this->data
wfSuppressWarnings(); //注意此句可以解决使用皮肤时报错的问题,Notice:no class in cavendish

?><!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="text/html; charset=utf-8" />
<?php $this->html('headlinks') ?>
<title><?php $this->text('pagetitle') ?></title>

//以下两句为新增语句
<?php $this->html('csslinks') ?>
<?php print Skin::makeGlobalVariablesScript( $this->data ); ?>


<style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css"; /*]]>*/</style>
<link rel="stylesheet" type="text/css" media="print" href="<?php $this->text('stylepath') ?>/common/commonPrint.css" />
<?php if($this->data['jsvarurl' ]) { ?><script type="text/javascript" src="<?php $this->text('jsvarurl' ) ?>"></script><?php } ?>
<script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js"></script>
<?php if($this->data['usercss' ]) { ?><style type="text/css"><?php $this->html('usercss' ) ?></style><?php } ?>
<?php if($this->data['userjs' ]) { ?><script type="text/javascript" src="<?php $this->text('userjs' ) ?>"></script><?php } ?>
<?php if($this->data['userjsprev']) { ?><script type="text/javascript"><?php $this->html('userjsprev') ?></script><?php } ?>

//下面一句为新添加
<?php $this->html('headscripts') ?>

</head>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics