1{* $Id$ *}
2{title admpage="articles" url="tiki-article_types.php" help=Articles}{tr}Article Types{/tr}{/title}
3<div class="t_navbar mb-4">
4	{if $tiki_p_admin eq 'y' or $tiki_p_admin_cms eq 'y'}
5		{button href="tiki-list_articles.php" _type="link" _icon_name="list" _text="{tr}List Articles{/tr}"}
6		{button href="tiki-admin_topics.php" _type="link" _icon_name="flag" _text="{tr}Article Topics{/tr}"}
7	{/if}
8</div>
9<form enctype="multipart/form-data" action="tiki-article_types.php" method="post" role="form" class="form">
10	<h2>{tr}Add Type{/tr}</h2>
11		<div class="form-group row mx-0">
12			<div class="input-group">
13				<input type="text" name="new_type" class="form-control" placeholder="{tr}Add article type{/tr}...">
14				<div class="input-group-append">
15					<button type="submit" class="btn btn-secondary" name="add_type">{tr}Add{/tr}</button>
16				</div>
17			</div>
18		</div>
19	<h2>{tr}Types{/tr}</h2>
20	{section name=user loop=$types}
21		<h3>{tr}{$types[user].type|escape}{/tr}</h3>
22		<a class="link" href="tiki-view_articles.php?type={$types[user].type|escape:url}">{tr}View articles with this type{/tr}</a>
23			<div class="table-responsive article-types mb-4">
24				<table class="table table-striped table-hover">
25				<tr>
26					<th>{tr}Articles{/tr}</th>
27					<th>{tr}Author rating{/tr}</th>
28					<th>{tr}Show before publish date{/tr}</th>
29					<th>{tr}Show after expire date{/tr}</th>
30					<th>{tr}Heading only{/tr}</th>
31					<th>{tr}Comments{/tr}</th>
32					<th>{tr}Comment can rate article{/tr}</th>
33					<th>{tr}Show image{/tr}</th>
34					<th>{tr}Show profile picture{/tr}</th>
35					<th>{tr}Show author{/tr}</th>
36					<th>{tr}Show publish date{/tr}</th>
37				</tr>
38				<input type="hidden" name="type_array[{$types[user].type|escape}]">
39				<tr>
40					<td class="integer">{$types[user].article_cnt}</td>
41					<td class="checkbox-cell">
42						<div class="form-check">
43							<input type="checkbox" class="form-check-input" name="use_ratings[{$types[user].type|escape}]" {if $types[user].use_ratings eq 'y'}checked="checked"{/if}>
44						</div>
45					</td>
46					<td class="checkbox-cell">
47						<div class="form-check">
48							<input type="checkbox" class="form-check-input" name="show_pre_publ[{$types[user].type|escape}]" {if $types[user].show_pre_publ eq 'y'}checked="checked"{/if}>
49						</div>
50					</td>
51					<td class="checkbox-cell">
52						<div class="form-check">
53							<input type="checkbox" class="form-check-input" name="show_post_expire[{$types[user].type|escape}]" {if $types[user].show_post_expire eq 'y'}checked="checked"{/if}>
54						</div>
55					</td>
56					<td class="checkbox-cell">
57						<div class="form-check">
58							<input type="checkbox" class="form-check-input" name="heading_only[{$types[user].type|escape}]" {if $types[user].heading_only eq 'y'}checked="checked"{/if}>
59						</div>
60					</td>
61					<td class="checkbox-cell">
62						<div class="form-check">
63							<input type="checkbox" class="form-check-input" name="allow_comments[{$types[user].type|escape}]" {if $types[user].allow_comments eq 'y'}checked="checked"{/if}>
64						</div>
65					</td>
66					<td class="checkbox-cell">
67						<div class="form-check">
68							<input type="checkbox" class="form-check-input" name="comment_can_rate_article[{$types[user].type|escape}]" {if $types[user].comment_can_rate_article eq 'y'}checked="checked"{/if}>
69						</div>
70					</td>
71					<td class="checkbox-cell">
72						<div class="form-check">
73							<input type="checkbox" class="form-check-input" name="show_image[{$types[user].type|escape}]" {if $types[user].show_image eq 'y'}checked="checked"{/if}>
74						</div>
75					</td>
76					<td class="checkbox-cell">
77						<div class="form-check">
78							<input type="checkbox" class="form-check-input" name="show_avatar[{$types[user].type|escape}]" {if $types[user].show_avatar eq 'y'}checked="checked"{/if}>
79						</div>
80					</td>
81					<td class="checkbox-cell">
82						<div class="form-check">
83							<input type="checkbox" class="form-check-input" name="show_author[{$types[user].type|escape}]" {if $types[user].show_author eq 'y'}checked="checked"{/if}>
84						</div>
85					</td>
86					<td class="checkbox-cell">
87						<div class="form-check">
88							<input type="checkbox" class="form-check-input" name="show_pubdate[{$types[user].type|escape}]" {if $types[user].show_pubdate eq 'y'}checked="checked"{/if}>
89						</div>
90					</td>
91				</tr>
92				<tr>
93					<th>{tr}Show expire date{/tr}</th>
94					<th>{tr}Show reads{/tr}</th>
95					<th>{tr}Show size{/tr}</th>
96					<th>{tr}Show topline{/tr}</th>
97					<th>{tr}Show subtitle{/tr}</th>
98					<th>{tr}Show source{/tr}</th>
99					<th>{tr}Show image caption{/tr}</th>
100					<th>{tr}Creator can edit{/tr}</th>
101					<th colspan="3"></th>
102				</tr>
103				<tr>
104					<td class="checkbox-cell">
105						<div class="form-check">
106							<input type="checkbox" class="form-check-input" name="show_expdate[{$types[user].type|escape}]" {if $types[user].show_expdate eq 'y'}checked="checked"{/if}>
107						</div>
108					</td>
109					<td class="checkbox-cell">
110						<div class="form-check">
111							<input type="checkbox" class="form-check-input" name="show_reads[{$types[user].type|escape}]" {if $types[user].show_reads eq 'y'}checked="checked"{/if}>
112						</div>
113					</td>
114					<td class="checkbox-cell">
115						<div class="form-check">
116							<input type="checkbox" class="form-check-input" name="show_size[{$types[user].type|escape}]" {if $types[user].show_size eq 'y'}checked="checked"{/if}>
117						</div>
118					</td>
119					<td class="checkbox-cell">
120						<div class="form-check">
121							<input type="checkbox" class="form-check-input" name="show_topline[{$types[user].type|escape}]" {if $types[user].show_topline eq 'y'}checked="checked"{/if}>
122						</div>
123					</td>
124					<td class="checkbox-cell">
125						<div class="form-check">
126							<input type="checkbox" class="form-check-input" name="show_subtitle[{$types[user].type|escape}]" {if $types[user].show_subtitle eq 'y'}checked="checked"{/if}>
127						</div>
128					</td>
129					<td class="checkbox-cell">
130						<div class="form-check">
131							<input type="checkbox" class="form-check-input" name="show_linkto[{$types[user].type|escape}]" {if $types[user].show_linkto eq 'y'}checked="checked"{/if}>
132						</div>
133					</td>
134					<td class="checkbox-cell">
135						<div class="form-check">
136							<input type="checkbox" class="form-check-input" name="show_image_caption[{$types[user].type|escape}]" {if $types[user].show_image_caption eq 'y'}checked="checked"{/if}>
137						</div>
138					</td>
139					<td class="checkbox-cell">
140						<div class="form-check">
141							<input type="checkbox" class="form-check-input" name="creator_edit[{$types[user].type|escape}]" {if $types[user].creator_edit eq 'y'}checked="checked"{/if}>
142						</div>
143					</td>
144					<td class="action" colspan="3">
145						{if $types[user].article_cnt eq 0}
146							<a class="tips" title=":{tr}Remove{/tr}" href="tiki-article_types.php?remove_type={$types[user].type|escape:url}">
147								{icon name='remove'}
148							</a>
149						{else}
150							&nbsp;
151						{/if}
152					</td>
153				</tr>
154			</table>
155		</div>
156		{if $prefs.article_custom_attributes eq 'y'}
157			<div class="table-responsive article-types mb-4">
158				<table class="table table-striped table-hover">
159					<tr>
160						<th>{tr}Custom attribute{/tr}</th>
161						<th></th>
162					</tr>
163					{foreach from=$types[user].attributes item=att key=attname}
164						<tr>
165							<td>{$attname|escape}</td>
166							<td class="action">
167								<a class="tips" title=":{tr}Remove{/tr}" href="tiki-article_types.php?att_type={$types[user].type|escape:url}&att_remove={$att.relationId|escape:url}">
168									{icon name='remove' alt="{tr}Remove{/tr}"}
169								</a>
170							</td>
171						</tr>
172					{/foreach}
173					<tr>
174						<td><input type="text" name="new_attribute[{$types[user].type|escape}]" value="" class="form-control"></td>
175						<td>&nbsp;</td>
176					</tr>
177				</table>
178			</div>
179		{/if}
180		<div class="text-center my-3">
181			<input type="submit" class="btn btn-primary" name="update_type" value="{tr}Save{/tr}">
182		</div>
183	{/section}
184</form>
185