{* This file is a little hard to read... sorry! :( *} {define admin-status-template} {var $isOnline = isset($client["clid"])}
{if $iconBeforeName} {if $group["iconid"]} {$group[ {else} {$group["name"]} {/if} {/if} {$client["client_nickname"]} {if $isOnline} {if $client["client_away"]} {ifset $client["client_away_message"]} {_"ADMIN_STATUS_AWAY"} {else} {_"ADMIN_STATUS_AWAY"} {/ifset} {else} {_"ADMIN_STATUS_ONLINE"} {/if} {else} {_"ADMIN_STATUS_OFFLINE"} {/if}
{/define} {* STATUS_STYLE_GROUPED or STATUS_STYLE_GROUPED_HIDE_EMPTY_GROUPS *} {if $format === 1 || $format === 2}
{if !$data}
{_"ADMIN_STATUS_EMPTY_STATUS"}
{/if} {foreach $data as $sgid => $group} {* additional div, mainly used for additional *} {* styling with css for the first group *}
{* Only show group header when there are clients *} {* in the group OR if the format allows us *} {* to show empty groups *} {if $format !== 2 || $group["clients"]}
{if $group["iconid"]} {$group[ {/if} {$group["name"]}
{if !$group["clients"]}
{_"ADMIN_STATUS_EMPTY_GROUP"}
{/if} {/if} {foreach $group["clients"] as $client} {include admin-status-template, iconBeforeName => false, client => $client, group => $group} {/foreach}
{/foreach}
{/if} {* STATUS_STYLE_LIST *} {if $format === 3}
{if !$data}
{_"ADMIN_STATUS_EMPTY_STATUS"}
{/if} {var $lastGroup = null} {foreach $data as $sgid => $group} {foreach $group["clients"] as $client} {* This thing detects when we are looping though a new group *} {* and before we start printing clients from it, it inserts a *} {* group separator that creates a little space between different groups *} {if $lastGroup !== $group} {* here we check if $lastGroup is not NULL *} {* this way we dont put a spacer before the first group *} {if $lastGroup}
{/if} {var $lastGroup = $group} {/if} {include admin-status-template, iconBeforeName => true, client => $client, group => $group} {/foreach} {/foreach}
{/if} {* STATUS_STYLE_LIST_ONLINE_FIRST *} {if $format === 4}
{if !$data}
{_"ADMIN_STATUS_EMPTY_STATUS"}
{/if} {foreach $data as $entry} {include admin-status-template, iconBeforeName => true, client => $entry["client"], group => $entry["group"]} {/foreach}
{/if}