tiki-list_faqs.tpl 3.14 KB
Newer Older
1
{title help="FAQs" admpage="faqs"}{tr}FAQs{/tr}{/title}
dgdaniels's avatar
dgdaniels committed
2

sylvieg's avatar
tabs  
sylvieg committed
3
{tabset name='tabs_list_faqs'}
4
{tab name="{tr}Available FAQs{/tr}"}
5

6
{if $channels or ($find ne '')}
7
  {include file='find.tpl'}
8
{/if}
9

dgdaniels's avatar
dgdaniels committed
10
<table class="normal">
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
	<tr>
		<th>
			<a href="tiki-list_faqs.php?offset={$offset}&amp;sort_mode={if $sort_mode eq 'title_desc'}title_asc{else}title_desc{/if}">{tr}Title{/tr}</a>
		</th>
		<th style="text-align:right;">
			<a href="tiki-list_faqs.php?offset={$offset}&amp;sort_mode={if $sort_mode eq 'hits_desc'}hits_asc{else}hits_desc{/if}">{tr}Visits{/tr}</a>
		</th>
		<th style="text-align:right;">
			<a href="tiki-list_faqs.php?offset={$offset}&amp;sort_mode={if $sort_mode eq 'questions_desc'}questions_asc{else}questions_desc{/if}">{tr}Questions{/tr}</a>
		</th>
		{if $tiki_p_admin_faqs eq 'y'}
			<th>{tr}Action{/tr}</th>
		{/if}
	</tr>
	{cycle values="odd,even" print=false}
	{section name=user loop=$channels}
27
		<tr class="{cycle}">
28
			<td class="text">
chealer's avatar
chealer committed
29
				<a class="tablename" href="tiki-view_faq.php?faqId={$channels[user].faqId}">{$channels[user].title|escape}</a>
30 31 32
				<div class="subcomment">
					{$channels[user].description|escape|nl2br}
				</div>
33
			</td>
34
			<td class="integer">
35 36
				{$channels[user].hits}
			</td>
37
			<td class="integer">
38 39 40
				{$channels[user].questions} ({$channels[user].suggested})
			</td>
			{if $tiki_p_admin_faqs eq 'y'}
41
				<td class="action">
42
					<a class="link" href="tiki-list_faqs.php?offset={$offset}&amp;sort_mode={$sort_mode}&amp;faqId={$channels[user].faqId}">{icon _id='page_edit'}</a>
43 44
					<a class="link" href="tiki-faq_questions.php?faqId={$channels[user].faqId}">{icon _id='help' alt="{tr}Questions{/tr}"}</a>
					<a class="link" href="tiki-list_faqs.php?offset={$offset}&amp;sort_mode={$sort_mode}&amp;remove={$channels[user].faqId}">{icon _id='cross' alt="{tr}Remove{/tr}"}</a>
45 46 47 48
				</td>
			{/if}
		</tr>
	{sectionelse}
49
		{if $tiki_p_admin_faqs eq 'y'}{norecords _colspan=5}{else}{norecords _colspan=4}{/if}
50
	{/section}
dgdaniels's avatar
dgdaniels committed
51
</table>
luciash's avatar
luciash committed
52

53
{pagination_links cant=$cant step=$maxRecords offset=$offset}{/pagination_links}
sylvieg's avatar
tabs  
sylvieg committed
54 55 56
{/tab}

{if $tiki_p_admin_faqs eq 'y'}
57
{tab name="{tr}Edit/Create{/tr}"}
sylvieg's avatar
tabs  
sylvieg committed
58 59 60 61 62 63 64 65 66 67 68
  {if $faqId > 0}
		<h2>{tr}Edit this FAQ:{/tr} {$title}</h2>
		<div class="navbar">
			{button href="tiki-list_faqs.php" _text="{tr}Create new FAQ{/tr}"} 
		</div>
  {else}
		<h2>{tr}Create New FAQ:{/tr}</h2>
	{/if}

	<form action="tiki-list_faqs.php" method="post">
		<input type="hidden" name="faqId" value="{$faqId|escape}" />
69
		<table class="formcolor">
sylvieg's avatar
tabs  
sylvieg committed
70
			<tr>
71
				<td>
changi67's avatar
changi67 committed
72
					{tr}Title:{/tr}
sylvieg's avatar
tabs  
sylvieg committed
73
				</td>
74
				<td>
sylvieg's avatar
tabs  
sylvieg committed
75 76 77 78
					<input type="text" name="title" value="{$title|escape}" />
				</td>
			</tr>
			<tr>
79
				<td>
changi67's avatar
changi67 committed
80
					{tr}Description:{/tr}
sylvieg's avatar
tabs  
sylvieg committed
81
				</td>
82
				<td>
sylvieg's avatar
tabs  
sylvieg committed
83 84 85 86 87
					<textarea name="description" rows="4" cols="40">{$description|escape}</textarea>
				</td>
			</tr>
			{include file='categorize.tpl'}
			<tr>
88
				<td>
changi67's avatar
changi67 committed
89
					{tr}Users can suggest questions:{/tr}
sylvieg's avatar
tabs  
sylvieg committed
90
				</td>
91
				<td>
sylvieg's avatar
tabs  
sylvieg committed
92 93 94 95
					<input type="checkbox" name="canSuggest" {if $canSuggest eq 'y'}checked="checked"{/if} />
				</td>
			</tr>
			<tr>
96
				<td>
sylvieg's avatar
tabs  
sylvieg committed
97 98
					&nbsp;
				</td>
99
				<td>
sylvieg's avatar
tabs  
sylvieg committed
100 101 102 103 104 105 106 107 108
					<input type="submit" name="save" value="{tr}Save{/tr}" />
				</td>
			</tr>
		</table>
	</form>
{/tab}
{/if}
{/tabset}