本文整理汇总了PHP中LogFormatter::getMessageParameters方法的典型用法代码示例。如果您正苦于以下问题:PHP LogFormatter::getMessageParameters方法的具体用法?PHP LogFormatter::getMessageParameters怎么用?PHP LogFormatter::getMessageParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogFormatter
的用法示例。
在下文中一共展示了LogFormatter::getMessageParameters方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMessageParameters
/**
* @return array
*/
protected function getMessageParameters()
{
$entry = $this->entry->getParameters();
$params = parent::getMessageParameters();
$filter_title = SpecialPage::getTitleFor('AbuseFilter', $entry['filter']);
$filter_caption = $this->msg('abusefilter-log-detailedentry-local')->params($entry['filter']);
$log_title = SpecialPage::getTitleFor('AbuseLog', $entry['log']);
$log_caption = $this->msg('abusefilter-log-detailslink');
$params[4] = $entry['action'];
if ($this->plaintext) {
$params[3] = '[[' . $filter_title->getPrefixedText() . '|' . $filter_caption . ']]';
$params[8] = '[[' . $log_title->getPrefixedText() . '|' . $log_caption . ']]';
} else {
$params[3] = Message::rawParam(Linker::link($filter_title, htmlspecialchars($filter_caption)));
$params[8] = Message::rawParam(Linker::link($log_title, htmlspecialchars($log_caption)));
}
$actions_taken = $entry['actions'];
if (!strlen(trim($actions_taken))) {
$actions_taken = $this->msg('abusefilter-log-noactions');
} else {
$actions = explode(',', $actions_taken);
$displayActions = array();
foreach ($actions as $action) {
$displayActions[] = AbuseFilter::getActionDisplay($action);
}
$actions_taken = $this->context->getLanguage()->commaList($displayActions);
}
$params[5] = $actions_taken;
// Bad things happen if the numbers are not in correct order
ksort($params);
return $params;
}
示例2: getMessageParameters
protected function getMessageParameters()
{
$params = parent::getMessageParameters();
// Really old entries
if (!isset($params[3]) && !isset($params[4])) {
return $params;
}
$oldGroups = $this->makeGroupArray($params[3]);
$newGroups = $this->makeGroupArray($params[4]);
$userName = $this->entry->getTarget()->getText();
if (!$this->plaintext && count($oldGroups)) {
foreach ($oldGroups as &$group) {
$group = User::getGroupMember($group, $userName);
}
}
if (!$this->plaintext && count($newGroups)) {
foreach ($newGroups as &$group) {
$group = User::getGroupMember($group, $userName);
}
}
$lang = $this->context->getLanguage();
if (count($oldGroups)) {
$params[3] = $lang->listToText($oldGroups);
} else {
$params[3] = $this->msg('rightsnone')->text();
}
if (count($newGroups)) {
// Array_values is used here because of bug 42211
// see use of array_unique in UserrightsPage::doSaveUserGroups on $newGroups.
$params[4] = $lang->listToText(array_values($newGroups));
} else {
$params[4] = $this->msg('rightsnone')->text();
}
return $params;
}
示例3: getMessageParameters
public function getMessageParameters()
{
$params = parent::getMessageParameters();
$type = $this->entry->getFullType();
if ($type === 'translationreview/message') {
$targetPage = $this->makePageLink($this->entry->getTarget(), array('oldid' => $params[3]));
$params[2] = Message::rawParam($targetPage);
} elseif ($type === 'translationreview/group') {
/*
* - 3: language code
* - 4: label of the message group
* - 5: old state
* - 6: new state
*/
$uiLanguage = $this->context->getLanguage();
$language = $params[3];
$targetPage = $this->makePageLinkWithText($this->entry->getTarget(), $params[4], array('language' => $language));
$params[2] = Message::rawParam($targetPage);
$params[3] = TranslateUtils::getLanguageName($language, $uiLanguage->getCode());
$params[5] = $this->formatStateMessage($params[5]);
$params[6] = $this->formatStateMessage($params[6]);
} elseif ($type === 'translatorsandbox/rejected') {
// No point linking to the user page which cannot have existed
$params[2] = $this->entry->getTarget()->getText();
} elseif ($type === 'translatorsandbox/promoted') {
// Gender for the target
$params[3] = User::newFromId($params[3])->getName();
}
return $params;
}
示例4: getMessageParameters
protected function getMessageParameters()
{
$params = parent::getMessageParameters();
/* Current format:
* 1,2,3: normal logformatter params
* 4: old username
* (legaciest doesn't have this at all, all in comment)
* (legacier uses this as new name and stores old name in target)
* 5: new username
* 6: number of edits the user had at the time
* (not available except in newest log entries)
* Note that the arrays are zero-indexed, while message parameters
* start from 1, so substract one to get array entries below.
*/
if (!isset($params[3])) {
// The oldest format
return $params;
} elseif (!isset($params[4])) {
// See comments above
$params[4] = $params[3];
$params[3] = $this->entry->getTarget()->getText();
}
// Nice link to old user page
$title = Title::makeTitleSafe(NS_USER, $params[3]);
$link = $this->myPageLink($title, $params[3]);
$params[3] = Message::rawParam($link);
// Nice link to new user page
$title = Title::makeTitleSafe(NS_USER, $params[4]);
$link = $this->myPageLink($title, $params[4]);
$params[4] = Message::rawParam($link);
return $params;
}
示例5: getMessageParameters
protected function getMessageParameters()
{
$params = parent::getMessageParameters();
$title = $this->entry->getTarget();
if (substr($title->getText(), 0, 1) === '#') {
// autoblock - no user link possible
$params[2] = $title->getText();
$params[3] = '';
// no user name for gender use
} else {
// Create a user link for the blocked
$username = $title->getText();
// @todo Store the user identifier in the parameters
// to make this faster for future log entries
$targetUser = User::newFromName($username, false);
$params[2] = Message::rawParam($this->makeUserLink($targetUser, Linker::TOOL_LINKS_NOBLOCK));
$params[3] = $username;
// plain user name for gender use
}
$subtype = $this->entry->getSubtype();
if ($subtype === 'block' || $subtype === 'reblock') {
if (!isset($params[4])) {
// Very old log entry without duration: means infinite
$params[4] = 'infinite';
}
// Localize the duration, and add a tooltip
// in English to help visitors from other wikis.
// The lrm is needed to make sure that the number
// is shown on the correct side of the tooltip text.
$durationTooltip = '‎' . htmlspecialchars($params[4]);
$params[4] = Message::rawParam("<span class='blockExpiry' title='{$durationTooltip}'>" . $this->context->getLanguage()->translateBlockExpiry($params[4]) . '</span>');
$params[5] = isset($params[5]) ? self::formatBlockFlags($params[5], $this->context->getLanguage()) : '';
}
return $params;
}
示例6: getMessageParameters
protected function getMessageParameters()
{
$params = parent::getMessageParameters();
$subtype = $this->entry->getSubtype();
if ($subtype === 'protect' || $subtype === 'modify') {
$rawParams = $this->entry->getParameters();
if (isset($rawParams['details'])) {
$params[3] = $this->createProtectDescription($rawParams['details']);
} elseif (isset($params[3])) {
// Old way of Restrictions and expiries
$params[3] = $this->context->getLanguage()->getDirMark() . $params[3];
} else {
// Very old way (nothing set)
$params[3] = '';
}
// Cascading flag
if (isset($params[4])) {
// handled in getMessageKey
unset($params[4]);
}
} elseif ($subtype === 'move_prot') {
$oldname = $this->makePageLink(Title::newFromText($params[3]), array('redirect' => 'no'));
$params[3] = Message::rawParam($oldname);
}
return $params;
}
示例7: getMessageParameters
public function getMessageParameters()
{
$params = parent::getMessageParameters();
$type = $this->entry->getSubtype();
$entry_params = $this->entry->getParameters();
if ($type === 'approve') {
$revid = $entry_params['revid'];
$link = Linker::linkKnown($this->entry->getTarget(), wfMessage('moderation-log-diff', $revid)->text(), array('title' => wfMessage('tooltip-moderation-approved-diff')), array('diff' => $revid));
$params[4] = Message::rawParam($link);
} elseif ($type === 'reject') {
$modid = $entry_params['modid'];
$link = Linker::linkKnown(Title::makeTitle(NS_SPECIAL, "Moderation"), wfMessage('moderation-log-change', $modid)->text(), array('title' => wfMessage('tooltip-moderation-rejected-change')), array('modaction' => 'show', 'modid' => $modid));
$params[4] = Message::rawParam($link);
$userlink = Linker::userLink($entry_params['user'], $entry_params['user_text']);
$params[5] = Message::rawParam($userlink);
} elseif ($type === 'merge') {
$revid = $entry_params['revid'];
$modid = $entry_params['modid'];
$link = Linker::linkKnown(Title::makeTitle(NS_SPECIAL, "Moderation"), wfMessage('moderation-log-change', $modid)->text(), array('title' => wfMessage('tooltip-moderation-rejected-change')), array('modaction' => 'show', 'modid' => $modid));
$params[4] = Message::rawParam($link);
$link = Linker::linkKnown($this->entry->getTarget(), wfMessage('moderation-log-diff', $revid)->text(), array('title' => wfMessage('tooltip-moderation-approved-diff')), array('diff' => $revid));
$params[5] = Message::rawParam($link);
} elseif ($type === 'approveall' || $type === 'rejectall' || $type === 'block' || $type === 'unblock') {
$title = $this->entry->getTarget();
$user_id = User::idFromName($title->getText());
$link = Linker::userLink($user_id, $title->getText());
$params[2] = Message::rawParam($link);
}
return $params;
}
示例8: getMessageParameters
protected function getMessageParameters()
{
$lang = $this->context->getLanguage();
$params = parent::getMessageParameters();
$params[3] = ContentHandler::getLocalizedName($params[3], $lang);
$params[4] = ContentHandler::getLocalizedName($params[4], $lang);
return $params;
}
示例9: getMessageParameters
protected function getMessageParameters() {
$params = parent::getMessageParameters();
$oldname = $this->makePageLink( $this->entry->getTarget(), array( 'redirect' => 'no' ) );
$newname = $this->makePageLink( Title::newFromText( $params[3] ) );
$params[2] = Message::rawParam( $oldname );
$params[3] = Message::rawParam( $newname );
return $params;
}
示例10: getMessageParameters
protected function getMessageParameters()
{
$params = parent::getMessageParameters();
$subtype = $this->entry->getSubtype();
if ($subtype === 'requestwiki') {
$params[6] = str_replace('#', '', $params[6]);
$params[6] = Message::rawParam(Linker::linkKnown(Title::newFromText(SpecialPage::getTitleFor('RequestWikiQueue') . '/' . $params[6]), '#' . $params[6]));
return $params;
}
}
示例11: getMessageParameters
protected function getMessageParameters()
{
$params = parent::getMessageParameters();
$subtype = $this->entry->getSubtype();
if ($subtype === 'move_prot') {
$oldname = $this->makePageLink(Title::newFromText($params[3]), array('redirect' => 'no'));
$params[3] = Message::rawParam($oldname);
}
return $params;
}
示例12: getMessageParameters
protected function getMessageParameters()
{
$params = parent::getMessageParameters();
$oldname = $this->makePageLink($this->entry->getTarget(), array('redirect' => 'no'));
$newname = $this->makePageLink(Title::newFromText($params[3]));
$params[2] = Message::rawParam($oldname);
$params[3] = Message::rawParam($newname);
$params[4] = $this->context->getLanguage()->userTimeAndDate($params[4], $this->context->getUser());
return $params;
}
示例13: getMessageParameters
protected function getMessageParameters()
{
parent::getMessageParameters();
$params = $this->extractParameters();
$lang = $this->context->getLanguage();
$this->parsedParameters[3] = Message::rawParam($lang->commaList(array_map(array($this, 'getCentralAuthLink'), explode('|', $params[3]))));
$this->parsedParameters[4] = Message::rawParam($this->getCentralAuthLink($params[4]));
ksort($this->parsedParameters);
return $this->parsedParameters;
}
示例14: getMessageParameters
protected function getMessageParameters() {
$params = parent::getMessageParameters();
$subtype = $this->entry->getSubtype();
if ( $subtype === 'create2' || $subtype === 'byemail' ) {
if ( isset( $params[3] ) ) {
$target = User::newFromId( $params[3] );
} else {
$target = User::newFromName( $this->entry->getTarget()->getText(), false );
}
$params[2] = Message::rawParam( $this->makeUserLink( $target ) );
$params[3] = $target->getName();
}
return $params;
}
示例15: getMessageParameters
protected function getMessageParameters()
{
parent::getMessageParameters();
$params = $this->extractParameters();
if ($this->entry->getSubtype() === 'promote') {
$this->parsedParameters[3] = $this->getLocalWikiLink($params[3], $params[5]);
} else {
// rename
$this->parsedParameters[3] = $this->getCentralAuthLink($params[3]);
}
$this->parsedParameters[4] = $this->getCentralAuthLink($params[4]);
ksort($this->parsedParameters);
return $this->parsedParameters;
}