<commit_before>{* $Id$ *}

{strip}
{title help="Modules" admpage="module"}{tr}Admin Modules{/tr}{/title}

<div class="t_navbar margin-bottom-md">
	{button href="tiki-admin_modules.php?clear_cache=1" class="btn btn-default" _icon_name="trash" _text="{tr}Clear Cache{/tr}"}
	{if $tiki_p_edit_menu eq 'y'}
		{button href="tiki-admin_menus.php" class="btn btn-default" _icon_name="menu" _text="{tr}Admin Menus{/tr}"}
	{/if}
	{if empty($smarty.request.show_hidden_modules)}
		{button show_hidden_modules="y" class="btn btn-default" _icon_name="enable" _text="{tr}Show hidden modules{/tr}"}
	{else}
		{button show_hidden_modules="" class="btn btn-default" _icon_name="disable" _text="{tr}Hide hidden modules{/tr}"}
	{/if}
	{button href="./" _class="btn btn-default" _icon_name="disable" _text="{tr}Exit Modules{/tr}"}
	{button _text="{tr}Save{/tr}" _type="primary" class="btn btn-default" _icon_name="floppy" _id="save_modules" _ajax="n"}
</div>

{if !empty($missing_params)}
	{remarksbox type="warning" title="{tr}Modules Parameters{/tr}"}
		{tr}The following required parameters are missing:{/tr}<br/>
		{section name=ix loop=$missing_params}
			{$missing_params[ix]}
			{if !$smarty.section.ix.last},&nbsp;{/if}
		{/section}
	{/remarksbox}
{/if}

{remarksbox type="note" title="{tr}Modules{/tr}" icon="star"}
	<ul>
		<li>{tr}Drag the modules around to re-order then click save when ready{/tr}</li>
		<li>{tr}Double click them to edit{/tr}</li>
		<li>{tr}Modules with "position: absolute" in their style can be dragged in to position{/tr}</li>
		<li>{tr}New modules can be dragged from the "All Modules" tab{/tr}</li>
	</ul>
	<p>
		<strong>{tr}Note:{/tr}</strong> {tr}Links and buttons in modules, apart from the Application Menu, have been deliberately disabled on this page to make drag and drop more reliable. Click here to return <a href="./">HOME</a>{/tr}<br>
		<strong><em>{tr}More info here{/tr}</em></strong> {icon name="help" href="http://dev.tiki.org/Modules+Revamp" class=""}
	</p>

{/remarksbox}

