## User Levels

{if $view=='view'} Add New Level

ID | Name | Active | Users | Actions
{assign var=levels value=$userquery->get_levels()} {section name=l loop=$levels}
{$levels[l].user_level_id} | {$levels[l].user_level_name} | {$levels[l].user_level_active} | {$userquery->get_level_users($levels[l].user_level_id,true)} | Edit{if $levels[l].user_level_is_default !=yes} | Remove{/if}
{sectionelse}
No Levels Were Found
{/section}

{elseif $view=='edit'}

| Edit Level Permissions |

Level Name |

{assign var='types' value=$userquery->get_level_types()} {section name=t loop=$types}

| {$types[t].user_permission_type_name} |

{assign var=perms value=$userquery->get_permissions($types[t].user_permission_type_id)}

{assign var = bgcolor value = ""} {foreach from=$perms item=perm} {if $perm.permission_id !=""}
{$perm.permission_name} {$perm.permission_desc} | {assign var="perm_code" value=$perm.permission_code} Yes No
{else}
No Permission Found
{/if} {if $bgcolor == ""} {assign var = bgcolor value = "#EEEEEE"} {else} {assign var = bgcolor value = ""} {/if} {foreachelse}
No Permission Found
{/foreach}

{/section} {if $Cbucket->plugins_perms}

| Plugins Permissions |

{assign var=perms value=$Cbucket->plugins_perms}

{assign var = bgcolor value = ""} {foreach from=$perms item=perm}
{$perm.plugin_name} {$perm.plugin_desc} | {assign var=perm_plugin_code value=$perm.plugin_code} Yes No
{if $bgcolor == ""} {assign var = bgcolor value = "#EEEEEE"} {else} {assign var = bgcolor value = ""} {/if} {foreachelse}
No Permission Found
{/foreach}

{/if}

{elseif $view=='add'}

| User Level Details |

Level Name |

{assign var='types' value=$userquery->get_level_types()} {section name=t loop=$types}

| {$types[t].user_permission_type_name} |

{assign var=perms value=$userquery->get_permissions($types[t].user_permission_type_id)}

{assign var = bgcolor value = ""} {foreach from=$perms item=perm} {if $perm.permission_id !=""}
{$perm.permission_name} {$perm.permission_desc} | Yes No
{else}
No Permission Found
{/if} {if $bgcolor == ""} {assign var = bgcolor value = "#EEEEEE"} {else} {assign var = bgcolor value = ""} {/if} {foreachelse}
No Permission Found
{/foreach}

{/section} {/if}