16 public static function getValue(array $users = [], array $params = []): string
18 $visibleMembersCount = 3;
20 $totalHeadsCount = (int)($params[
'NUMBER_OF_MODERATORS'] ?? 0);
23 $heads = static::fillUsersLayout(($users[
'HEADS'] ?? []));
27 foreach ($heads as $head)
29 if ($head[
'IS_OWNER'] ===
'Y')
31 array_unshift($innerLayouts, $head[
'LAYOUT']);
34 $innerLayouts[] = $head[
'LAYOUT'];
37 if (count($innerLayouts) > $visibleMembersCount)
39 $innerLayouts = array_slice($innerLayouts, 0, $visibleMembersCount);
42 $innerLayouts = implode(
"\n", $innerLayouts);
45 "<div style='display: inline-block'>"
46 .
"<div class='sonet-ui-grid-user-list sonet-ui-grid-user-list--green'>"
48 . static::makeOtherCounterLayout($totalHeadsCount - $visibleMembersCount)
55 $users = static::fillUsersLayout(($users[
'MEMBERS'] ?? []));
57 if (count($users) > 0)
60 foreach ($users as $user)
62 $innerLayouts[] = $user[
'LAYOUT'];
63 if (count($innerLayouts) >= $visibleMembersCount)
68 $innerLayouts = implode(
"\n", $innerLayouts);
69 $totalUsersCount = (int)($params[
'NUMBER_OF_MEMBERS'] ?? 0);
72 '<div style="display: inline-block">'
73 .
'<div class="sonet-ui-grid-user-list">'
75 . static::makeOtherCounterLayout(($totalUsersCount - $totalHeadsCount - $visibleMembersCount))
82 '<div class="sonet-ui-grid-user-list-container" onclick="' . static::getMembersPopupShowFunction(
83 (
int)$params[
'GROUP_ID'],
84 (
string)$params[
'GROUP_TYPE'],
85 (
string)$params[
'GRID_ID']