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


PHP OutputPage::parse方法代码示例

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


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

示例1: tmwAccountsNotice

 /**
  * Add "x email-tmwed open account requests" notice
  * @param $notice
  * @return bool
  */
 public static function tmwAccountsNotice(OutputPage &$out, Skin &$skin)
 {
     global $wgTMWAccountNotice;
     $context = $out->getContext();
     if (!$wgTMWAccountNotice || !$context->getUser()->isAllowed('tmwaccount')) {
         return true;
     }
     # Only show on some special pages
     $title = $context->getTitle();
     if (!$title->isSpecial('Recentchanges') && !$title->isSpecial('Watchlist')) {
         return true;
     }
     $count = TMWAccount::getOpenEmailTMWedCount('*');
     if ($count > 0) {
         $out->prependHtml('<div id="mw-tmwaccount-msg" class="plainlinks mw-tmwaccount-bar">' . $out->parse(wfMsgExt('tmwaccount-newrequests', 'parsemag', $count), false) . '</div>');
     }
     return true;
 }
开发者ID:nelson6e65,项目名称:themanaworld-website,代码行数:23,代码来源:TMWAccountUI.hooks.php

示例2: outputPage


//.........这里部分代码省略.........
             $tpl->set('jsvarurl', $this->makeUrl('-', 'action=raw&gen=js'));
         }
     } else {
         $tpl->set('jsvarurl', false);
     }
     wfProfileOut("{$fname}-stuff2");
     wfProfileIn("{$fname}-stuff3");
     $tpl->setRef('newtalk', $ntl);
     $tpl->setRef('skin', $this);
     $tpl->set('logo', $this->logoText());
     if ($wgOut->isArticle() and (!isset($oldid) or isset($diff)) and $this->getContext()->canUseWikiPage() && 0 != $this->getContext()->getWikiPage()->getId()) {
         if (!$wgDisableCounters) {
             $viewcount = $this->getContext()->getWikiPage()->getCount();
             if ($viewcount) {
                 $tpl->set('viewcount', wfMessage("viewcount", $viewcount)->text());
             } else {
                 $tpl->set('viewcount', false);
             }
         } else {
             $tpl->set('viewcount', false);
         }
         $tpl->set('lastmod', $this->lastModified());
         $tpl->set('copyright', $this->getCopyright());
         $this->credits = false;
         if (isset($wgMaxCredits) && $wgMaxCredits != 0) {
             require_once "{$IP}/includes/Credits.php";
             $this->credits = getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax);
         }
         $tpl->setRef('credits', $this->credits);
     } elseif (isset($oldid) && !isset($diff)) {
         $tpl->set('copyright', $this->getCopyright());
         $tpl->set('viewcount', false);
         $tpl->set('lastmod', false);
         $tpl->set('credits', false);
     } else {
         $tpl->set('copyright', false);
         $tpl->set('viewcount', false);
         $tpl->set('lastmod', false);
         $tpl->set('credits', false);
     }
     wfProfileOut("{$fname}-stuff3");
     wfProfileIn("{$fname}-stuff4");
     $tpl->set('copyrightico', $this->getCopyrightIcon());
     $tpl->set('poweredbyico', $this->getPoweredBy());
     $tpl->set('disclaimer', $this->disclaimerLink());
     $tpl->set('about', $this->aboutLink());
     $tpl->setRef('debug', $out->mDebugtext);
     //$out->addHTML($printfooter);
     $tpl->set('bottomscripts', $this->bottomScripts());
     if ($wgTitle->getNamespace() == NS_USER && $wgUser->getId() == 0 && !UserPagePolicy::isGoodUserPage($wgTitle->getDBKey())) {
         $txt = $out->parse(wfMessage('noarticletext_user')->text());
         $tpl->setRef('bodytext', $txt);
         header('HTTP/1.1 404 Not Found');
     } else {
         if (!is_null($out)) {
             $tpl->setRef('bodytext', $out->getHTML());
         }
     }
     # Language links
     $language_urls = array();
     if (!$wgHideInterlanguageLinks) {
         foreach ($wgOut->getLanguageLinks() as $l) {
             $tmp = explode(':', $l, 2);
             $class = 'interwiki-' . $tmp[0];
             $code = $tmp[0];
             $lTitle = $tmp[1];
             unset($tmp);
             $nt = Title::newFromText($l);
             $language = $wgContLang->fetchLanguageName($nt->getInterwiki(), $wgLanguageCode);
             $language_urls[] = array('code' => $code, 'href' => $nt->getFullURL(), 'text' => $lTitle, 'class' => $class, 'language' => ($language != '' ? Misc::capitalize($language) : $l) . ": ");
         }
     }
     if (count($language_urls)) {
         $tpl->setRef('language_urls', $language_urls);
     } else {
         $tpl->set('language_urls', false);
     }
     wfProfileOut("{$fname}-stuff4");
     # Personal toolbar
     //$tpl->set('personal_urls', $this->buildPersonalUrls());
     /*$content_actions = $this->buildContentActionUrls();
     		$tpl->setRef('content_actions', $content_actions);
     
     		// XXX: attach this from javascript, same with section editing
     		if($this->iseditable && $wgUser->getOption("editondblclick") ) {
     			$tpl->set('body_ondblclick', 'document.location = "' .$content_actions['edit']['href'] .'";');
     		} else {
     			$tpl->set('body_ondblclick', false);
     		}
     		*/
     //$tpl->set( 'navigation_urls', $this->buildNavigationUrls() );
     //$tpl->set( 'nav_urls', $this->buildNavUrls() );
     // execute template
     wfProfileIn("{$fname}-execute");
     $res = $tpl->execute();
     wfProfileOut("{$fname}-execute");
     // result may be an error
     $this->printOrError($res);
     wfProfileOut($fname);
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:101,代码来源:WikiHowSkin.php

示例3: renderFormHeader

 /**
  * Print extra field for 'title'
  *
  * @param OutputPage $wgOut
  */
 public function renderFormHeader($wgOut)
 {
     global $wgRequest;
     $oTmpl = new EasyTemplate(dirname(__FILE__) . "/templates/");
     $oTmpl->set_vars(array("formErrors" => $this->mFormErrors, "formData" => $this->mFormData, "isReload" => $wgRequest->getVal('wpIsReload', 0) == 1, "editIntro" => $wgOut->parse($this->mEditIntro)));
     $wgOut->setPageTitle(wfMsg("createpage"));
     $wgOut->addScriptFile('edit.js');
     if ($this->mPreviewTitle == null) {
         $wgOut->addHTML('<div id="custom_createpagetext">');
         $wgOut->addWikiText(wfMsgForContent('newarticletext'));
         $wgOut->addHTML('</div>');
     }
     $wgOut->addHTML($oTmpl->render("createFormHeader"));
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:19,代码来源:SpecialCreatePage.class.php


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