本文整理汇总了PHP中ChangesList::insertUserRelatedLinks方法的典型用法代码示例。如果您正苦于以下问题:PHP ChangesList::insertUserRelatedLinks方法的具体用法?PHP ChangesList::insertUserRelatedLinks怎么用?PHP ChangesList::insertUserRelatedLinks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ChangesList
的用法示例。
在下文中一共展示了ChangesList::insertUserRelatedLinks方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onChangesListInsertLogEntry
/**
* @brief Adjusting recent changes for Wall
*
* @desc This method creates comment about revision deletion of a message on message wall
*
* @param ChangesList $list
* @param RecentChange $rc
* @param String $s
* @param Formatter $formatter
* @param string $mark
*
* @return true because this is a hook
*
* @author Andrzej 'nAndy' Lukaszewski
*/
public function onChangesListInsertLogEntry($list, $rc, &$s, $formatter, &$mark)
{
$app = F::app();
if ($rc->getAttribute('rc_type') == RC_LOG && in_array(MWNamespace::getSubject($rc->getAttribute('rc_namespace')), $app->wg->WallNS) && in_array($rc->getAttribute('rc_log_action'), $this->rcWallActionTypes)) {
$actionText = '';
$wfMsgOptsBase = $this->getMessageOptions($rc);
$wfMsgOpts = array($wfMsgOptsBase['articleUrl'], $wfMsgOptsBase['articleTitleTxt'], $wfMsgOptsBase['wallPageUrl'], $wfMsgOptsBase['wallPageName'], $wfMsgOptsBase['actionUser']);
$msgType = $wfMsgOptsBase['isThread'] ? 'thread' : 'reply';
//created in WallHooksHelper::getMessageOptions()
//and there is not needed to be passed to wfMsg()
unset($wfMsgOpts['isThread'], $wfMsgOpts['isNew']);
switch ($rc->getAttribute('rc_log_action')) {
case 'wall_remove':
$actionText = wfMsgExt($this->getMessagePrefix($rc->getAttribute('rc_namespace')) . '-removed-' . $msgType, array('parseinline'), $wfMsgOpts);
break;
case 'wall_restore':
$actionText = wfMsgExt($this->getMessagePrefix($rc->getAttribute('rc_namespace')) . '-restored-' . $msgType, array('parseinline'), $wfMsgOpts);
break;
case 'wall_admindelete':
$actionText = wfMsgExt($this->getMessagePrefix($rc->getAttribute('rc_namespace')) . '-deleted-' . $msgType, array('parseinline'), $wfMsgOpts);
break;
case 'wall_archive':
$actionText = wfMsgExt($this->getMessagePrefix($rc->getAttribute('rc_namespace')) . '-closed-thread', array('parseinline'), $wfMsgOpts);
break;
case 'wall_reopen':
$actionText = wfMsgExt($this->getMessagePrefix($rc->getAttribute('rc_namespace')) . '-reopened-thread', array('parseinline'), $wfMsgOpts);
break;
default:
$actionText = wfMsg($this->getMessagePrefix($rc->getAttribute('rc_namespace')) . '-unrecognized-log-action', $wfMsgOpts);
break;
}
$s = '';
$list->insertUserRelatedLinks($s, $rc);
$s .= ' ' . $actionText . ' ' . $list->insertComment($rc);
}
return true;
}