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


PHP Linker::formatLinksInComment方法代码示例

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


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

示例1: testFormatLinksInComment

 /**
  * @covers Linker::formatLinksInComment
  * @dataProvider provideCasesForFormatLinksInComment
  */
 public function testFormatLinksInComment($expected, $input, $wiki)
 {
     $conf = new SiteConfiguration();
     $conf->settings = array('wgServer' => array('enwiki' => '//en.example.org'), 'wgArticlePath' => array('enwiki' => '/w/$1'));
     $conf->suffixes = array('wiki');
     $this->setMwGlobals(array('wgScript' => '/wiki/index.php', 'wgArticlePath' => '/wiki/$1', 'wgWellFormedXml' => true, 'wgCapitalLinks' => true, 'wgConf' => $conf));
     $this->assertEquals($expected, Linker::formatLinksInComment($input, Title::newFromText('Special:BlankPage'), false, $wiki));
 }
开发者ID:D66Ha,项目名称:mediawiki,代码行数:12,代码来源:LinkerTest.php

示例2: formatSubject

 static function formatSubject($s)
 {
     # Sanitize text a bit:
     $s = str_replace("\n", " ", $s);
     # Allow HTML entities
     $s = Sanitizer::escapeHtmlAllowEntities($s);
     # Render links:
     return Linker::formatLinksInComment($s, null, false);
 }
开发者ID:Rikuforever,项目名称:wiki,代码行数:9,代码来源:View.php

示例3: formatLinksInComment

 public function formatLinksInComment($comment, $title = null, $local = false, $wikiId = null)
 {
     return Linker::formatLinksInComment($comment, $title, $local, $wikiId);
 }
开发者ID:claudinec,项目名称:galan-wiki,代码行数:4,代码来源:DummyLinker.php

示例4: formatBlockStatus

 /**
  * @param $row
  * @return String
  */
 private function formatBlockStatus($row)
 {
     $additionalHtml = '';
     if (isset($row['blocked']) && $row['blocked']) {
         $flags = array();
         foreach (array('anononly', 'nocreate', 'noautoblock', 'noemail', 'nousertalk') as $option) {
             if ($row['block-' . $option]) {
                 $flags[] = $option;
             }
         }
         $flags = implode(',', $flags);
         $optionMessage = BlockLogFormatter::formatBlockFlags($flags, $this->getLanguage());
         if ($row['block-expiry'] == 'infinity') {
             $text = $this->msg('centralauth-admin-blocked2-indef')->parse();
         } else {
             $expiry = $this->getLanguage()->timeanddate($row['block-expiry'], true);
             $expiryd = $this->getLanguage()->date($row['block-expiry'], true);
             $expiryt = $this->getLanguage()->time($row['block-expiry'], true);
             $text = $this->msg('centralauth-admin-blocked2', $expiry, $expiryd, $expiryt)->parse();
         }
         if ($flags) {
             $additionalHtml .= ' ' . $optionMessage;
         }
         if ($row['block-reason']) {
             $reason = Sanitizer::escapeHtmlAllowEntities($row['block-reason']);
             $reason = Linker::formatLinksInComment($reason, null, false, $row['wiki']);
             $msg = $this->msg('centralauth-admin-blocked-reason');
             $msg->rawParams('<span class="plainlinks">' . $reason . '</span>');
             $additionalHtml .= ' ' . $msg->parse();
         }
     } else {
         $text = $this->msg('centralauth-admin-notblocked')->parse();
     }
     return self::foreignLink($row['wiki'], 'Special:Log/block', $text, $this->msg('centralauth-admin-blocklog')->text(), 'page=User:' . urlencode($this->mUserName)) . $additionalHtml;
 }
开发者ID:NDKilla,项目名称:mediawiki-extensions-CentralAuth,代码行数:39,代码来源:SpecialCentralAuth.php


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