当前位置: 首页>>代码示例>>PHP>>正文


PHP OutputPage::clearHTML方法代码示例

本文整理汇总了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;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:9,代码来源:WikiaHomePageController.class.php

示例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'));
     }
 }
开发者ID:GoProjectOwner,项目名称:mediawiki-extensions-MobileFrontend,代码行数:13,代码来源:SkinMinervaBeta.php

示例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}&#160;<input name="okwDelete" type="checkbox" value="1" id="wpWatch" checked/>&#160;' . '<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;
 }
开发者ID:e4ong1031,项目名称:Ontokiwi,代码行数:75,代码来源:OntoKiWi.hook.php


注:本文中的OutputPage::clearHTML方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。