summaryrefslogtreecommitdiff
path: root/templates/assign_content.tpl
blob: 93adc281851b48a36b64e9c5f60e0b8acb194ee5 (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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
{strip}
<div class="edit pigeonholes">
	<div class="header">
		<h1>{tr}Assign Content to Categories{/tr}</h1>
	</div>

	<div class="body">
		{if !$pigeonList}
			{formfeedback warning="No categories have been set up yet. You need to create some before you can assign content to them."}
		{else}
			{form legend="Assign Content"}
				<input type="hidden" name="sort_mode" value="{$smarty.request.sort_mode}" />
				<div class="row">
					{formlabel label="Restrict listing" for="content_type"}

					{forminput}
						<select name="max_records">
							<option value="10"  {if $smarty.request.max_records eq 10 or !$smarty.request.max_rows}selected="selected"{/if}>10</option>
							<option value="50"  {if $smarty.request.max_records eq 50}selected="selected"{/if}>50</option>
							<option value="100" {if $smarty.request.max_records eq 100}selected="selected"{/if}>100</option>
							<option value="200" {if $smarty.request.max_records eq 200}selected="selected"{/if}>200</option>
							<option value="500" {if $smarty.request.max_records eq 500}selected="selected"{/if}>500</option>
							<option value="-1" {if $smarty.request.max_records eq -1}selected="selected"{/if}>{tr}All{/tr}</option>
						</select> {tr}Records{/tr}
					{/forminput}

					{forminput}
						<select name="include">
							<option value="">{tr}Hide assigned content{/tr}</option>
							<option value="members" {if $smarty.request.include eq 'members'}selected="selected"{/if}>{tr}Display assigned content{/tr}</option>
						</select>
					{/forminput}

					{forminput}
						{html_options options=$contentTypes name=content_type id=content_type selected=$contentSelect}
					{/forminput}

					{forminput}
						<input type="text" value="{$smarty.request.find_objects}" name="find_objects" />&nbsp;
						{formhelp note="You can restrict the content listing to a given content type or apply a filter."}
					{/forminput}
				</div>

				<div class="row">
					{formlabel label="Category" for="root_structure_id"}
					{forminput}
						{html_options values=$pigeonRoots options=$pigeonRoots name=root_structure_id id=root_structure_id selected=$smarty.request.root_structure_id}
						{formhelp note="Pick category you want to use to insert content into."}
					{/forminput}
				</div>

				<div class="row submit">
					<input type="submit" value="{tr}Restrict Listing{/tr}" name="search_objects" />
				</div>
			{/form}

			{formfeedback hash=$feedback}

			{form}
				<input type="hidden" name="sort_mode" value="{$smarty.request.sort_mode}" />
				<input type="hidden" name="include" value="{$smarty.request.include}" />
				<input type="hidden" name="find_objects" value="{$smarty.request.find_objects}" />
				<input type="hidden" name="max_records" value="{$smarty.request.max_records}" />
				<input type="hidden" name="content_type" value="{$contentSelect}" />
				<input type="hidden" name="root_structure_id" value="{$smarty.request.root_structure_id}" />

				{if $gBitSystem->isFeatureActive( 'custom_member_sorting' ) && $smarty.request.include eq 'members'}
					{formfeedback warning="Using this insertion method will reset any custom sorting you have done so far."}
				{/if}

				<table class="data">
					<caption>{tr}Available Content{/tr} <span class="total">[ {$contentCount} ]</span></caption>
					<tr>
						<th>{smartlink ititle="Title" isort=title idefault=1 max_rows=$smarty.request.max_rows content_type=$contentSelect find_objects=$find_objects include=$smarty.request.include page=$page}</th>
						<th>{smartlink ititle="Content Type" isort=content_type_guid max_rows=$smarty.request.max_rows content_type=$contentSelect find_objects=$find_objects include=$smarty.request.include page=$page}</th>
						{if $assignableContent}
							{foreach from=$pigeonList item=pigeon}
								<th><abbr title="{$pigeon.title|escape}">{counter}</abbr></th>
							{/foreach}
						{/if}
					</tr>

					{foreach from=$assignableContent item=item}
						<tr class="{cycle values='odd,even'}">
							<td><a href="{$smarty.const.BIT_ROOT_URL}index.php?content_id={$item.content_id}">{$item.title|escape}</a></td>
							<td>{assign var=content_type_guid value=`$item.content_type_guid`}{$contentTypes.$content_type_guid}</td>
							{foreach from=$pigeonList item=pigeon}
								<td style="text-align:center">
									<input type="checkbox" name="pigeonhole[{$item.content_id}][]" value="{$pigeon.content_id}"
										{foreach from=$item.assigned item=parent_id}
											{if $pigeon.content_id eq $parent_id}checked="checked"{/if}
										{/foreach}
									title="{$pigeon.title|escape}" />
								</td>
							{/foreach}
						</tr>
					{foreachelse}
						<tr>
							<td colspan="2" class="norecords">{tr}No Content can be found with your selection criteria{/tr}</td>
						</tr>
					{/foreach}
				</table>

				{if $assignableContent}
					<div class="row submit">
						<input type="submit" name="insert_content" value="Insert Content into Categories" />
					</div>
				{/if}
			{/form}

			{if $assignableContent}
				{foreach from=$pigeonList item=pigeon}
					<dl>
						<dt>{counter name=dogEatsPigeon}</dt>
						<dd>{$pigeon.display_path}<br /><small>{$pigeon.data|escape}</small></dd>
					</dl>
				{/foreach}
			{/if}
		{/if}
	</div><!-- end .body -->
</div><!-- end .liberty -->
{/strip}