本文整理汇总了PHP中OutputPage::clearHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP OutputPage::clearHTML方法的具体用法?PHP OutputPage::clearHTML怎么用?PHP OutputPage::clearHTML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputPage
的用法示例。
在下文中一共展示了OutputPage::clearHTML方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onOutputPageBeforeHTML
public static function onOutputPageBeforeHTML(OutputPage &$out, &$text)
{
if (WikiaPageType::isMainPage() && !F::app()->checkSkin('wikiamobile')) {
$text = '';
$out->clearHTML();
$out->addHTML(F::app()->sendRequest('WikiaHomePageController', 'index')->toString());
}
return $out;
}
示例2: handleNewPages
/**
* Handles new pages to show error message and print message, that page does not exist.
* @param OutputPage $out
*/
protected function handleNewPages(OutputPage $out)
{
# Show error message
$title = $this->getTitle();
if (!$title->exists() && !$title->isSpecialPage() && $title->userCan('create', $this->getUser()) && $title->getNamespace() !== NS_FILE) {
$out->clearHTML();
$out->addHTML(Html::openElement('div', array('id' => 'mw-mf-newpage')) . wfMessage('mobile-frontend-editor-newpage-prompt')->parse() . Html::closeElement('div'));
}
}
示例3: 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;
}