{tabset}

	{tab name="{tr}Assigned modules{/tr}"}
		{if $prefs.feature_tabs neq 'y'}
			<legend class="heading">
				<span>
					{tr}Assign/Edit modules{/tr}
				</span>
			</legend>
		{/if}
		<h2>{tr}Assigned Modules{/tr}</h2>
		<div class="margin-bottom-md">
			{button href="tiki-admin_modules.php?edit_assign=0#content_admin_modules1-2" _text="{tr}Add module{/tr}"}
		</div>

		<div id="assigned_modules">
			{tabset}
				{foreach from=$module_zone_list key=zone_initial item=zone_info}
					{tab name=$zone_info.name|capitalize}
						<div id="{$zone_info.id}_modules" class="table-responsive">
							<div>
								<table class="table normal table-striped table-hover" id="assigned_zone_{$zone_initial}">
									<tr>
										<th>{tr}Name{/tr}</th>
										<th>{tr}Order{/tr}</th>
										<th>{tr}Cache{/tr}</th>
										<th>{tr}Rows{/tr}</th>
										<th>{tr}Parameters{/tr}</th>
										<th>{tr}Groups{/tr}</th>
										<th></th>
									</tr>

									{foreach from=$assigned_modules[$zone_initial] item=module name=assigned_foreach}
										<tr>
											<td>{$module.name|escape}</td>
											<td>{$module.ord}</td>
											<td>{$module.cache_time}</td>
											<td>{$module.rows}</td>
											<td style="font-size:smaller;">{$module.params_presentable}</td>
											<td style="font-size:smaller;">{$module.module_groups}</td>
											<td>
												{capture name=module_actions}
													{strip}
														{if !$smarty.section.user.first}
															<a href="tiki-admin_modules.php?modup={$module.moduleId}">
																{icon name="up" _menu_text='y' _menu_icon='y' alt="{tr}Move up{/tr}"}
															</a>
														{/if}
														{if !$smarty.section.user.last}
															<a href="tiki-admin_modules.php?moddown={$module.moduleId}">
																{icon name="down" _menu_text='y' _menu_icon='y' alt="{tr}Move down{/tr}"}
															</a>
														{/if}
														<a href="tiki-admin_modules.php?edit_assign={$module.moduleId}&cookietab=2#content_admin_modules1-2">
															{icon name='edit' _menu_text='y' _menu_icon='y' alt="{tr}Edit{/tr}"}
														</a>
														<a href="tiki-admin_modules.php?unassign={$module.moduleId}">
															{icon name='remove' _menu_text='y' _menu_icon='y' alt="{tr}Unassign{/tr}"}
														</a>
													{/strip}
												{/capture}
												<a class="tips"
												   title="{tr}Actions{/tr}"
												   href="#" {popup trigger="click" fullhtml="1" center=true text=$smarty.capture.module_actions|escape:"javascript"|escape:"html"}
												   style="padding:0; margin:0; border:0"
														>
													{icon name='wrench'}
												</a>
											</td>
										</tr>
									{foreachelse}
										{norecords _colspan=7}
									{/foreach}
								</table>
							</div>
						</div>
					{/tab}
				{/foreach}
			{/tabset}
		</div>
		<form method="post" action="#">
			<input id="module-order" type="hidden" name="module-order" value="">
		</form>
	{/tab}
	{if isset($smarty.request.edit_assign) or $preview eq "y"}
		{tab name="{tr}Edit module{/tr}"}
			<a name="assign"></a>
			{if $assign_name eq ''}
				<h2>{tr}Assign new module{/tr}</h2>
			{else}
				<h2>{tr}Edit this assigned module:{/tr} {$assign_name}</h2>
			{/if}

			{if $preview eq 'y'}
				<h3>{tr}Preview{/tr}</h3>
				{$preview_data}
			{/if}
			<form method="post" action="tiki-admin_modules.php#content_admin_modules1-2">
				{* on the initial selection of a new module, reload the page to the #assign anchor *}
				{if !empty($info.moduleId)}
					<input type="hidden" name="moduleId" value="{$info.moduleId}">
				{elseif !empty($moduleId)}
					<input type="hidden" name="moduleId" value="{$moduleId}">
				{/if}
				<fieldset>
						{* because changing the module name will auto-submit the form, no reason to display these fields until a module is selected *}
						{include file='admin_modules_form.tpl'}
					{if empty($assign_name)}<commit_msg>[FIX] set back to cookietab after Jonny's fix (r54652) - I think this is the only place where I changed before asking<commit_after>{* $Id$ *}

{strip}
{title help="Modules" admpage="module"}{tr}Admin Modules{/tr}{/title}

<div class="t_navbar margin-bottom-md">
	{button href="tiki-admin_modules.php?clear_cache=1" class="btn btn-default" _icon_name="trash" _text="{tr}Clear Cache{/tr}"}
	{if $tiki_p_edit_menu eq 'y'}
		{button href="tiki-admin_menus.php" class="btn btn-default" _icon_name="menu" _text="{tr}Admin Menus{/tr}"}
	{/if}
	{if empty($smarty.request.show_hidden_modules)}
		{button show_hidden_modules="y" class="btn btn-default" _icon_name="enable" _text="{tr}Show hidden modules{/tr}"}
	{else}
		{button show_hidden_modules="" class="btn btn-default" _icon_name="disable" _text="{tr}Hide hidden modules{/tr}"}
	{/if}
	{button href="./" _class="btn btn-default" _icon_name="disable" _text="{tr}Exit Modules{/tr}"}
	{button _text="{tr}Save{/tr}" _type="primary" class="btn btn-default" _icon_name="floppy" _id="save_modules" _ajax="n"}
</div>

{if !empty($missing_params)}
	{remarksbox type="warning" title="{tr}Modules Parameters{/tr}"}
		{tr}The following required parameters are missing:{/tr}<br/>
		{section name=ix loop=$missing_params}
			{$missing_params[ix]}
			{if !$smarty.section.ix.last},&nbsp;{/if}
		{/section}
	{/remarksbox}
{/if}

{remarksbox type="note" title="{tr}Modules{/tr}" icon="star"}
	<ul>
		<li>{tr}Drag the modules around to re-order then click save when ready{/tr}</li>
		<li>{tr}Double click them to edit{/tr}</li>
		<li>{tr}Modules with "position: absolute" in their style can be dragged in to position{/tr}</li>
		<li>{tr}New modules can be dragged from the "All Modules" tab{/tr}</li>
	</ul>
	<p>
		<strong>{tr}Note:{/tr}</strong> {tr}Links and buttons in modules, apart from the Application Menu, have been deliberately disabled on this page to make drag and drop more reliable. Click here to return <a href="./">HOME</a>{/tr}<br>
		<strong><em>{tr}More info here{/tr}</em></strong> {icon name="help" href="http://dev.tiki.org/Modules+Revamp" class=""}
	</p>

{/remarksbox}

{tabset}

	{tab name="{tr}Assigned modules{/tr}"}
		{if $prefs.feature_tabs neq 'y'}
			<legend class="heading">
				<span>
					{tr}Assign/Edit modules{/tr}
				</span>
			</legend>
		{/if}
		<h2>{tr}Assigned Modules{/tr}</h2>
		<div class="margin-bottom-md">
			{button edit_assign=0 cookietab=2 _auto_args="edit_assign,cookietab" _text="{tr}Add module{/tr}"}
		</div>

		<div id="assigned_modules">
			{tabset}
				{foreach from=$module_zone_list key=zone_initial item=zone_info}
					{tab name=$zone_info.name|capitalize}
						<div id="{$zone_info.id}_modules" class="table-responsive">
							<div>
								<table class="table normal table-striped table-hover" id="assigned_zone_{$zone_initial}">
									<tr>
										<th>{tr}Name{/tr}</th>
										<th>{tr}Order{/tr}</th>
										<th>{tr}Cache{/tr}</th>
										<th>{tr}Rows{/tr}</th>
										<th>{tr}Parameters{/tr}</th>
										<th>{tr}Groups{/tr}</th>
										<th></th>
									</tr>

									{foreach from=$assigned_modules[$zone_initial] item=module name=assigned_foreach}
										<tr>
											<td>{$module.name|escape}</td>
											<td>{$module.ord}</td>
											<td>{$module.cache_time}</td>
											<td>{$module.rows}</td>
											<td style="font-size:smaller;">{$module.params_presentable}</td>
											<td style="font-size:smaller;">{$module.module_groups}</td>
											<td>
												{capture name=module_actions}
													{strip}
														{if !$smarty.section.user.first}
															<a href="tiki-admin_modules.php?modup={$module.moduleId}">
																{icon name="up" _menu_text='y' _menu_icon='y' alt="{tr}Move up{/tr}"}
															</a>
														{/if}
														{if !$smarty.section.user.last}
															<a href="tiki-admin_modules.php?moddown={$module.moduleId}">
																{icon name="down" _menu_text='y' _menu_icon='y' alt="{tr}Move down{/tr}"}
															</a>
														{/if}
														<a href="tiki-admin_modules.php?edit_assign={$module.moduleId}&cookietab=2#content_admin_modules1-2">
															{icon name='edit' _menu_text='y' _menu_icon='y' alt="{tr}Edit{/tr}"}
														</a>
														<a href="tiki-admin_modules.php?unassign={$module.moduleId}">
															{icon name='remove' _menu_text='y' _menu_icon='y' alt="{tr}Unassign{/tr}"}
														</a>
													{/strip}
												{/capture}
												<a class="tips"
												   title="{tr}Actions{/tr}"
												   href="#" {popup trigger="click" fullhtml="1" center=true text=$smarty.capture.module_actions|escape:"javascript"|escape:"html"}
												   style="padding:0; margin:0; border:0"
														>
													{icon name='wrench'}
												</a>
											</td>
										</tr>
									{foreachelse}
										{norecords _colspan=7}
									{/foreach}
								</table>
							</div>
						</div>
					{/tab}
				{/foreach}
			{/tabset}
		</div>
		<form method="post" action="#">
			<input id="module-order" type="hidden" name="module-order" value="">
		</form>
	{/tab}
	{if isset($smarty.request.edit_assign) or $preview eq "y"}
		{tab name="{tr}Edit module{/tr}"}
			<a name="assign"></a>
			{if $assign_name eq ''}
				<h2>{tr}Assign new module{/tr}</h2>
			{else}
				<h2>{tr}Edit this assigned module:{/tr} {$assign_name}</h2>
			{/if}

			{if $preview eq 'y'}
				<h3>{tr}Preview{/tr}</h3>
				{$preview_data}
			{/if}
			<form method="post" action="tiki-admin_modules.php{if empty($assign_name)}?cookietab=2#assign{/if}">
				{* on the initial selection of a new module, reload the page to the #assign anchor *}
				{if !empty($info.moduleId)}
					<input type="hidden" name="moduleId" value="{$info.moduleId}">
				{elseif !empty($moduleId)}
					<input type="hidden" name="moduleId" value="{$moduleId}">
				{/if}
				<fieldset>
						{* because changing the module name will auto-submit the form, no reason to display these fields until a module is selected *}
						{include file='admin_modules_form.tpl'}
					{if empty($assign_name)}
{'fraction_non_alphanumeric': 0.1859548254620123, 'fraction_numerical': 0.003860369609856263, 'mean_word_length': 3.1288572397422856, 'pattern_counts': {'":': 0, '<': 197, '<?xml version=': 0, '>': 197, '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': '906833', 'n_tokens_mistral': 5756, 'n_tokens_neox': 4344, 'n_words': 840}