16 public static function getValue(array $users = [], array $params = []): string
18 $visibleMembersCount = 3;
21 $heads = static::fillUsersLayout(($users[
'HEADS'] ?? []));
25 foreach ($heads as $head)
27 if ($head[
'IS_OWNER'] ===
'Y')
29 array_unshift($innerLayouts, $head[
'LAYOUT']);
32 $innerLayouts[] = $head[
'LAYOUT'];
35 if (count($innerLayouts) > $visibleMembersCount)
37 $innerLayouts = array_slice($innerLayouts, 0, $visibleMembersCount);
40 $innerLayouts = implode(
"\n", $innerLayouts);
41 $totalHeadsCount = (int)($params[
'NUMBER_OF_MODERATORS'] ?? 0);
44 "<div style='display: inline-block'>"
45 .
"<div class='sonet-ui-grid-user-list sonet-ui-grid-user-list--green'>"
47 . static::makeOtherCounterLayout($totalHeadsCount - $visibleMembersCount)
54 $users = static::fillUsersLayout(($users[
'MEMBERS'] ?? []));
56 if (count($users) > 0)
59 foreach ($users as $user)
61 $innerLayouts[] = $user[
'LAYOUT'];
62 if (count($innerLayouts) >= $visibleMembersCount)
67 $innerLayouts = implode(
"\n", $innerLayouts);
68 $totalUsersCount = (int)($params[
'NUMBER_OF_MEMBERS'] ?? 0);
71 '<div style="display: inline-block">'
72 .
'<div class="sonet-ui-grid-user-list">'
74 . static::makeOtherCounterLayout(($totalUsersCount - $totalHeadsCount - $visibleMembersCount))
81 '<div class="sonet-ui-grid-user-list-container" onclick="' . static::getMembersPopupShowFunction(
82 (
int)$params[
'GROUP_ID'],
83 (
string)$params[
'GROUP_TYPE'],
84 (
string)$params[
'GRID_ID']