本文整理汇总了PHP中Skin::makeGlobalVariablesScript方法的典型用法代码示例。如果您正苦于以下问题:PHP Skin::makeGlobalVariablesScript方法的具体用法?PHP Skin::makeGlobalVariablesScript怎么用?PHP Skin::makeGlobalVariablesScript使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skin
的用法示例。
在下文中一共展示了Skin::makeGlobalVariablesScript方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDefaultHeaderVars
protected function getDefaultHeaderVars()
{
global $wgRequest, $wgLanguageCode, $wgSSLsite, $wgUser;
$t = $this->t;
$articleName = $t->getText();
$action = $wgRequest->getVal('action', 'view');
$deviceOpts = $this->getDevice();
$pageExists = $t->exists();
$randomUrl = '/' . wfMsg('special-randomizer');
$isMainPage = $articleName == wfMsg('mainpage');
$titleBar = $isMainPage ? wfMsg('mobile-mainpage-title') : wfMsg('pagetitle', $articleName);
$canonicalUrl = 'http://' . MobileWikihow::getNonMobileSite() . '/' . $t->getPartialURL();
if ($wgUser->getID() > 0) {
$login_link = '/Special:Mypage';
$login_text = wfMsg('me');
} else {
$login_link = '/Special:Userlogin';
$login_text = wfMsg('log_in');
}
if (SSL_LOGIN_DOMAIN && !$wgSSLsite) {
$login_link = 'https://' . SSL_LOGIN_DOMAIN . $login_link;
}
$headerVars = array('isMainPage' => $isMainPage, 'title' => $titleBar, 'css' => $this->cssScriptsCombine, 'randomUrl' => $randomUrl, 'deviceOpts' => $deviceOpts, 'canonicalUrl' => $canonicalUrl, 'pageExists' => $pageExists, 'jsglobals' => Skin::makeGlobalVariablesScript(array('skinname' => 'mobile')), 'lang' => $wgLanguageCode, 'loginlink' => $login_link, 'logintext' => $login_text);
return $headerVars;
}
示例2: execute
/**
* Template filter callback for OSBridge 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();
?>
<!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');
?>
<title><?php
$this->text('pagetitle');
?>
</title>
<?php
$this->html('csslinks');
?>
<!--[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
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');
if ($this->data['jsvarurl']) {
?>
<script type="<?php
$this->text('jsmimetype');
?>
" src="<?php
$this->text('jsvarurl');
?>
"><!-- site js --></script>
<?php
}
if ($this->data['pagecss']) {
?>
<style type="text/css"><?php
$this->html('pagecss');
//.........这里部分代码省略.........
示例3: execute
/**
* Template filter callback for MonoBook 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();
?>
<!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');
?>
<title><?php
$this->text('pagetitle');
?>
</title>
<?php
$this->html('csslinks');
?>
<!--[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
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');
if ($this->data['jsvarurl']) {
?>
<script type="<?php
$this->text('jsmimetype');
?>
" src="<?php
$this->text('jsvarurl');
?>
"><!-- site js --></script>
<?php
}
if ($this->data['pagecss']) {
?>
<style type="text/css"><?php
$this->html('pagecss');
//.........这里部分代码省略.........
示例4: execute
/**
* Template filter callback for KiwixOnline 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();
?>
<!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');
?>
<title><?php
echo strip_tags($this->data['title']);
?>
</title>
<?php
$this->html('csslinks');
?>
<!--[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
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');
if ($this->data['jsvarurl']) {
?>
<script type="<?php
$this->text('jsmimetype');
?>
" src="<?php
$this->text('jsvarurl');
?>
"><!-- site js --></script>
<?php
}
if ($this->data['pagecss']) {
?>
<style type="text/css"><?php
$this->html('pagecss');
//.........这里部分代码省略.........
示例5: execute
/**
* Template filter callback for MonoBook 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();
?>
<!DOCTYPE html>
<html lang="ja"
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');
?>
<title><?php
$this->text('pagetitle');
?>
</title>
<?php
$this->html('csslinks');
?>
<!--[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
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');
if ($this->data['jsvarurl']) {
?>
<script type="<?php
$this->text('jsmimetype');
?>
" src="<?php
$this->text('jsvarurl');
?>
"><!-- site js --></script>
<?php
}
if ($this->data['pagecss']) {
?>
//.........这里部分代码省略.........
示例6: meaneditor_showBox
function meaneditor_showBox(&$edit_context, $html_text, $rows, $cols, $ew)
{
global $wgOut, $wgArticlePath, $wgStylePath, $wgUploadPath, $wgLang;
wfLoadExtensionMessages('MeanEditor');
$sk = new Skin();
$wiki_path = str_replace('$1', '', $wgArticlePath);
$wgOut->addScriptFile('../../extensions/MeanEditor/wymeditor/jquery/jquery.js');
$wgOut->addScriptFile('../../extensions/MeanEditor/wymeditor/wymeditor/jquery.wymeditor.pack.js');
$wgOut->addScriptFile('../../extensions/MeanEditor/wymeditor/wymeditor/plugins/resizable/jquery.wymeditor.resizable.js');
$wgOut->addExtensionStyle('../extensions/MeanEditor/fix_meaneditor.css');
# For now, it looks better in IE8 standards mode, even though IE support is very messy
#$wgOut->addMeta('X-UA-Compatible', 'IE=7');
$wgOut->addInlineScript('
Array.prototype.wym_remove = function(from, to) {
// From a suggestion at forum.wymeditor.org
this.splice(from, !to || 1 + to - from + (!(to < 0 ^ from >= 0) && (to < 0 || -1) * this.length));
return this.length;
};
jQuery(function() {
jQuery(\'.wymeditor\').wymeditor({
html: "' . addcslashes($html_text, "\"\n") . '",
lang: "' . $wgLang->getCode() . '",
iframeBasePath: "extensions/MeanEditor/iframe/",
dialogLinkHtml: "<body class=\'wym_dialog wym_dialog_link\'"
+ " onload=\'WYMeditor.INIT_DIALOG(" + WYMeditor.INDEX + ")\'"
+ ">"
+ "<form>"
+ "<fieldset>"
+ "<input type=\'hidden\' class=\'wym_dialog_type\' value=\'"
+ WYMeditor.DIALOG_LINK
+ "\' />"
+ "<legend>{Link}</legend>"
+ "<div class=\'row\'>"
+ "<label>{URL}</label>"
+ "<input type=\'text\' class=\'wym_href\' value=\'\' size=\'40\' />"
+ "</div>"
+ "<div class=\'row row-indent\'>"
+ "<input class=\'wym_submit\' type=\'button\'"
+ " value=\'{Submit}\' />"
+ "<input class=\'wym_cancel\' type=\'button\'"
+ "value=\'{Cancel}\' />"
+ "</div>"
+ "</fieldset>"
+ "</form>"
+ "</body>",
dialogImageHtml: "<body class=\'wym_dialog wym_dialog_image\'"
+ " onload=\'WYMeditor.INIT_DIALOG(" + WYMeditor.INDEX + ")\'"
+ ">' . preg_replace('/[\\r\\n]+/', "", str_replace('</script>', '</scr"+"ipt>', str_replace('"', '\\"', str_replace('\'', '\\\'', $sk->makeGlobalVariablesScript(false))))) . '"
+ "<script type=\'text/javascript\' src=\'' . $wgStylePath . '/common/ajax.js\'></scr"+"ipt>"
+ "<script type=\'text/javascript\'>function meaneditor_responder(e) {"
+ " div=document.getElementById(\'meaneditor_ajax_table\');"
+ " div.innerHTML=e.responseText;"
+ "}</scr"+"ipt>"
+ "<form>"
+ "<fieldset>"
+ "<input type=\'hidden\' class=\'wym_dialog_type\' value=\'"
+ WYMeditor.DIALOG_IMAGE
+ "\' />"
+ "<legend>{Image}</legend>"
+ "<div class=\'row\'>"
+ "<label>{Title}</label>"
+ "<input id=\'image_name\' type=\'text\' class=\'wym_src\' value=\'\' size=\'40\' />"
+ "</div>"
+ "<div class=\'row\'>"
+ "<p onclick=\'sajax_do_call(\\"recent_images\\",[0],meaneditor_responder,0);\'>' . wfMsg('recent_images_text', $wgArticlePath . 'Special:Upload') . '</p>"
+ "<table id=\'meaneditor_ajax_table\'></table>"
+ "</div>"
+ "<div class=\'row row-indent\'>"
+ "<input class=\'wym_submit_meaneditor_image\' type=\'button\'"
+ " value=\'{Submit}\' />"
+ "<input class=\'wym_cancel\' type=\'button\'"
+ "value=\'{Cancel}\' />"
+ "</div>"
+ "</fieldset>"
+ "</form>"
+ "</body>",
preInit: function(wym) {
// Remove unwanted buttons, code from a suggestion at forum.wymeditor.org
wym._options.toolsItems.wym_remove(6);
wym._options.toolsItems.wym_remove(6);
wym._options.toolsItems.wym_remove(11);
wym._options.toolsItems.wym_remove(12);
wym._options.toolsItems.wym_remove(12);
},
postInit: function(wym) {
var wikilink_button_html = "<li class=\'wym_tools_wikilink\'>"
+ "<a name=\'Wikilink\' href=\'#\' "
+ "style=\'background-image: url(extensions/MeanEditor/wikilink-icon.png)\'>"
+ "Create Wikilink</a></li>";
var wikilink_dialog_html = "<body class=\'wym_dialog wym_dialog_wikilink\'"
+ " onload=\'WYMeditor.INIT_DIALOG(" + WYMeditor.INDEX + ")\'"
+ ">"
+ "<form>"
+ "<fieldset>"
+ "<input type=\'hidden\' class=\'wym_dialog_type\' value=\'"
+ "MeanEditor_dialog_wikilink"
+ "\' />"
+ "<legend>Wikilink</legend>"
+ "<div class=\'row\'>"
//.........这里部分代码省略.........
示例7: execute
/**
* Template filter callback for Modern 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();
// This is needed to use Firebug Lite in IE 9
if ($_SERVER['SERVER_NAME'] == 'cbp-transcription-desk.local') {
$head = $this->data['headelement'];
$searchString = '</title>' . "\n" . '<meta';
$replaceString = '</title>' . "\n" . '<meta http-equiv="X-UA-Compatible" content="IE=8;FF=3;OtherUA=4" >' . "\n" . '<meta';
$this->data['headelement'] = str_replace($searchString, $replaceString, $head);
}
$this->html('headelement');
?>
<?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');
?>
">
<?php
$this->html('csslinks');
?>
<!--[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');
if ($this->data['jsvarurl']) {
?>
<script type="<?php
$this->text('jsmimetype');
?>
" src="<?php
$this->text('jsvarurl');
?>
"><!-- site js --></script>
<?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');
?>
//.........这里部分代码省略.........
示例8: displayHtml
public function displayHtml()
{
global $IP, $wgTitle, $wgOut, $wgUser, $wgRequest, $wgContLanguageCode;
global $wgLang, $wgContLang, $wgXhtmlDefaultNamespace;
$sk = new SkinWikihowskin();
$articleName = $wgTitle->getText();
$partialUrl = $wgTitle->getPartialURL();
$isMainPage = $articleName == wfMsg('mainpage');
$action = $wgRequest->getVal('action', 'view');
//$lang = $this->getSiteLanguage();
//$deviceOpts = $this->getDevice();
$pageExists = $wgTitle->exists();
$randomUrl = '/' . wfMsg('special-randomizer');
$titleBar = wfMsg('pagetitle', $articleName);
$canonicalUrl = 'http://' . $IP . '/' . $wgTitle->getPartialURL();
$rtl = $wgContLang->isRTL() ? " dir='RTL'" : '';
$head_element = "<html xmlns:fb=\"https://www.facebook.com/2008/fbml\" xmlns=\"{$wgXhtmlDefaultNamespace}\" xml:lang=\"{$wgContLanguageCode}\" lang=\"{$wgContLanguageCode}\" {$rtl}>\n";
$css = '/extensions/min/f/skins/WikiHow/new.css,extensions/wikihow/common/jquery-ui-themes/jquery-ui.css,extensions/wikihow/gallery/prettyPhoto-3.12/src/prettyPhoto.css,extensions/wikihow/NewLayout/Layout_03.css';
if ($wgUser->getID() > 0) {
$css .= ',/skins/WikiHow/loggedin.css';
}
$css .= '?' . WH_SITEREV;
$css = wfGetPad($css);
if ($wgIsDomainTest) {
$base_href = '<base href="http://www.wikihow.com/" />';
} else {
$base_href = '';
}
$out = new OutputPage();
$headlinks = $out->getHeadLinks();
if (!$wgIsDomainTest) {
$canonicalUrl = '<link rel="canonical" href="' . $wgTitle->getFullURL() . '" />';
}
//get login/sign up stuff
$login = "";
$li = $wgLang->specialPage("Userlogin");
$lo = $wgLang->specialPage("Userlogout");
$rt = $wgTitle->getPrefixedURL();
if (0 == strcasecmp(urlencode($lo), $rt)) {
$q = "";
} else {
$q = "returnto={$rt}";
}
if ($wgUser->getID()) {
$uname = $wgUser->getName();
if (strlen($uname) > 16) {
$uname = substr($uname, 0, 16) . "...";
}
$login = wfMsg('welcome_back', $wgUser->getUserPage()->getFullURL(), $uname);
if ($wgLanguageCode == 'en' && $wgUser->isFacebookUser()) {
$login = wfMsg('welcome_back_fb', $wgUser->getUserPage()->getFullURL(), $wgUser->getName());
}
} else {
$login = wfMsg('signup_or_login', $q) . " " . wfMsg('facebook_connect_header', wfGetPad("/skins/WikiHow/images/facebook_share_icon.gif"));
}
if ($wgUser->getID() > 0) {
$helplink = $sk->makeLinkObj(Title::makeTitle(NS_CATEGORY, wfMsg('help')), wfMsg('help'));
$logoutlink = $sk->makeLinkObj(Title::makeTitle(NS_SPECIAL, 'Userlogout'), wfMsg('logout'));
$login .= " | " . $helplink . " | " . $logoutlink;
}
$headerVars = array('title' => $titleBar, 'head_element' => $head_element, 'base_href' => $base_href, 'globalvar_script' => Skin::makeGlobalVariablesScript($this->data), 'css' => $css, 'headlinks' => $headlinks, 'canon' => $canonicalUrl, 'headitems' => $wgOut->getHeadItems(), 'login' => $login);
if ($wgUser->getID() > 0) {
$footer_links = wfMsgExt('site_footer_new', 'parse');
} else {
$footer_links = wfMsgExt('site_footer_new_anon', 'parse');
}
if ($wgUser->getID() > 0 || $isMainPage) {
$sub_foot = wfMsg('sub_footer_new', wfGetPad(), wfGetPad());
} else {
$sub_foot = wfMsg('sub_footer_new_anon', wfGetPad(), wfGetPad());
}
$footerVars = array('footer_links' => $footer_links, 'search' => GoogSearch::getSearchBox("cse-search-box-footer") . '<br />', 'cat_list' => $sk->getCategoryList(), 'sub_foot' => $sub_foot, 'footertail' => $this->getFooterTail());
$article = $wgOut->getHTML();
$wgOut->clearHTML();
//parse that article text
$article = call_user_func('self::parseArticle_' . self::ARTICLE_LAYOUT, $article);
$wgOut->addHTML(EasyTemplate::html('header_' . self::ARTICLE_LAYOUT . '.tmpl.php', $headerVars));
$wgOut->addHTML($article);
$wgOut->addHTML(EasyTemplate::html('footer_' . self::ARTICLE_LAYOUT . '.tmpl.php', $footerVars));
print $wgOut->getHTML();
}
示例9: execute
/**
* Template filter callback for bookjive 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 $wgUser;
$skin = $wgUser->getSkin();
// 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="http://www.w3.org/1999/xhtml" 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');
?>
<title><?php
$this->text('pagetitle');
?>
</title>
<style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "<?php
$this->text('stylepath');
?>
/<?php
$this->text('stylename');
?>
/main.css?20111201"; /*]]>*/</style>
<?php
echo pintaCss();
?>
<link rel="stylesheet" type="text/css" <?php
if (empty($this->data['printable'])) {
?>
media="print"<?php
}
?>
href="<?php
$this->text('stylepath');
?>
/common/commonPrint.css" />
<!--[if lt IE 5.5000]><style type="text/css">@import "<?php
$this->text('stylepath');
?>
/<?php
$this->text('stylename');
?>
/IE50Fixes.css";</style><![endif]-->
<!--[if IE 5.5000]><style type="text/css">@import "<?php
$this->text('stylepath');
?>
/<?php
$this->text('stylename');
?>
/IE55Fixes.css";</style><![endif]-->
<!--[if gte IE 6]><style type="text/css">@import "<?php
$this->text('stylepath');
?>
/<?php
$this->text('stylename');
?>
/IE60Fixes.css";</style><![endif]-->
<!--[if IE]><script type="<?php
$this->text('jsmimetype');
?>
" src="<?php
$this->text('stylepath');
?>
/common/IEFixes.js"></script>
<meta http-equiv="imagetoolbar" content="no" /><![endif]-->
<?php
print Skin::makeGlobalVariablesScript($this->data);
?>
<!-- Css links -->
<?php
//.........这里部分代码省略.........
示例10: execute
/**
* Template filter callback for MonoBook 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, $wgVersion, $wgUser, $wgTitle, $wgParser;
$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');
?>
<title><?php
$this->text('pagetitle');
?>
</title>
<style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "<?php
$this->text('stylepath');
?>
/<?php
$this->text('stylename');
?>
/main.css?7"; /*]]>*/</style>
<!--[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
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');
if ($this->data['jsvarurl']) {
?>
<script type="<?php
$this->text('jsmimetype');
?>
" src="<?php
$this->text('jsvarurl');
?>
"><!-- site js --></script>
<?php
}
if ($this->data['pagecss']) {
?>
<style type="text/css"><?php
//.........这里部分代码省略.........
示例11: execute
/**
* Template filter callback for KG 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();
?>
<!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');
?>
<title><?php
$this->text('pagetitle');
?>
</title>
<?php
$this->html('csslinks');
?>
<style type="text/css" media="screen, projection">/*<![CDATA[*/
@import "<?php
$this->text('stylepath');
?>
/common/shared.css?<?php
echo $GLOBALS['wgStyleVersion'];
?>
";
@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'];
?>
" />
<?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>
//.........这里部分代码省略.........
示例12: getHeadScripts
/**
* Gets the global variables and mScripts; also adds userjs to the end if
* enabled. Despite the name, these scripts are no longer put in the
* <head> but at the bottom of the <body>
*
* @param $sk Skin object to use
* @return String: HTML fragment
*/
function getHeadScripts(Skin $sk)
{
global $wgUser, $wgRequest, $wgUseSiteJs;
// Startup - this will immediately load jquery and mediawiki modules
$scripts = $this->makeResourceLoaderLink($sk, 'startup', 'scripts', true);
// Configuration -- This could be merged together with the load and go, but
// makeGlobalVariablesScript returns a whole script tag -- grumble grumble...
$scripts .= Skin::makeGlobalVariablesScript($sk->getSkinName()) . "\n";
// Script and Messages "only" requests
$scripts .= $this->makeResourceLoaderLink($sk, $this->getModuleScripts(), 'scripts');
$scripts .= $this->makeResourceLoaderLink($sk, $this->getModuleMessages(), 'messages');
// Modules requests - let the client calculate dependencies and batch requests as it likes
if ($this->getModules()) {
$scripts .= Html::inlineScript(ResourceLoader::makeLoaderConditionalScript(Xml::encodeJsCall('mediaWiki.loader.load', array($this->getModules())) . Xml::encodeJsCall('mediaWiki.loader.go', array()))) . "\n";
}
// Legacy Scripts
$scripts .= "\n" . $this->mScripts;
// Add site JS if enabled
if ($wgUseSiteJs) {
$scripts .= $this->makeResourceLoaderLink($sk, 'site', 'scripts');
}
// Add user JS if enabled - trying to load user.options as a bundle if possible
$userOptionsAdded = false;
if ($this->isUserJsAllowed() && $wgUser->isLoggedIn()) {
$action = $wgRequest->getVal('action', 'view');
if ($this->mTitle && $this->mTitle->isJsSubpage() && $sk->userCanPreview($action)) {
# XXX: additional security check/prompt?
$scripts .= Html::inlineScript("\n" . $wgRequest->getText('wpTextbox1') . "\n") . "\n";
} else {
$scripts .= $this->makeResourceLoaderLink($sk, array('user', 'user.options'), 'scripts');
$userOptionsAdded = true;
}
}
if (!$userOptionsAdded) {
$scripts .= $this->makeResourceLoaderLink($sk, 'user.options', 'scripts');
}
return $scripts;
}
示例13: executeIndex
public function executeIndex($params) {
global $wgOut, $wgUser, $wgTitle, $wgRequest, $wgCityId, $wgAllInOne, $wgContLang, $wgJsMimeType;
$allInOne = $wgAllInOne;
// macbre: let extensions modify content of the page (e.g. EditPageLayout)
$this->body = !empty($params['body']) ? $params['body'] : F::app()->renderView('CampfireBody', 'Index');
// generate list of CSS classes for <body> tag
$this->bodyClasses = array('mediawiki', $this->dir, $this->pageclass);
$this->bodyClasses = array_merge($this->bodyClasses, self::$extraBodyClasses);
$this->bodyClasses[] = $this->skinnameclass;
if(Wikia::isMainPage()) {
$this->bodyClasses[] = 'mainpage';
}
// add skin theme name
$skin = $wgUser->getSkin();
if(!empty($skin->themename)) {
$this->bodyClasses[] = "oasis-{$skin->themename}";
}
$this->setupJavaScript();
$this->printStyles = array();
// render CSS <link> tags
$this->headlinks = $wgOut->getHeadLinks();
$this->pagetitle = htmlspecialchars( $this->pagetitle );
$this->displaytitle = htmlspecialchars( $this->displaytitle );
$this->mimetype = htmlspecialchars( $this->mimetype );
$this->charset = htmlspecialchars( $this->charset );
$this->globalVariablesScript = Skin::makeGlobalVariablesScript($this->app->getSkinTemplateObj()->data);
// printable CSS (to be added at the bottom of the page)
// If this is an anon article view, use the combined version of the print files.
if($allInOne){
// Create the combined URL.
global $parserMemc, $wgStyleVersion;
$cb = $parserMemc->get(wfMemcKey('wgMWrevId'));
global $wgDevelEnvironment;
if(empty($wgDevelEnvironment)){
$prefix = "__wikia_combined/";
} else {
global $wgWikiaCombinedPrefix;
$prefix = $wgWikiaCombinedPrefix;
}
// no print styles
$this->printStyles = array();
}
$this->printableCss = $this->renderPrintCSS(); // The HTML for the CSS links (whether async or not).
// setup loading of JS/CSS using WSL (WikiaScriptLoader)
$this->loadJs();
// FIXME: create separate module for stats stuff?
// load Google Analytics code
$this->googleAnalytics = AnalyticsEngine::track('GA_Urchin', AnalyticsEngine::EVENT_PAGEVIEW);
// onewiki GA
$this->googleAnalytics .= AnalyticsEngine::track('GA_Urchin', 'onewiki', array($wgCityId));
// track page load time
$this->googleAnalytics .= AnalyticsEngine::track('GA_Urchin', 'pagetime', array('oasis'));
// track browser height
$this->googleAnalytics .= AnalyticsEngine::track('GA_Urchin', 'browser-height');
// record which varnish this page was served by
$this->googleAnalytics .= AnalyticsEngine::track('GA_Urchin', 'varnish-stat');
$this->googleAnalytics .= AnalyticsEngine::track('GA_Urchin', 'noads');
$this->googleAnalytics .= AnalyticsEngine::track('GA_Urchin', 'abtest');
// Add important Gracenote analytics for reporting needed for licensing on LyricWiki.
if (43339 == $wgCityId){
$this->googleAnalytics .= AnalyticsEngine::track('GA_Urchin', 'lyrics');
}
// macbre: RT #25697 - hide Comscore & QuantServe tags on edit pages
if(!in_array($wgRequest->getVal('action'), array('edit', 'submit'))) {
$this->comScore = AnalyticsEngine::track('Comscore', AnalyticsEngine::EVENT_PAGEVIEW);
$this->quantServe = AnalyticsEngine::track('QuantServe', AnalyticsEngine::EVENT_PAGEVIEW);
}
$this->mainsassfile = 'skins/campfire/css/campfire.scss';
} // end executeIndex()
示例14: execute
/**
* Template filter callback for Modern 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();
?>
<!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');
?>
<title><?php
$this->text('pagetitle');
?>
</title>
<?php
if (empty($this->data['printable'])) {
?>
<style type="text/css" media="screen, projection">/*<![CDATA[*/
@import "<?php
$this->text('stylepath');
?>
/common/shared.css?<?php
echo $GLOBALS['wgStyleVersion'];
?>
";
@import "<?php
$this->text('stylepath');
?>
/<?php
$this->text('stylename');
?>
/main.css?<?php
echo $GLOBALS['wgStyleVersion'];
?>
";
/*]]>*/</style>
<?php
}
?>
<link rel="stylesheet" type="text/css" <?php
if (empty($this->data['printable'])) {
?>
media="print"<?php
}
?>
href="<?php
$this->text('stylepath');
?>
/<?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
//.........这里部分代码省略.........
示例15: wfGetPad
<!DOCTYPE html>
<html>
<head>
<title>Rate our Works-in-Progress!</title>
<meta name="viewport" content="width=device-width" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<?php
echo $GLOBALS['wgOut']->getHeadScripts();
echo Skin::makeGlobalVariablesScript(array('skinname' => 'mobile'));
?>
<script src="<?php
echo wfGetPad('/extensions/min/g/mjq,mwh,mga,stb&rev=') . WH_SITEREV;
?>
"></script>
<link type="text/css" rel="stylesheet" href="<?php
echo wfGetPad('/extensions/min/g/mwhc,mwhf,mwhh&rev=') . WH_SITEREV;
?>
" />
<style>
.overlay {
position: fixed;
z-index: 1;
background-color: #F4F4F4;
}
.inner {
z-index: 2;
background-color: #F4F4F4;
height: 300px;
width: 250px;
margin: 25px auto;
text-align: center;