1{* $Id$ *}
2{title help="Theme Control"}{tr}Theme Control{/tr}: {tr}Categories{/tr}{/title}
3<div class="t_navbar btn-group mb-4">
4	{button href="tiki-theme_control_objects.php" class="btn btn-primary" _text="{tr}Control by Objects{/tr}"}
5	{button href="tiki-theme_control_sections.php" class="btn btn-primary" _text="{tr}Control by Sections{/tr}"}
6</div>
7<h2>{tr}Assign themes to categories{/tr}</h2>
8<form action="tiki-theme_control.php" method="post" class="mb-2" role="form">
9	<div class="form-group row">
10		<div class="col-sm-5">
11			<label for="categoryId" class="mr-2">{tr}Category{/tr}</label>
12			<select name="categoryId" class="form-control form-control-sm mr-2">
13				{foreach from=$categories key=categoryId item=category}
14					<option value="{$categoryId|escape}">
15						{$category.name|escape} (Id:{$categoryId})
16					</option>
17				{/foreach}
18			</select>
19		</div>
20		<div class="col-sm-5">
21			<label for="theme" class="mr-2">{tr}Theme{/tr}</label>
22			<select name="theme" class="form-control form-control-sm mr-2">
23				{foreach from=$themes key=theme item=theme_name}
24					<option value="{$theme|escape}">{$theme_name}</option>
25				{/foreach}
26			</select>
27		</div>
28	</div>
29	<div class="col-sm-12">
30		<input type="submit" class="btn btn-primary btn-sm" name="assign" value="{tr}Assign{/tr}">
31	</div>
32</form>
33<h2>{tr}Assigned categories{/tr}</h2>
34{include file='find.tpl'}
35<form action="tiki-theme_control.php" method="post" role="form" class="form">
36	<div class="table-responsive themecat-table">
37		<table class="table">
38			<tr>
39				<th>
40					<button type="submit" class="btn btn-danger btn-sm" name="delete" title="{tr}Delete selected{/tr}" {if !$channels}disabled{/if}>
41						{icon name="delete"}
42					</button>
43				</th>
44				<th>
45					<a href="tiki-theme_control.php?offset={$offset}&amp;sort_mode={if $sort_mode eq 'name_desc'}name_asc{else}name_desc{/if}">
46						{tr}Category{/tr}
47					</a>
48				</th>
49				<th>
50					<a href="tiki-theme_control.php?offset={$offset}&amp;sort_mode={if $sort_mode eq 'theme_desc'}theme_asc{else}theme_desc{/if}">
51						{tr}Theme{/tr}
52					</a>
53				</th>
54			</tr>
55			{section name=user loop=$channels}
56				<tr>
57					<td class="checkbox-cell">
58						<div class="form-check">
59							<input type="checkbox" name="categoryIds[{$channels[user].categId}]">
60						</div>
61					</td>
62					<td class="text">
63						{$channels[user].name|escape} (Id:{$channels[user].categId})
64					</td>
65					<td class="text">
66						{$channels[user].theme}
67					</td>
68				</tr>
69			{/section}
70		</table>
71	</div>
72</form>
73{pagination_links cant=$cant_pages step=$prefs.maxRecords offset=$offset}{/pagination_links}
74