summaryrefslogtreecommitdiff
path: root/templates/admin_topics.tpl
blob: c1112aacdfad04a6088e26026c39598155bec3c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{* $Header$ *}
{strip}

<div class="floaticon">{bithelp}</div>

<div class="admin articles">
	<div class="header">
		<h1>{tr}Admin Topics{/tr}</h1>
	</div>

	<div class="body">
		{formfeedback error=$gContent->mErrors}

		{form legend="Create a new Topic" enctype="multipart/form-data"}
			<input type="hidden" name="MAX_FILE_SIZE" value="1000000" />

			<div class="form-group">
				{formlabel label="Topic Title" for="topic_name"}
				{forminput}
					<input type="text" id="topic_name" name="topic_name" />
					{formhelp note=""}
				{/forminput}
			</div> 

			<div class="form-group">
				{formlabel label="Upload Image" for="t-image"}
				{forminput}
					<input name="upload" id="t-image" type="file" />
					{formhelp note=""}
				{/forminput}
			</div>

			<div class="form-group submit">
				<input type="submit" class="btn btn-default" name="fSubmitAddTopic" value="{tr}Add Topic{/tr}" />
			</div>
		{/form}

		<table class="table data">
			<caption>{tr}List of Topics{/tr}</caption>
			<tr>
				<th>{tr}Image{/tr}</th>
				<th>{tr}Title{/tr} [ {tr}Number of Articles{/tr} ]</th>
				<th>{tr}Active{/tr}</th>
				<th>{tr}Actions{/tr}</th>
			</tr>

			{section name=user loop=$topics}
				<tr class="{cycle values="even,odd"}">
					<td>
						{if $topics[user].has_topic_image == 'y'}
							<a href="{$smarty.const.ARTICLES_PKG_URL}index.php?topic_id={$topics[user].topic_id}">
								<img class="icon" alt="{tr}topic image{/tr}" src="{$topics[user].topic_image_url}" />
							</a>
						{/if}
					</td>

					<td>
						<h2>
							<a href="{$smarty.const.ARTICLES_PKG_URL}index.php?topic_id={$topics[user].topic_id}">{$topics[user].topic_name}</a>
							&nbsp; <small>[ {$topics[user].num_articles} ]</small>
						</h2>

					</td>

					<td style="text-align:center;">
						{if $topics[user].active_topic eq 'n'}
							{smartlink ititle='activate' biticon="list-remove" fActivateTopic=1 topic_id=$topics[user].topic_id}
						{else}
							{smartlink ititle='deactivate' biticon="dialog-ok" fDeactivateTopic=1 topic_id=$topics[user].topic_id}
						{/if}
					</td>

					<td align="right">
						{smartlink ititle='edit' biticon="edit" ifile='edit_topic.php' topic_id=$topics[user].topic_id}
						{* smartlink ititle='permissions' biticon="lock" ipackage='kernel' ifile='object_permissions.php' objectName="Topic `$topics[user].name`" object_type=topic permType=topics object_id=$topics[user].topic_id *}
						<br />
						<a href="{$smarty.const.ARTICLES_PKG_URL}admin/admin_topics.php?fRemoveTopic=1&amp;topic_id={$topics[user].topic_id}">{biticon ipackage="icons" iname="user-trash" ipackage="icons" iforce=icon_text iexplain="Remove Topic"}</a>
						<br />
						<a href="{$smarty.const.ARTICLES_PKG_URL}admin/admin_topics.php?fRemoveTopicAll=1&amp;topic_id={$topics[user].topic_id}">{biticon ipackage="icons" iname="user-trash" ipackage="icons" iforce=icon_text iexplain="Remove Topic and its Articles"}</a>
					</td>
				</tr>
			{sectionelse}
				<tr class="norecords">
					<td colspan="4">{tr}No records found{/tr}</td>
				</tr>
			{/section}
		</table>
	</div><!-- end .body -->
</div><!-- end .admin -->
{/strip}