1{title help="Toolbars"}{tr}Admin Toolbars{/tr}{/title}
2
3<div class="toolbars-admin clearfix">
4	<form name="toolbars" method="post" class="pb-4" action="tiki-admin_toolbars.php" onsubmit="return saveRows()">
5		<div class="adminoptionbox form-group row">
6			<label for="section" class="col-form-label col-sm-4">
7				{tr}Section{/tr}
8			</label>
9			<div class="col-sm-8">
10				<select id="section" name="section" onchange="$(this).form().tikiModal(tr('Loading...')).submit();" class="form-control">
11					{foreach from=$sections item=name key=skey}
12						<option value="{$skey}"{if $skey eq $loaded} selected="selected"{/if}>{$name|escape}</option>
13					{/foreach}
14				</select>
15			</div>
16		</div>
17		<div class="adminoptionbox form-group row">
18			<label for="comments" class="col-form-label col-sm-4">
19				{tr}Comments{/tr}
20			</label>
21			<div class="col-sm-8">
22				<input id="comments" name="comments" type="checkbox" onchange="$(this).form().tikiModal(tr('Loading...')).submit();" {if $comments eq 'on'}checked="checked" {/if}>
23			</div>
24		</div>
25		<div class="adminoptionbox form-group row">
26			<label for="view_mode" class="col-form-label col-sm-4">
27				{tr}View mode{/tr}
28			</label>
29			<div class="col-sm-8">
30				<select id="view_mode" name="view_mode" class="form-control">
31					{if $prefs.feature_wysiwyg eq 'y'}
32						<option value="both"{if $view_mode eq "both"} selected{/if}>
33						{tr}Wiki and WYSIWYG{/tr}
34						</option>
35					{/if}
36					<option value="wiki"{if $view_mode eq "wiki"} selected{/if}>
37						{tr}Wiki only{/tr}
38					</option>
39					{if $prefs.feature_wysiwyg eq 'y'}
40						<option value="wysiwyg"{if $view_mode eq "wysiwyg"} selected{/if}>
41							{tr}WYSIWYG (HTML mode){/tr}
42						</option>
43					{/if}
44					{if $prefs.feature_wysiwyg eq 'y' and $prefs.wysiwyg_htmltowiki eq 'y'}
45						<option value="wysiwyg_wiki"{if $view_mode eq "wysiwyg_wiki"} selected{/if}>
46							{tr}WYSIWYG (wiki mode){/tr}
47						</option>
48					{/if}
49					{if $prefs.feature_sheet eq 'y'}
50						<option value="sheet"{if $view_mode eq "sheet"} selected{/if}>
51							{tr}Spreadsheet{/tr}
52						</option>
53					{/if}
54				</select>
55			</div>
56		</div>
57		<div class="adminoptionbox form-group row">
58			<div class="offset-sm-4 col-sm-8">
59				<input type="submit" class="btn btn-primary" name="save" value="{tr}Save{/tr}">
60				{if $loaded neq 'global' and $not_global}<input type="submit" class="btn btn-secondary" name="reset" value="{tr}Reset to Global{/tr}">{/if}
61				{if $loaded eq 'global' and $not_default}<input type="submit" class="btn btn-secondary" name="reset_global" value="{tr}Reset to defaults{/tr}">{/if}
62			</div>
63		</div>
64		<input id="qt-form-field" type="hidden" name="pref" value="">
65	</form>
66
67	<div class="row mx-0 pb-4">
68		<div class="rows textarea-toolbar col-sm-12">
69			{foreach from=$current item=line name=line}
70				<ul id="row-{$smarty.foreach.line.iteration|escape}" class="row navbar card d-flex flex-row justify-content-start">
71				{foreach from=$line item=bit name=bit}
72					{foreach from=$bit item=tool name=tool}
73						{if !empty($qtelement[$tool].class)}
74							<li class="navbar-text {$qtelement[$tool].class} d-flex" {if $smarty.foreach.bit.index eq 1}style="float:right;"{/if}{if not $qtelement[$tool].visible} style="display:none"{/if}>
75								{$qtelement[$tool].html}
76							</li>
77						{/if}
78					{/foreach}
79				{/foreach}
80				{if $smarty.foreach.line.last and $rowCount gt 1}
81					{assign var=total value=$smarty.foreach.line.total+1}
82					</ul>
83					<br>
84					<label for="row-{$total|escape}">{tr}Row{/tr}&nbsp;{$total}</label>
85					<ul id="row-{$total|escape}" class="row card">
86				{/if}
87				</ul>
88				<br>
89			{/foreach}
90		</div>
91	</div>
92
93	<div class="row mx-0 pb-4">
94		<div class="lists col-sm-4">
95			<label for="full-list-w">{tr}Formatting Tools{/tr}</label>
96			<ul id="full-list-w" class="full">
97			{foreach from=$display_w item=tool}
98				<li class="{$qtelement[$tool].class}">{$qtelement[$tool].html}</li>
99			{/foreach}
100			</ul>
101		</div>
102		<div class="lists col-sm-4">
103			<label for="full-list-p">{tr}Plugin Tools{/tr}</label>
104			<ul id="full-list-p" class="full">
105			{foreach from=$display_p item=tool}
106				<li class="{$qtelement[$tool].class}">{$qtelement[$tool].html}</li>
107			{/foreach}
108			</ul>
109		</div>
110		<div class="lists col-sm-4">
111			<div id="toolbar_edit_div" style="display:none">
112				<form name="toolbar_edit_form" method="post" action="tiki-admin_toolbars.php">
113					<h2>{tr}Edit tool{/tr}</h2>
114					<fieldset>
115						<label for="tool_name">{tr}Name:{/tr}<small class="dialog_tips error">&nbsp;</small></label>
116						<input type="text" name="tool_name" id="tool_name" class="text ui-widget-content ui-corner-all">
117						<label for="tool_label">{tr}Label:{/tr}<small class="dialog_tips error">&nbsp;</small></label><small class="dialog_tips error">&nbsp;</small>
118						<input type="text" name="tool_label" id="tool_label" class="text ui-widget-content ui-corner-all">
119						<label for="tool_icon">{tr}Icon:{/tr}</label>
120						<input type="text" name="tool_icon" id="tool_icon" class="text ui-widget-content ui-corner-all">
121						<label for="tool_token">{tr}Wysiwyg Token:{/tr}</label>
122						<input type="text" name="tool_token" id="tool_token" class="text ui-widget-content ui-corner-all">
123						<label for="tool_syntax">{tr}Syntax:{/tr}</label>
124						<input type="text" name="tool_syntax" id="tool_syntax" class="text ui-widget-content ui-corner-all">
125						<label for="tool_type">{tr}Type:{/tr}</label>
126						<select name="tool_type" id="tool_type" class="select ui-widget-content ui-corner-all">
127							<option value="Inline">Inline</option>
128							<option value="Block">Block</option>
129							<option value="LineBased">LineBased</option>
130							<option value="Picker">Picker</option>
131							<option value="Separator">Separator</option>
132							<option value="FckOnly">FckOnly</option>
133							<option value="Fullscreen">Fullscreen</option>
134							<option value="TextareaResize">TextareaResize</option>
135							<option value="Helptool">Helptool</option>
136							<option value="FileGallery">FileGallery</option>
137							<option value="Wikiplugin">Wikiplugin</option>
138						</select>
139						<label for="tool_plugin">{tr}Plugin name:{/tr}</label>
140						<select name="tool_plugin" id="tool_plugin" class="select ui-widget-content ui-corner-all" style="margin-bottom:0.5em">
141							<option value="">{tr}None{/tr}</option>
142							{foreach from=$plugins key=plugin item=info}
143								<option value="{$plugin|escape}">{$info.name|escape}</option>
144							{/foreach}
145						</select>
146						<input type="hidden" value="" name="save_tool" id="save_tool">
147						<input type="hidden" value="" name="delete_tool" id="delete_tool">
148						<input type="hidden" name="section" value="{$loaded}">
149						<input type="hidden" name="comments" value="{if $comments}on{/if}">
150					</fieldset>
151				</form>
152				{autocomplete element='#tool_icon' type='icon'}
153			</div>
154			<label for="full-list-c">{tr}Custom Tools{/tr}</label>
155			<a href="#" id="toolbar_add_custom">{icon name="add" ititle=":{tr}Add a new custom tool{/tr}" iclass="tips"}</a>
156			<ul id="full-list-c" class="full">
157			{foreach from=$display_c item=tool}
158				<li class="{$qtelement[$tool].class}">{$qtelement[$tool].html}</li>
159			{/foreach}
160			</ul>
161		</div>
162	</div>
163</div>
164
165<div class="clearfix">
166{remarksbox title="{tr}Tips{/tr}"}
167{tr}To configure the toolbars on the various text editing areas select the section, and optionally check the comments checkbox, you want to edit and drag the icons from the left hand box to the toolbars on the right.<br>
168Drag icons back from the toolbar rows onto the full list to remove them.<br>
169Icons with <strong>bold</strong> labels are for wiki text areas, those that are <em>italic</em> are for WYSIWYG mode, and those that are <strong><em>bold and italic</em></strong> are for both.<br>
170To save the current set use the dropdown (and optionally check the comments checkbox) at the bottom of the page to set where you want these toolbars to appear, and click Save.{/tr}
171{/remarksbox}
172{remarksbox title='Note' type='note'}
173	{tr}If you are experiencing problems with this page after upgrading from Tiki 4 please use this link to delete all your customised tools:{/tr}
174	<strong>{self_link reset_all_custom_tools=y _class='alert-link'}{tr}Delete all custom tools{/tr}{/self_link}</strong>
175	<em>{tr}Warning: There is no undo!{/tr}</em>
176{/remarksbox}
177</div>
178