{foreach from=$security_list item=key key=curr}
    {assign var="namekey" value="basic_`$curr`"}
    {assign var="securitykey" value="security_`$key`"}
    {assign var="securitykey_detail" value="secd_`$key`"}
    {if isset($staff->$securitykey)}
        {assign var="securityvalue" value=$staff->$securitykey}
    {/if}
    {if isset($staff->$securitykey_detail)}
        {assign var="securityvalue_detail" value=$staff->$securitykey_detail}
    {else}
        {assign var="securityvalue_detail" value=0}
    {/if}
    {if $securityvalue===null}
        {assign var="securityvalue" value=99}
    {/if}
    {if $staffadmin_rights->$curr eq 100}
        {assign var="securityvalue" value=100}
    {/if}{*
        Create title keys
    *}
    {assign var="titlekey" value="rights_r`$securityvalue`"}
    {if $securityvalue_detail>0}
        {assign var="titlekey_detail" value="rights_d`$securityvalue_detail`_`$curr`"}
    {else}
        {$titlekey_detail=''}
    {/if}

    {if isset($inline_mode) && $inline_mode}
        <span style="display: inline-block; margin-left: 7px; margin-right: 7px; min-width: 107px;">
            <img src="{site_url url="images/14x14/right`$securityvalue`{if $securityvalue_detail>0}_det{/if}.png"}" 
                alt="{$i.$titlekey} {if $titlekey_detail neq ''}- {$i.$titlekey_detail}{/if}"
                title="{$i.$titlekey} {if $titlekey_detail neq ''}- {$i.$titlekey_detail}{/if} ({$curr})"/>
            {if isset($i.$namekey)}{$i.$namekey}{else}{$key}{/if}
        </span>
    {else}
        <td title="{$staff->fullname|truncate:50|escape:'html'} - {if isset($i.$namekey)}{$i.$namekey}{else}{$key}{/if}"
            style="text-align:center;">
            <img src="{site_url url="images/14x14/right`$securityvalue`{if $securityvalue_detail>0}_det{/if}.png"}" 
                alt="{$i.$titlekey} {if $titlekey_detail neq ''}- {$i.$titlekey_detail}{/if}"
                title="{$i.$titlekey} {if $titlekey_detail neq ''}- {$i.$titlekey_detail}{/if} ({$curr})" style="vertical-align:middle;"/>
        </td>
    {/if}
{/foreach}
