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


PHP OutputPage::getHTML方法代码示例

本文整理汇总了PHP中OutputPage::getHTML方法的典型用法代码示例。如果您正苦于以下问题:PHP OutputPage::getHTML方法的具体用法?PHP OutputPage::getHTML怎么用?PHP OutputPage::getHTML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OutputPage的用法示例。


在下文中一共展示了OutputPage::getHTML方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: DOMParse

 /**
  * Transforms content to be mobile friendly version.
  * Filters out various elements and runs the MobileFormatter.
  * @param OutputPage $out
  * @param string $mode mobile mode, i.e. stable or beta
  *
  * @return string
  */
 public static function DOMParse(OutputPage $out, $text = null, $isBeta = false)
 {
     $html = $text ? $text : $out->getHTML();
     $context = MobileContext::singleton();
     $formatter = MobileFormatter::newFromContext($context, $html);
     Hooks::run('MobileFrontendBeforeDOM', array($context, $formatter));
     $title = $out->getTitle();
     $isSpecialPage = $title->isSpecialPage();
     $formatter->enableExpandableSections($out->canUseWikiPage() && $out->getWikiPage()->getContentModel() == CONTENT_MODEL_WIKITEXT && array_search($title->getNamespace(), $context->getMFConfig()->get('MFNamespacesWithoutCollapsibleSections')) === false && $context->getRequest()->getText('action', 'view') == 'view');
     if ($context->getContentTransformations()) {
         // Remove images if they're disabled from special pages, but don't transform otherwise
         $formatter->filterContent(!$isSpecialPage);
     }
     $contentHtml = $formatter->getText();
     // If the page is a user page which has not been created, then let the
     // user know about it with pretty graphics and different texts depending
     // on whether the user is the owner of the page or not.
     if ($isBeta && $title->inNamespace(NS_USER) && !$title->isSubpage()) {
         $pageUserId = User::idFromName($title->getText());
         if ($pageUserId && !$title->exists()) {
             $pageUser = User::newFromId($pageUserId);
             $contentHtml = ExtMobileFrontend::getUserPageContent($out, $pageUser);
         }
     }
     return $contentHtml;
 }
开发者ID:micha6554,项目名称:mediawiki-extensions-MobileFrontend,代码行数:34,代码来源:MobileFrontend.body.php

示例2: 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 
    }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:57,代码来源:Tomas.class.php

示例3: setupSkinUserCss

 /**
  * Add specific styles for this skin
  *
  * @param OutputPage $out
  */
 function setupSkinUserCss(OutputPage $out)
 {
     $moduleStyles = array('mediawiki.legacy.shared', 'mediawiki.legacy.commonPrint', 'mediawiki.sectionAnchor');
     if ($out->isSyndicated()) {
         $moduleStyles[] = 'mediawiki.feedlink';
     }
     // Deprecated since 1.26: Unconditional loading of mediawiki.ui.button
     // on every page is deprecated. Express a dependency instead.
     if (strpos($out->getHTML(), 'mw-ui-button') !== false) {
         $moduleStyles[] = 'mediawiki.ui.button';
     }
     $out->addModuleStyles($moduleStyles);
 }
开发者ID:Kaph-Noir,项目名称:mediawiki,代码行数:18,代码来源:SkinTemplate.php

示例4: DOMParse

 /**
  * Transforms content to be mobile friendly version.
  * Filters out various elements and runs the MobileFormatter.
  * @param OutputPage $out
  *
  * @return string
  */
 public static function DOMParse(OutputPage $out)
 {
     $html = $out->getHTML();
     $context = MobileContext::singleton();
     $formatter = MobileFormatter::newFromContext($context, $html);
     Hooks::run('MobileFrontendBeforeDOM', array($context, $formatter));
     $title = $out->getTitle();
     $isSpecialPage = $title->isSpecialPage();
     $formatter->enableExpandableSections($out->canUseWikiPage() && $out->getWikiPage()->getContentModel() == CONTENT_MODEL_WIKITEXT && array_search($title->getNamespace(), $context->getMFConfig()->get('MFNamespacesWithoutCollapsibleSections')) === false && $context->getRequest()->getText('action', 'view') == 'view');
     if ($context->getContentTransformations()) {
         // Remove images if they're disabled from special pages, but don't transform otherwise
         $formatter->filterContent(!$isSpecialPage);
     }
     $contentHtml = $formatter->getText();
     return $contentHtml;
 }
开发者ID:negati-ve,项目名称:openshift-mediawiki,代码行数:23,代码来源:MobileFrontend.body.php

