当前位置: 首页>>代码示例>>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;未经允许,请勿转载。