本文整理汇总了PHP中JTable::whoMakesAction方法的典型用法代码示例。如果您正苦于以下问题:PHP JTable::whoMakesAction方法的具体用法?PHP JTable::whoMakesAction怎么用?PHP JTable::whoMakesAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JTable
的用法示例。
在下文中一共展示了JTable::whoMakesAction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: whoMakesAction
/**
* Call this function to retrieve the item/message viewer
* @param JTable $stream the current StreamTable
* @param int $item_id the owner of the item (for example: id of the file or id of a message contains a link)
* @param String $type type of the item (since tracking is done by id, being specific is safer. eg: file_220, link_220)
*/
function whoMakesAction($stream, $item_id = 0, $type = NULL)
{
// get list of avatar who viewed the stream
$whoMakesAction = $stream->whoMakesAction($item_id, $type);
$avatarListWhoMakeAction = '';
if ($whoMakesAction && count($whoMakesAction) > 0) {
// Do rename the variable if its too long or easily mistyped
$avatarListWhoMakeAction .= '<div class="user-horizontal-list message-reader-list">';
if ($type == 'video') {
// change language from READ to SEEN if its a video
$avatarListWhoMakeAction .= '<span class="small">' . JText::_('COM_STREAM_LABEL_SEEN_BY') . ' ';
} else {
$avatarListWhoMakeAction .= '<span class="small">' . JText::_('COM_STREAM_LABEL_READ_BY') . ' ';
}
/* $avatarListWhoMakeAction .= count($whoMakesAction) . ' reader'; */
$avatarListWhoMakeAction .= '<a href="#showReaders" data-content="<ul>';
foreach ($whoMakesAction as $user_id) {
// there will be 0 as user which in return will load current user
if ($user_id != 0 && $user_id != NULL) {
$user = JXFactory::getUser($user_id);
$avatarListWhoMakeAction .= StreamTemplate::escape('<li><a href="' . $user->getURL() . '">' . $user->name . '</a></li>');
}
}
$avatarListWhoMakeAction .= '</ul>">';
$label = count($whoMakesAction) > 1 ? JText::_('COM_STREAM_LABEL_USERS') : JText::_('COM_STREAM_LABEL_USER');
$avatarListWhoMakeAction .= count($whoMakesAction) . " {$label}</a>";
$avatarListWhoMakeAction .= '</span></div>';
}
return $avatarListWhoMakeAction;
}