summaryrefslogtreecommitdiff
path: root/templates/section_inc.tpl
blob: ba61ae14ca186f3c250ce048a79f28ece3924813 (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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
{strip}
{if $list_style == "table"}

	{* ======= this display method requires "alphabetisation" ======= *}
	<h3><a href="{$smarty.const.PIGEONHOLES_PKG_URL}view.php?structure_id={$subtree[ix].structure_id}">{$subtree[ix].title}</a></h3>

	{foreach from=$pigeonList item=pigeonItem}
		{if $pigeonItem.structure_id eq $subtree[ix].structure_id && $pigeonItem.members}
			{$pigeonItem.data|escape}
			<table class="data"><tr>
				{*use a fixed number here for now, we can change this eventually with a preference*}
				{math equation="100 / x" x=3 assign=width format="%u"}
				{foreach from=$pigeonItem.members item=pigeonColumn}
					<td style="vertical-align:top; width:{$width}%;">
						{foreach from=$pigeonColumn item=members key=index}
							<h2>{$index}</h2>
							<ul>
								{foreach from=$members item=member}
									<li>
										<a href="{$smarty.const.BIT_ROOT_URL}index.php?content_id={$member.content_id}">{$member.title}</a>
										<br />
										<small>{$member.content_type_description}</small>
									</li>
								{/foreach}
							</ul>
						{/foreach}
					</td>
				{/foreach}
			</tr></table>
		{/if}
	{/foreach}

{elseif $list_style == "dynamic"}

	{* ======= crazy display for only few category memebers - only display method that allows custom sorting ======= *}
	{if $gPigeonholes->mStructureId eq $subtree[ix].structure_id or $smarty.request.expand_all}
		{assign var=iname value=Expanded}
	{else}
		{assign var=iname value=Collapsed}
	{/if}

	<div class="highlight">
		{if $edit}
			<div class="floaticon">
				{smartlink ititle="Edit Category" ibiticon="liberty/edit" ifile="edit_pigeonholes.php" structure_id=$subtree[ix].structure_id action=edit}
				{smartlink ititle="Remove Category" ibiticon="liberty/delete" ifile="edit_pigeonholes.php" structure_id=$subtree[ix].structure_id action=remove}
			</div>
		{/if}

		<a href="javascript:icntoggle('sid{$subtree[ix].structure_id}');">
			{biticon ipackage=liberty iname=$iname id=sid`$subtree[ix].structure_id`img"} {$subtree[ix].title}
		</a> &nbsp;

		<script type="text/javascript">
			setfoldericonstate('sid{$subtree[ix].structure_id}');
		</script>

		{foreach from=$pigeonList item=pigeonItem}
			{if $pigeonItem.structure_id eq $subtree[ix].structure_id}
				<small> {tr}{$pigeonItem.members_count} Item(s){/tr} </small>
			{/if}
		{/foreach}

		<noscript>
			<div style="padding-left:18px;" class="small"><a href="{$smarty.const.PIGEONHOLES_PKG_URL}{if $edit}edit_pigeonholes{else}index{/if}.php?structure_id={$subtree[ix].structure_id}">{tr}Expand{/tr}</a></div>
		</noscript>
	</div>

	{foreach from=$pigeonList item=pigeonItem}
		{if $pigeonItem.structure_id eq $subtree[ix].structure_id}
			<small>{$pigeonItem.data|escape}</small>

			{if $pigeonItem.members}
				<ul id="sid{$subtree[ix].structure_id}" style="display:{if $gPigeonholes->mStructureId eq $subtree[ix].structure_id or $smarty.request.expand_all}block{else}none{/if};" class="data">
					{foreach from=$pigeonItem.members item=pigeonMember}
						{if $gBitSystem->isFeatureActive( 'custom_member_sorting' )}
							<li>
								{if $edit && $gBitSystem->isFeatureActive( 'custom_member_sorting' )}
									{if $pigeonMember.pos ne 1}
										{smartlink ititle="Move item up" ibiticon="liberty/nav_up" expand_all=$smarty.request.expand_all ifile="edit_pigeonholes.php" action=move orientation=north structure_id=$pigeonItem.structure_id parent_id=$pigeonItem.content_id member_id=$pigeonMember.content_id}
									{else}
										{biticon ipackage="liberty" iname="spacer"}
									{/if}

									{if $pigeonMember.pos ne $pigeonItem.members_count}
										{smartlink ititle="Move item down" ibiticon="liberty/nav_down" expand_all=$smarty.request.expand_all ifile="edit_pigeonholes.php" action=move orientation=south structure_id=$pigeonItem.structure_id parent_id=$pigeonItem.content_id member_id=$pigeonMember.content_id}
									{else}
										{biticon ipackage="liberty" iname="spacer"}
									{/if}
								{/if}
								&nbsp; <a href="{$smarty.const.BIT_ROOT_URL}index.php?content_id={$pigeonMember.content_id}">{$pigeonMember.title}</a> &nbsp;
								{if $edit}
									{smartlink ititle="Remove Item" ibiticon="liberty/delete_small" expand_all=$smarty.request.expand_all ifile="edit_pigeonholes.php" action=demember structure_id=$pigeonItem.structure_id parent_id=$pigeonMember.content_id content_id=$pigeonItem.content_id}
								{/if}
							</li>
						{else}
							{assign var=ctg1 value=$pigeonMember.content_type_guid}

							{* close off the content type <ul> *}
							{if $ctg1 ne $ctg2 and $ctg2}
									</ul>
								</li>
							{/if}

							{* open the content type <ul> *}
							{if $ctg1 ne $ctg2}
								<li>{$gLibertySystem->mContentTypes.$ctg1.content_description}
									<ul>
							{/if}

							<li>
								<a href="{$smarty.const.BIT_ROOT_URL}index.php?content_id={$pigeonMember.content_id}">{$pigeonMember.title}</a>
								{if $edit}
									&nbsp; {smartlink ititle="Remove Item" ibiticon="liberty/delete_small" expand_all=$smarty.request.expand_all ifile="edit_pigeonholes.php" action=demember structure_id=$pigeonItem.structure_id parent_id=$pigeonMember.content_id content_id=$pigeonItem.content_id}
								{/if}
							</li>

							{assign var=ctg2 value=$pigeonMember.content_type_guid}
						{/if}
					{/foreach}

					{if !$gBitSystem->isFeatureActive( 'custom_member_sorting' )}
							</ul>
						</li>
					{/if}
				</ul>
			{/if}
		{/if}
	{/foreach}

{else}

	{* ======= very basic display of the pigoenhole structure ======= *}
	{if !$no_edit}
		<div class="floaticon">
			{smartlink ititle="Edit Category" ibiticon="liberty/edit" ifile="edit_pigeonholes.php" structure_id=$subtree[ix].structure_id action=edit}
			{smartlink ititle="Remove Category" ibiticon="liberty/delete" ifile="edit_pigeonholes.php" structure_id=$subtree[ix].structure_id action=remove}
		</div>
	{/if}

	<h3><a href="{$smarty.const.PIGEONHOLES_PKG_URL}view.php?structure_id={$subtree[ix].structure_id}">{$subtree[ix].title}</a></h3>

	{foreach from=$pigeonList item=pigeonItem}
		{if $pigeonItem.structure_id eq $subtree[ix].structure_id and $pigeonItem.members_count}
			 {tr}{$pigeonItem.members_count} Item(s){/tr}
		{/if}
	{/foreach}
{/if}
{/strip}