本文整理汇总了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));
}
示例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);
}
示例3: formatLinksInComment
public function formatLinksInComment($comment, $title = null, $local = false, $wikiId = null)
{
return Linker::formatLinksInComment($comment, $title, $local, $wikiId);
}
示例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;
}