summaryrefslogtreecommitdiff
path: root/templates/menus.tpl
blob: caf51a1102b0b18833d5be1429c126a43639ee2b (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
150
151
152
153
154
155
156
157
158
159
160
161
162
{strip}
{if $editMenu.menu_id}
	<div class="floaticon"><a href="{$gBitLoc.PKG_NEXUS_URL}menus.php">{biticon ipackage=liberty iname=new iexplain="create new menu"}</a></div>
{/if}
<div class="display nexus">
	<div class="header">
		<h1>{tr}Menu Administration{/tr}</h1>
	</div>

	<div class="body">

		{form legend="Create / Edit Menus"}
			<input type="hidden" name="menu_id" value="{$editMenu.menu_id}" />

			{formfeedback hash=$formfeedback}

			<div class="row">
				{formlabel label="Title" for="title"}
				{forminput}
					<input type="text" name="title" id="title" size="50" value="{$editMenu.title}" />
					{formhelp note="Enter a name for your menu."}
				{/forminput}
			</div>

			<div class="row">
				{formlabel label="Description" for="description"}
				{forminput}
					<textarea name="description" id="description" cols="80" rows="3">{$editMenu.description}</textarea>
					{formhelp note="A description of this menu. This description is visible to users that can add items to this menu."}
				{/forminput}
			</div>

			<div class="row">
				{formlabel label="Editable menu" for="editable"}
				{forminput}
					{html_checkboxes name="editable" values="1" checked=`$editMenu.editable` labels=false id="editable"}
					{formhelp note="Checking this will allow users with the correct permission (bit_p_insert_nexus_item) to add menu items when they are editing content such as a wiki page or a fisheye gallery."}
				{/forminput}
			</div>

			<div class="row">
				{formlabel label="Pick menu type"}
				{forminput}
					{foreach from=$gNexusSystem->mPlugins item=plugin}
						{if $plugin.is_active eq 'y'}
							<div class="row">
								<label>
									<input type="radio" name="plugin_guid" value="{$plugin.plugin_guid}"
										{if $editMenu.plugin_guid eq $plugin.plugin_guid or ( $editMenu.plugin_guid eq '' and $plugin.plugin_guid eq 'suckerfish' )}
											checked="checked"
										{/if}
									/>
									&nbsp;{$plugin.plugin_guid}
								</label>
								<br />
								&nbsp;
								<select name="type_{$plugin.plugin_guid}" id="type_{$plugin.plugin_guid}">
									{foreach from=$plugin.menu_types key=type item=menu_type}
										{if $type eq hor and $use_custom_top_bar and !$editMenu.type eq 'hor'}
											<option value="">{tr}Only one horizontal menu can exist.{/tr}</option>
										{else}
											<option value="{$type}"{if $type eq $editMenu.type} selected="selected"{/if}>{$menu_type.label}</option>
										{/if}
									{/foreach}
								</select>
								{formhelp note=$plugin.plugin_description}
								<div class="formhelp">
									<dl>
										{foreach from=$plugin.menu_types item=menu_type}
											<dt>{$menu_type.label}</dt><dd>{$menu_type.note}</dd>
										{/foreach}
									</dl>
								</div>
							</div>
						{/if}
					{/foreach}
				{/forminput}
			</div>

			<div class="row submit">
				<input type="submit" name="store_menu" value="Save Settings" />
			</div>
		{/form}

		{if $use_custom_top_bar}
			{form legend="Top Bar Menu Position"}
				<div class="row">
					{formlabel label="Position" for="top_bar_position"}
					{forminput}
						<select name="top_bar_position" id="top_bar_position">
							<option value="right" {if $gBitSystemPrefs.top_bar_position eq 'right'}selected="selected"{/if}>{tr}To the right of the bitweaver menu{/tr}</option>
							<option value="left" {if $gBitSystemPrefs.top_bar_position eq 'left'}selected="selected"{/if}>{tr}To the left of the bitweaver menu{/tr}</option>
							<option value="replace" {if $gBitSystemPrefs.top_bar_position eq 'replace'}selected="selected"{/if}>{tr}Replace the bitweaver menu{/tr}</option>
						</select>
						{formhelp note="Here you can set the position of where your custom top bar menu should be."}
					{/forminput}
				</div>

				<div class="row submit">
					<input type="submit" name="store_pos" value="Save Settings" />
				</div>
			{/form}
		{/if}

		<table class="data" summary="{tr}List of menus that can be used on this site{/tr}">
			<caption>{tr}Existing menus{/tr}</caption>
			<tr>
				<th scope="col">{tr}Title{/tr}</th>
				<th scope="col">{tr}Description{/tr}</th>
				<th scope="col">{tr}GUID{/tr}</th>
				<th scope="col">{tr}Type{/tr}</th>
				<th scope="col">{tr}# of Items{/tr}</th>
				<th scope="col">{tr}Editable{/tr}</th>
				<th scope="col">{tr}Actions{/tr}</th>
			</tr>
			{foreach from=$menuList item=menu}
				<tr class="{cycle values="even,odd"}">
					<td>{$menu.title}</td>
					<td>{$menu.description}</td>
					<td>{$menu.plugin_guid}</td>
					<td>
						{assign var=plugin_guid value=$menu.plugin_guid}
						{foreach from=$gNexusSystem->mPlugins.$plugin_guid.menu_types item=menu_type key=m_type}
							{if $m_type eq $menu.type}{$menu_type.label}{/if}
						{/foreach}
					</td>
					<td style="text-align:right;">{$menu.items|@count}</td>
					<td style="text-align:center;">
						{if $menu.editable}
							{biticon ipackage=liberty iname=active iexplain="menu is editable"}
						{else}
							{biticon ipackage=liberty iname=inactive iexplain="menu is not editable"}
						{/if}
					</td>
					<td class="actionicon">
						<a href="{$gBitLoc.PKG_NEXUS_URL}menu_sort.php?menu_id={$menu.menu_id}">{biticon ipackage=nexus iname=organise iexplain='sort menu items'}</a>
						<a href="{$gBitLoc.PKG_NEXUS_URL}menu_items.php?menu_id={$menu.menu_id}">{biticon ipackage=liberty iname=edit iexplain='create and edit menu items'}</a>
						<a href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php?page=layout&amp;module_name=bitpackage%3Atemp%2Fnexus%2Fmod_{$menu.title|replace:' ':'_'|lower}_{$menu.menu_id}.tpl">{biticon ipackage=liberty iname=assign iexplain=assign}</a>
						<a href="{$gBitLoc.PKG_NEXUS_URL}menus.php?action=remove_dead&amp;menu_id={$menu.menu_id}">{biticon ipackage=nexus iname=remove_dead iexplain='remove dead links'}</a>
						<a href="{$gBitLoc.PKG_NEXUS_URL}menus.php?action=edit&amp;menu_id={$menu.menu_id}">{biticon ipackage=liberty iname=config iexplain='configure menu'}</a>
						<a href="{$gBitLoc.PKG_NEXUS_URL}menus.php?action=remove&amp;menu_id={$menu.menu_id}">{biticon ipackage=liberty iname=delete iexplain='remove menu'}</a>
					</td>
				</tr>
			{foreachelse}
				<tr>
					<td class="norecords" colspan="7">{tr}No Records Found{/tr}</td>
				</tr>
			{/foreach}
		</table>

		{if $menuList}
			<div class="row">
				{formlabel label="Menu Cache" for=""}
				{forminput}
					{smartlink ititle="Rewrite Menu Cache" action=rewrite_cache}
					{formhelp note="This will remove any old files in the nexus menu cache directory and rewrite any exiting menus. Useful when you have renamed menus."}
				{/forminput}
			</div>
		{/if}
	</div><!-- end .body -->
</div><!-- end .nexus -->
{/strip}