<commit_before>{title help="Menus"}{tr}Admin Menus{/tr}{/title}

{if $tiki_p_admin eq 'y'}
	<div class="navbar">
		{button href="tiki-admin_modules.php" _text="{tr}Admin Modules{/tr}"}
	</div>
{/if}

{tabset name="admin_menus"}
{tab name="{tr}Menus{/tr}"}
{include file='find.tpl'}
<table class="normal">
<tr>
<th>{self_link _sort_arg='sort_mode' _sort_field='menuId'}{tr}ID{/tr}{/self_link}</th>
<th>{self_link _sort_arg='sort_mode' _sort_field='name'}{tr}Name{/tr}{/self_link}</th>
<th>{self_link _sort_arg='sort_mode' _sort_field='type'}{tr}Type{/tr}{/self_link}</th>
<th>{tr}Options{/tr}</th>
<th>{tr}Action{/tr}</th>
</tr>
{cycle values="odd,even" print=false}
{section name=user loop=$channels}
<tr>
<td class="{cycle advance=false}">{$channels[user].menuId}</td>
<td class="{cycle advance=false}">
{self_link menuId=$channels[user].menuId cookietab="2" _title="{tr}Edit{/tr}"} {$channels[user].name}{/self_link}
<br />{$channels[user].description}</td>
<td class="{cycle advance=false}" style="text-align:center">{$channels[user].type}</td>
<td class="{cycle advance=false}" style="text-align:right;">{$channels[user].options}&nbsp;</td>
<td class="{cycle advance=true}">
{self_link menuId=$channels[user].menuId cookietab="2" _title="{tr}Edit{/tr}"}{icon _id='page_edit'}{/self_link}
{if $tiki_p_edit_menu_option eq 'y'}	<a class="link" href="tiki-admin_menu_options.php?menuId={$channels[user].menuId}" title="{tr}Configure/Options{/tr}">{icon _id='table' alt='{tr}Configure/Options{/tr}'}</a>{/if}
{if $channels[user].individual eq 'y'}<a title="{tr}Active Permissions{/tr}" class="link" href="tiki-objectpermissions.php?objectName={$channels[user].name|escape:"url"}&amp;objectType=menus&amp;permType=menus&amp;objectId={$channels[user].menuId}">
{icon _id='key_active' alt="{tr}Active Permissions{/tr}"}</a>{else}
<a title="{tr}Permissions{/tr}" class="link" href="tiki-objectpermissions.php?objectName={$channels[user].name|escape:"url"}&amp;objectType=menus&amp;permType=menus&amp;objectId={$channels[user].menuId}">
{icon _id='key' alt="{tr}Permissions{/tr}"}</a>{/if}
&nbsp;
{* strange validation doesnot work with ajax FIXME *}
{self_link _ajax='n' remove=$channels[user].menuId _title="{tr}Delete{/tr}"}{icon _id='cross' alt='{tr}Delete{/tr}'}{/self_link}
</td>
</tr>
{sectionelse}
<tr><td class="odd" colspan="5">No records found.</td></tr>
{/section}
</table>
{pagination_links cant=$cant step=$maxRecords offset=$offset }{/pagination_links} 
{/tab}
{tab name="{tr}Create/Edit Menu{/tr}"}
{if $menuId > 0}
	<h2>{tr}Edit this Menu:{/tr} {$info.name}</h2>
	{button href="tiki-admin_menus.php" _text="{tr}Create new Menu{/tr}"}<commit_msg>[UI] The most common action for a menu is not to change the menu settings, but to edit the menu items. So change the most obvious link to be more intuitive (seen the error in training sessions)<commit_after>{title help="Menus"}{tr}Admin Menus{/tr}{/title}

{if $tiki_p_admin eq 'y'}
	<div class="navbar">
		{button href="tiki-admin_modules.php" _text="{tr}Admin Modules{/tr}"}
	</div>
{/if}

{tabset name="admin_menus"}
{tab name="{tr}Menus{/tr}"}
{include file='find.tpl'}
<table class="normal">
<tr>
<th>{self_link _sort_arg='sort_mode' _sort_field='menuId'}{tr}ID{/tr}{/self_link}</th>
<th>{self_link _sort_arg='sort_mode' _sort_field='name'}{tr}Name{/tr}{/self_link}</th>
<th>{self_link _sort_arg='sort_mode' _sort_field='type'}{tr}Type{/tr}{/self_link}</th>
<th>{tr}Options{/tr}</th>
<th>{tr}Action{/tr}</th>
</tr>
{cycle values="odd,even" print=false}
{section name=user loop=$channels}
<tr>
<td class="{cycle advance=false}">{$channels[user].menuId}</td>
<td class="{cycle advance=false}">
{if $tiki_p_edit_menu_option eq 'y'}	<a class="link" href="tiki-admin_menu_options.php?menuId={$channels[user].menuId}" title="{tr}Configure/Options{/tr}">{$channels[user].name}</a>{/if}
<br />{$channels[user].description}</td>
<td class="{cycle advance=false}" style="text-align:center">{$channels[user].type}</td>
<td class="{cycle advance=false}" style="text-align:right;">{$channels[user].options}&nbsp;</td>
<td class="{cycle advance=true}">
{self_link menuId=$channels[user].menuId cookietab="2" _title="{tr}Edit{/tr}"}{icon _id='page_edit'}{/self_link}
{if $tiki_p_edit_menu_option eq 'y'}	<a class="link" href="tiki-admin_menu_options.php?menuId={$channels[user].menuId}" title="{tr}Configure/Options{/tr}">{icon _id='table' alt='{tr}Configure/Options{/tr}'}</a>{/if}
{if $channels[user].individual eq 'y'}<a title="{tr}Active Permissions{/tr}" class="link" href="tiki-objectpermissions.php?objectName={$channels[user].name|escape:"url"}&amp;objectType=menus&amp;permType=menus&amp;objectId={$channels[user].menuId}">
{icon _id='key_active' alt="{tr}Active Permissions{/tr}"}</a>{else}
<a title="{tr}Permissions{/tr}" class="link" href="tiki-objectpermissions.php?objectName={$channels[user].name|escape:"url"}&amp;objectType=menus&amp;permType=menus&amp;objectId={$channels[user].menuId}">
{icon _id='key' alt="{tr}Permissions{/tr}"}</a>{/if}
&nbsp;
{* strange validation doesnot work with ajax FIXME *}
{self_link _ajax='n' remove=$channels[user].menuId _title="{tr}Delete{/tr}"}{icon _id='cross' alt='{tr}Delete{/tr}'}{/self_link}
</td>
</tr>
{sectionelse}
<tr><td class="odd" colspan="5">No records found.</td></tr>
{/section}
</table>
{pagination_links cant=$cant step=$maxRecords offset=$offset }{/pagination_links} 
{/tab}
{tab name="{tr}Create/Edit Menu{/tr}"}
{if $menuId > 0}
	<h2>{tr}Edit this Menu:{/tr} {$info.name}</h2>
	{button href="tiki-admin_menus.php" _text="{tr}Create new Menu{/tr}"}
{'fraction_non_alphanumeric': 0.23306379155435758, 'fraction_numerical': 0.001976639712488769, 'mean_word_length': 9.442776735459661, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 0, '>': 89, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1661138', 'n_tokens_mistral': 2163, 'n_tokens_neox': 2127, 'n_words': 330}