## 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_details.user_level_name|form_val} Level Permissions

Level Name
{assign var='types' value=$userquery->get_level_types()} {section name=t loop=$types} {assign var=perms value=$userquery->get_permissions($types[t].user_permission_type_id)} {if $types[t].user_permission_type_name == 'Viewing Permission'}

## Viewing Permission

{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} {foreachelse} No Permission Found {/foreach}
{/if} {/section}
{assign var='types' value=$userquery->get_level_types()} {section name=t loop=$types} {assign var=perms value=$userquery->get_permissions($types[t].user_permission_type_id)} {if $types[t].user_permission_type_name == 'Uploading Permission'}

## Uploading Permission

{foreach from=$perms item=perm} {if $perm.permission_id !=""} {$perm.permission_name} {$perm.permission_desc} {assign var="perm_code" value=$perm.permission_code} {assign var=perm_plugin_code value=$perm.plugin_code} Yes No {else}
No Permission Found
{/if} {foreachelse}
No Permission Found
{/foreach}
{/if} {/section}
{assign var='types' value=$userquery->get_level_types()} {section name=t loop=$types} {assign var=perms value=$userquery->get_permissions($types[t].user_permission_type_id)} {if $types[t].user_permission_type_name == 'Administrator Permission'}

## Administrator Permission

{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} {foreachelse}
No Permission Found
{/foreach}
{/if} {/section}
{assign var='types' value=$userquery->get_level_types()} {section name=t loop=$types} {assign var=perms value=$userquery->get_permissions($types[t].user_permission_type_id)} {if $types[t].user_permission_type_name == 'General Permission'}

## General Permission

{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} {foreachelse}
No Permission Found
{/foreach}
{/if} {/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
{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} {foreachelse}
No Permission Found
{/foreach}
{/section} {/if}