本文整理汇总了PHP中OutputPage::getPageTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP OutputPage::getPageTitle方法的具体用法?PHP OutputPage::getPageTitle怎么用?PHP OutputPage::getPageTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputPage
的用法示例。
在下文中一共展示了OutputPage::getPageTitle方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: outputPage
function outputPage(OutputPage $out)
{
global $wgContLang, $wgTomasSkinPath, $wgScriptPath;
$lang = $wgContLang->getCode();
$this->path = $wgTomasSkinPath ? $wgTomasSkinPath : "{$wgScriptPath}/extensions/skins/Tomas";
$this->out = $out;
$bodyText = $out->getHTML();
$bodyText = preg_replace('!(<img[^>]*src=")schstock/!', "\$1{$this->path}/images/", $bodyText);
$bodyText = preg_replace('!(<[^>]*style="[^"]*url\\()schstock/!', "\$1{$this->path}/images/", $bodyText);
$bodyText = preg_replace('!(<input[^>]*src=")schstock/!', "\$1{$this->path}/images/", $bodyText);
$query = 'usemsgcache=yes&action=raw&ctype=text/css&smaxage=2678400';
$siteCss = Title::newFromText('MediaWiki:Tomas.css')->getLocalUrl($query);
$siteJs = Title::newFromText('MediaWiki:Tomas.js')->getLocalUrl($query);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Language" content="<?php
echo htmlspecialchars($lang);
?>
">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php
echo htmlspecialchars($out->getPageTitle());
?>
</title>
<link rel="stylesheet" href="<?php
echo htmlspecialchars($this->getMainCss());
?>
" type="text/css"/>
<script type="text/javascript" src="<?php
echo htmlspecialchars($this->getMainJs());
?>
"></script>
<link rel="stylesheet" href="<?php
echo htmlspecialchars($siteCss);
?>
" type="text/css"/>
<script type="text/javascript" src="<?php
echo htmlspecialchars($siteJs);
?>
"></script>
</head>
<body>
<div align="center">
<?php
echo $bodyText;
?>
</div>
</body>
</html>
<?php
}
示例2: lyricsH1_onBeforePageDisplay
function lyricsH1_onBeforePageDisplay(OutputPage &$out, Skin &$skin)
{
global $wgTitle;
// lyrics pages will only be in the main namespace after the merge
if ($wgTitle->getNamespace() == NS_MAIN) {
$origTitle = $out->getPageTitle();
if (0 == preg_match("/\\([12][0-9]{3}\\)\$/", $origTitle) && 0 < preg_match("/.+:+/", $origTitle)) {
$out->setPageTitle($origTitle . wfMsg('H1-lyricssuffix'));
// added as a message so that it can be translated
}
}
return true;
}
示例3: modifyHTML
/**
* Modify the HTML to set the relevant tags to the specified values
*
* This method is called by the BeforePageDisplay hook
*
* @param OutputPage $out
*/
public static function modifyHTML($out)
{
//set title
if (!empty(self::$title)) {
switch (self::$title_mode) {
case 'append':
$title = $out->getPageTitle() . self::$title_separator . self::$title;
break;
case 'prepend':
$title = self::$title . self::$title_separator . $out->getPageTitle();
break;
case 'replace':
default:
$title = self::$title;
}
$out->setHTMLTitle($title);
$out->addMeta("twitter:title", $title);
$out->addHeadItem("og:title", "<meta property=\"og:title\" content=\"{$title}\" />" . "\n");
}
//set meta tags
if (!empty(self::$meta)) {
foreach (self::$meta as $name => $content) {
if ($name == 'description') {
$out->addMeta($name, $content);
$out->addMeta("twitter:description", $content);
$out->addHeadItem("og:description", Html::element('meta', array('property' => 'og:description', 'content' => $content)) . "\n");
} else {
$out->addMeta($name, $content);
}
}
}
//set property tags
if (!empty(self::$property)) {
foreach (self::$property as $property => $content) {
$out->addHeadItem("{$property}", Html::element('meta', array('property' => $property, 'content' => $content)) . "\n");
}
}
return true;
}
示例4: onBeforePageDisplay
/**
* Function
*
* onBeforePageDisplay
*
* @param OutputPage $out
* @param Skin $skin
* @return boolean
*/
public static function onBeforePageDisplay(OutputPage &$out, Skin &$skin)
{
# Modify OutputPage HTML base on WebRequest's action
switch ($GLOBALS['wgRequest']->getVal('action')) {
# If purge page, do nothing
case 'purge':
break;
# If OntoKiWi edit ontology with form, change displayed title and load form resources
# If OntoKiWi edit ontology with form, change displayed title and load form resources
case 'formedit':
$title = $out->getPageTitle();
$title = str_replace(' ', '_', $title);
$out->mPagetitle = $title;
$out->addModules(array('ext.okw.form.js', 'ext.okw.form.css'));
break;
# If delete page, check if page has ontology data, and:
# 1) change displayed title
# 2) add "Delete Ontology Data" checkbox
# If delete page, check if page has ontology data, and:
# 1) change displayed title
# 2) add "Delete Ontology Data" checkbox
case 'delete':
global $wgRequest;
if (OntologyValidator::isExistTitleText($wgRequest->getVal('title'))) {
$title = $out->getPageTitle();
$title = str_replace(' ', '_', $title);
$html = preg_replace('/(<input[^>]*name=[\'"]wpWatch[\'"].+?(?=<div>))/', '${1} <input name="okwDelete" type="checkbox" value="1" id="wpWatch" checked/> ' . '<label for="okwDelete">Delete Ontology Data</label>', $out->getHTML());
$out->clearHTML();
$out->addHTML($html);
}
break;
# Default display to check if page has ontology data, and:
# 1) Change displayed title
# 2) Call PageDisplayPrinter::display
# 3) Load page resources
# 4) Redirect if only ID is provided and is valid
# Default display to check if page has ontology data, and:
# 1) Change displayed title
# 2) Call PageDisplayPrinter::display
# 3) Load page resources
# 4) Redirect if only ID is provided and is valid
default:
$title = $out->getPageTitle();
$titleName = str_replace(' ', '_', $title);
if (OntologyValidator::isExistOutputPage($out)) {
$out->mPagetitle = $titleName;
$html = $out->getHTML();
$out->clearHTML();
$html = PageDisplayPrinter::display($titleName) . $html;
$out->addHTML($html);
$out->addModules(array('ext.okw.page.js', 'ext.okw.page.css'));
} else {
if (preg_match_all('/([a-zA-Z]+)[:_]([a-zA-Z]*)[:_]?(\\d+)/', $titleName, $matches, PREG_SET_ORDER)) {
if ($matches[0][2] == '') {
$title = Title::newFromText($matches[0][1] . ':' . $matches[0][1] . '_' . $matches[0][3]);
if (OntologyValidator::isExistTitle($title)) {
$out->redirect($title->getFullURL());
$out->output();
}
}
}
}
break;
}
return true;
}
示例5: outputPage
function outputPage(OutputPage $out)
{
global $wgContLang, $wgSchulenburgSkinPath, $wgScriptPath;
$lang = $wgContLang->getCode();
$this->path = $wgSchulenburgSkinPath ? $wgSchulenburgSkinPath : "{$wgScriptPath}/extensions/skins/Schulenburg";
$this->out = $out;
$bodyText = $out->getHTML();
$bodyText = preg_replace('!(<img[^>]*src=")schstock/!', "\$1{$this->path}/images/", $bodyText);
$bodyText = preg_replace('!(<[^>]*style="[^"]*url\\()schstock/!', "\$1{$this->path}/images/", $bodyText);
$bodyText = preg_replace('!(<input[^>]*src=")schstock/!', "\$1{$this->path}/images/", $bodyText);
$query = 'usemsgcache=yes&action=raw&ctype=text/css&smaxage=2678400';
$siteCss = Title::newFromText('MediaWiki:Schulenburg.css')->getLocalUrl($query);
$siteJs = Title::newFromText('MediaWiki:Schulenburg.js')->getLocalUrl($query);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Language" content="<?php
echo htmlspecialchars($lang);
?>
">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php
echo htmlspecialchars($out->getPageTitle());
?>
</title>
<link rel="stylesheet" href="<?php
echo htmlspecialchars($this->getMainCss());
?>
" type="text/css"/>
<script type="text/javascript" src="<?php
echo htmlspecialchars($this->getMainJs());
?>
"></script>
<link rel="stylesheet" href="<?php
echo htmlspecialchars($siteCss);
?>
" type="text/css"/>
<script type="text/javascript" src="<?php
echo htmlspecialchars($siteJs);
?>
"></script>
<style type="text/css">
body {
margin: 0px;
padding: 0px;
background-image:url(<?php
echo htmlspecialchars("{$this->path}/images/background.gif");
?>
); background-repeat:repeat-y;
background-position:center;
background-color:#006699;
font-family: Verdana, Arial, Sans-Serif;
font-size: 10pt;
}
</style>
</head>
<body>
<div align="center">
<?php
echo $bodyText;
?>
</div>
</body>
</html>
<?php
}
示例6: setPageTitle
/**
* @param \OutputPage $out
*/
public function setPageTitle(\OutputPage $out)
{
if ($out->getPageTitle()) {
// Don't override page title if another block has already set it.
// If this should *really* be done, the specific block extending
// this AbstractBlock should just implement this itself ;)
return;
}
$out->setPageTitle($this->workflow->getArticleTitle()->getFullText());
}