1{title help="UserAssignedModules"}{tr}User assigned modules{/tr}{/title}
2
3{include file='tiki-mytiki_bar.tpl'}
4{remarksbox type="info" title="{tr}Note{/tr}"}
5	{tr}Go{/tr} <a href="tiki-admin_modules.php">{tr}here{/tr}</a> {tr}to assign modules, which will make them available for creating a custom order on this page.{/tr}
6{/remarksbox}
7
8<div class="t_navbar">
9	<form action="tiki-user_assigned_modules.php" method="post">
10		{ticket}
11		<input type="hidden" name="recreate" value="1">
12		<button type="submit" name="recreate" value="1" class="btn btn-primary">
13			{tr}Restore defaults{/tr}
14		</button>
15	</form>
16</div>
17
18<h2>{tr}User assigned modules{/tr}</h2>
19<table >
20	<tr>
21		{if $prefs.feature_left_column ne 'n' || count($modules_l) > 0}
22			<td >
23				<b>{tr}Left column{/tr}</b>
24				{if $prefs.feature_left_column eq 'n' and count($modules_l) > 0}<br><span class="highlight">{tr}The column is disabled{/tr}</span>{/if}
25			</td>
26		{/if}
27		{if $prefs.feature_right_column ne 'n' || count($modules_r) > 0}
28			<td >
29				<b>{tr}Right column{/tr}</b>
30				{if $prefs.feature_right_column eq 'n' and count($modules_r) > 0}<br><span class="highlight">{tr}The column is disabled{/tr}</span>{/if}
31			</td>
32		{/if}
33	</tr>
34	<tr>
35		<!-- left column -->
36		{if $prefs.feature_left_column ne 'n' || count($modules_l) > 0}
37			<td style="vertical-align: top">
38				<table class="table table-striped table-hover">
39					<tr>
40						<th>{tr}#{/tr}</th>
41						<th>{tr}Name{/tr}</th>
42						<th></th>
43					</tr>
44
45					{section name=ix loop=$modules_l}
46						<tr>
47							<td>{$modules_l[ix].ord}</td>
48							<td>{$modules_l[ix].name}</td>
49							<td>
50								<form action="tiki-user_assigned_modules.php" method="post">
51									{ticket}
52									<input type="hidden" name="redirect" value="1">
53									<button
54										type="submit"
55										name="up"
56										value="{$modules_l[ix].moduleId}"
57										class="tips btn btn-link p-0"
58										title=":{tr}Move module up{/tr}"
59									>
60										{icon name="up"}
61									</button>
62									<button
63										type="submit"
64										name="down"
65										value="{$modules_l[ix].moduleId}"
66										class="tips btn btn-link p-0"
67										title=":{tr}Move module down{/tr}"
68									>
69										{icon name="down"}
70									</button>
71									{if $prefs.feature_right_column ne 'n'}
72										<button
73											type="submit"
74											name="right"
75											value="{$modules_l[ix].moduleId}"
76											class="tips btn btn-link p-0"
77											title=":{tr}Move to right side{/tr}"
78										>
79											{icon name="next"}
80										</button>
81									{/if}
82									{if $modules_r[ix].name ne 'application_menu' and $modules_r[ix].name ne 'login_box' and $modules_r[ix].type ne 'P'}
83										<button
84											type="submit"
85											name="unassign"
86											value="{$modules_l[ix].moduleId}"
87											class="tips btn btn-link p-0"
88											title=":{tr}Unassign{/tr}"
89										>
90											{icon name="remove"}
91										</button>
92									{/if}
93								</form>
94							</td>
95						</tr>
96					{/section}
97				</table>
98			</td>
99		{/if}
100		<!-- right column -->
101		{if $prefs.feature_right_column ne 'n' || count($modules_r) > 0}
102			<td style="vertical-align: top">
103				<table class="table table-striped table-hover">
104					<tr>
105						<th>{tr}#{/tr}</th>
106						<th>{tr}Name{/tr}</th>
107						<th></th>
108					</tr>
109
110					{section name=ix loop=$modules_r}
111						<tr>
112							<td>{$modules_r[ix].ord}</td>
113							<td>{$modules_r[ix].name}</td>
114							<td>
115								<form action="tiki-user_assigned_modules.php" method="post">
116									{ticket}
117									<input type="hidden" name="redirect" value="1">
118									<button
119										type="submit"
120										name="up"
121										value="{$modules_r[ix].moduleId}"
122										class="tips btn btn-link p-0"
123										title=":{tr}Move module up{/tr}"
124									>
125										{icon name="up"}
126									</button>
127									<button
128										type="submit"
129										name="down"
130										value="{$modules_r[ix].moduleId}"
131										class="tips btn btn-link p-0"
132										title=":{tr}Move module down{/tr}"
133									>
134										{icon name="down"}
135									</button>
136									{if $prefs.feature_left_column ne 'n'}
137										<button
138											type="submit"
139											name="left"
140											value="{$modules_r[ix].moduleId}"
141											class="tips btn btn-link p-0"
142											title=":{tr}Move to left side{/tr}"
143										>
144											{icon name="previous"}
145										</button>
146									{/if}
147									{if $modules_r[ix].name ne 'application_menu' and $modules_r[ix].name ne 'login_box' and $modules_r[ix].type ne 'P'}
148										<button
149											type="submit"
150											name="unassign"
151											value="{$modules_r[ix].moduleId}"
152											class="tips btn btn-link p-0"
153											title=":{tr}Unassign{/tr}"
154										>
155											{icon name="remove"}
156										</button>
157									{/if}
158								</form>
159							</td>
160						</tr>
161					{/section}
162				</table>
163			</td>
164		{/if}
165	</tr>
166</table>
167
168{if $canassign eq 'y'}
169	<h2>{tr}Assign module{/tr}</h2>
170	<form action="tiki-user_assigned_modules.php" method="post" class="form-horizontal">
171		{ticket}
172		<div class="form-group row">
173			<label class="col-form-label col-sm-4" for="module">{tr}Module{/tr}</label>
174			<div class="col-sm-8">
175				<select name="module" class="form-control form-control-sm">
176					{section name=ix loop=$assignables}
177						<option value="{$assignables[ix].moduleId|escape}">{$assignables[ix].name}</option>
178					{/section}
179				</select>
180			</div>
181		</div>
182		<div class="form-group row">
183			<label class="col-form-label col-sm-4" for="position">{tr}Column{/tr}</label>
184			<div class="col-sm-8">
185				<select name="position" class="form-control form-control-sm">
186					{if $prefs.feature_left_column ne 'n'}<option value="left">{tr}Left{/tr}</option>{/if}
187					{if $prefs.feature_right_column ne 'n'}<option value="right">{tr}Right{/tr}</option>{/if}
188				</select>
189			</div>
190		</div>
191		<div class="form-group row">
192			<label class="col-form-label col-sm-4" for="order">{tr}Order{/tr}</label>
193			<div class="col-sm-8">
194				<select name="order" class="form-control form-control-sm">
195					{section name=ix loop=$orders}
196						<option value="{$orders[ix]|escape}">{$orders[ix]}</option>
197					{/section}
198				</select>
199			</div>
200		</div>
201		<div class="form-group row">
202			<div class="offset-sm-4 col-sm-8">
203				<input type="submit" class="btn btn-primary" name="assign" value="{tr}Assign{/tr}">
204			</div>
205		</div>
206	</form>
207{/if}
208