當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OutputPage::setupOOUI方法代碼示例

本文整理匯總了PHP中OutputPage::setupOOUI方法的典型用法代碼示例。如果您正苦於以下問題:PHP OutputPage::setupOOUI方法的具體用法?PHP OutputPage::setupOOUI怎麽用?PHP OutputPage::setupOOUI使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OutputPage的用法示例。


在下文中一共展示了OutputPage::setupOOUI方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: enableOOUI

 /**
  * Set's up the PHP implementation of OOUI for use in this request
  * and instructs OutputPage to enable OOUI for itself.
  *
  * @since 1.26
  */
 public function enableOOUI()
 {
     OutputPage::setupOOUI();
     $this->mOutput->setEnableOOUI(true);
 }
開發者ID:rrameshs,項目名稱:mediawiki,代碼行數:11,代碼來源:Parser.php

示例2: makeHeader

 /**
  * Helper function for getParsedcontent for making subpage section headers
  * @param $contentItem array of data for the content item we're generating the header for
  * @return string html (NOTE THIS IS AN OPEN DIV)
  */
 protected function makeHeader(Title $title, array $contentItem)
 {
     global $wgParser;
     static $tocLinks = [];
     // All used ids for the sections for the toc
     $linkRenderer = $wgParser->getLinkRenderer();
     $spTitle = Title::newFromText($contentItem['title']);
     $spRev = Revision::newFromTitle($spTitle);
     // Get display name
     if (isset($contentItem['displayTitle'])) {
         $spPage = $contentItem['displayTitle'];
     } else {
         $spPage = $spTitle->getSubpageText();
     }
     // Generate an id for the section for anchors
     // Make sure this matches the ToC anchor generation
     $spPageLink = Sanitizer::escapeId(htmlspecialchars($spPage));
     $spPageLink2 = $spPageLink;
     $spPageLinkCounter = 1;
     while (in_array($spPageLink2, $tocLinks)) {
         $spPageLink2 = $spPageLink . $spPageLinkCounter;
         $spPageLinkCounter++;
     }
     $tocLinks[] = $spPageLink2;
     // Get editsection-style links for the subpage
     $sectionLinks = [];
     $sectionLinksText = '';
     if (isset($spRev)) {
         $sectionLinks['viewLink'] = $linkRenderer->makeLink($spTitle, wfMessage('collaborationkit-hub-subpage-view')->inContentLanguage()->text());
     }
     if ($spTitle->userCan('edit')) {
         if (isset($spRev)) {
             $linkString = 'edit';
             // TODO get appropriate edit link if it's something weird
             $sectionLinks['edit'] = $linkRenderer->makeLink($spTitle, wfMessage($linkString)->inContentLanguage()->text(), [], ['action' => 'edit']);
         } else {
             $linkString = 'create';
             $sectionLinks['edit'] = $linkRenderer->makeLink(SpecialPage::getTitleFor('CreateHubFeature'), wfMessage($linkString)->inContentLanguage()->text(), [], ['collaborationhub' => $title->getPrefixedDBKey(), 'feature' => $spTitle->getSubpageText()]);
         }
     }
     if ($title->userCan('edit')) {
         $sectionLinks['removeLink'] = $linkRenderer->makeLink($title, wfMessage('collaborationkit-hub-subpage-remove')->inContentLanguage()->text(), [], ['action' => 'edit']);
     }
     foreach ($sectionLinks as $sectionLink) {
         $sectionLinksText .= $this->makeEditSectionLink($sectionLink);
     }
     $sectionLinksText = Html::rawElement('span', ['class' => 'mw-editsection'], $sectionLinksText);
     // Assemble header
     // Open general section here since we have the id here
     $html = Html::openElement('div', ['class' => 'mw-ck-hub-section', 'id' => $spPageLink2]);
     $html .= Html::rawElement('h2', [], Html::element('span', ['class' => 'mw-headline'], $spPage) . $sectionLinksText);
     OutputPage::setupOOUI();
     return $html;
 }
開發者ID:wikimedia,項目名稱:mediawiki-extensions-CollaborationKit,代碼行數:59,代碼來源:CollaborationHubContent.php


注:本文中的OutputPage::setupOOUI方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。