當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。