示例5: capturePath

 /**
  * Just like executePath() except it returns the HTML instead of outputting it
  * Returns false if there was no such special page, or a title object if it was
  * a redirect.
  * @static
  */
 static function capturePath(&$title)
 {
     global $wgOut, $wgTitle;
     $oldTitle = $wgTitle;
     $oldOut = $wgOut;
     $wgOut = new OutputPage();
     $ret = SpecialPage::executePath($title, true);
     if ($ret === true) {
         $ret = $wgOut->getHTML();
     }
     $wgTitle = $oldTitle;
     $wgOut = $oldOut;
     return $ret;
 }
开发者ID:negabaro,项目名称:alfresco,代码行数:20,代码来源:SpecialPage.php

示例6: GetSpecialPage

 /**
  * @brief This returns the HTML output of any SpecialPage::execute function
  * @details
  * 	SpecialPage::capturePath will skip SpecialPages which are not "includable"
  *	(which is all the interesting ones)  So we need to force it.
  *
  * @requestParam string page the name of the Special page to invoke
  * @responseParam string output the HTML output of the special page
  */
 public function GetSpecialPage()
 {
     if (!$this->wg->User->isAllowed('admindashboard')) {
         $this->displayRestrictionError();
         return false;
         // skip rendering
     }
     // Construct title object from request params
     $pageName = $this->getVal("page");
     $title = SpecialPage::getTitleFor($pageName);
     // Save global variables and initialize context for special page
     global $wgOut, $wgTitle;
     $oldTitle = $wgTitle;
     $oldOut = $wgOut;
     $wgOut = new OutputPage();
     $wgOut->setTitle($title);
     $wgTitle = $title;
     // Construct special page object
     try {
         $basePages = array("Categories", "Recentchanges", "Specialpages");
         if (in_array($pageName, $basePages)) {
             $sp = SpecialPageFactory::getPage($pageName);
         } else {
             $sp = new $pageName();
         }
     } catch (Exception $e) {
         print_pre("Could not construct special page object");
     }
     if ($sp instanceof SpecialPage) {
         $ret = $sp->execute(false);
     } else {
         print_pre("Object is not a special page.");
     }
     // TODO: check retval of special page call?
     $this->output = $wgOut->getHTML();
     // Restore global variables
     $wgTitle = $oldTitle;
     $wgOut = $oldOut;
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:48,代码来源:AdminDashboardSpecialPageController.class.php

示例7: 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

示例8: 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 
    }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:69,代码来源:Schulenburg.class.php

示例9: showCustomIntro

 /**
  * Attempt to show a custom editing introduction, if supplied
  *
  * @return bool
  */
 protected function showCustomIntro()
 {
     // Code based on EditPage.php
     if ($this->editintro) {
         $title = Title::newFromText($this->editintro);
         if ($title instanceof Title && $title->exists() && $title->userCan('read')) {
             $wgOut = new OutputPage();
             // Added using template syntax, to take <noinclude>'s into account.
             $wgOut->addWikiTextTitleTidy('{{:' . $title->getFullText() . '}}', $this->mTitle);
             // store it
             $text = $wgOut->getHTML();
             $this->mEditPagePreloads['EditPageCustomIntro'] = array('content' => trim($text), 'class' => 'mw-custompreload');
             return true;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:25,代码来源:EditPageLayout.class.php

示例10: testArticleUpdatedByAPIBOTH

 public function testArticleUpdatedByAPIBOTH()
 {
     smwf_om_EditArticle('QRCQueryArticle1', 'PHPUnit', $this->queryArticle1, '');
     global $wgTitle;
     $wgTitle = Title::newFromText('QRCDataArticle1');
     smwf_om_EditArticle('QRCDataArticle1', 'PHPUnit', ' ', '');
     $request = json_encode(array('debug' => true));
     $response = smwf_qc_getQueryIds($request);
     $response = json_decode($response);
     foreach ($response->queryIds as $qId) {
         $request = json_encode(array('debug' => true, 'queryId' => $qId));
         $response = smwf_qc_updateQuery($request);
         $response = json_decode($response);
     }
     global $wgOut;
     $wgOut = new OutputPage();
     $article = new Article(Title::newFromText('QRCQueryArticle1'));
     $article->view();
     $html = print_r($wgOut->getHTML(), true);
     $found = false;
     if (strpos($html, 'QRCDataArticle1') > 0) {
         $found = true;
     }
     $this->assertEquals(false, $found);
 }
开发者ID:seedbank,项目名称:old-repo,代码行数:25,代码来源:TestQueryResultsCache.php


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