Validate JSON input in configurator
[civicrm-core.git] / templates / CRM / Admin / Page / CKEditorConfig.tpl
CommitLineData
7266e09b
CW
1{*
2 +--------------------------------------------------------------------+
2c4c49ca 3 | CiviCRM version 4.7 |
7266e09b 4 +--------------------------------------------------------------------+
8c9251b3 5 | Copyright CiviCRM LLC (c) 2004-2018 |
7266e09b
CW
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
8 | |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
12 | |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
25*}
26<style>{literal}
27 .select2-results .ui-icon,
972bd897 28 .select2-results .crm-i,
7266e09b 29 .select2-container .ui-icon,
972bd897 30 .select2-container .crm-i,
7266e09b
CW
31 .select2-results img,
32 .select2-container img {
33 display: inline-block;
34 position: relative;
35 top: 2px;
36 }
37 #toolbarModifierWrapper .toolbar button:last-child,
38 #toolbarModifierWrapper .toolbar button[data-group=config] {
39 display: none;
40 }
3b7ceeb2
CW
41 .api-field-desc {
42 font-size: .8em;
43 color: #828282;
44 line-height: 1.3em;
45 }
46 .select2-highlighted .api-field-desc {
47 color: #fcfcfc;
48 }
49 #crm-custom-config-options > div {
50 margin: .5em .2em;
51 }
7ad5ae6a
CW
52 #crm-container .ui-tabs-nav {
53 padding-bottom: 0;
54 }
55 #crm-container .ui-tabs-nav li {
56 margin-left: .3em;
57 }
58 #crm-container .ui-tabs-nav a {
59 font-size: 1.1em;
60 border-bottom: 0 none;
61 padding: 3px 10px 1px !important;
62 }
4ce3e897
CW
63 .crm-config-option-row span.crm-error:after {
64 font-family: FontAwesome;
65 content: " \f071 Invalid JSON"
66 }
7266e09b
CW
67{/literal}</style>
68{* Force the custom config file to reload by appending a new query string *}
69<script type="text/javascript">
70 {if $configUrl}CKEDITOR.config.customConfig = '{$configUrl}?{php}print str_replace(array(' ', '.'), array('', '='), microtime());{/php}'{/if};
71</script>
72
7ad5ae6a
CW
73<div class="ui-tabs">
74 <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header">
75 <li>{ts}Preset:{/ts}</li>
76 {foreach from=$presets key='k' item='p'}
77 <li class="ui-tabs-tab ui-corner-top ui-state-default ui-tab {if $k == $preset}ui-tabs-active ui-state-active{/if}">
78 <a class="ui-tabs-anchor" href="{crmURL q="preset=$k"}">{$p}</a>
79 </li>
80 {/foreach}
81 </ul>
82</div>
7266e09b 83<form method="post" action="{crmURL}" id="toolbarModifierForm">
7ad5ae6a
CW
84 <fieldset>
85 <div class="crm-block crm-form-block">
86 <label for="skin">{ts}Skin{/ts}</label>
87 <select id="skin" name="config_skin" class="crm-select2 eight config-param">
88 {foreach from=$skins item='s'}
89 <option value="{$s}" {if $s == $skin}selected{/if}>{$s|ucfirst}</option>
90 {/foreach}
91 </select>
92 &nbsp;&nbsp;
93 <label for="extraPlugins">{ts}Plugins{/ts}</label>
94 <input id="extraPlugins" name="config_extraPlugins" class="huge config-param" value="{$extraPlugins}" placeholder="{ts}Select optional extra features{/ts}">
95 </div>
7266e09b 96
7ad5ae6a
CW
97 <div class="editors-container">
98 <div id="editor-basic"></div>
99 <div id="editor-advanced"></div>
100 </div>
7266e09b 101
7ad5ae6a
CW
102 <div class="configurator">
103 <div>
104 <div id="toolbarModifierWrapper" class="active"></div>
105 </div>
7266e09b 106 </div>
7266e09b 107
3b7ceeb2 108
7ad5ae6a
CW
109 <div class="crm-block crm-form-block">
110 <fieldset>
111 <legend>{ts}Advanced Options{/ts}</legend>
deec6b58 112 <div class="description">{ts 1='href="https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_config.html" target="_blank"'}Refer to the <a %1>CKEditor Api Documentation</a> for details.{/ts}</div>
7ad5ae6a
CW
113 <div id="crm-custom-config-options"></div>
114 </fieldset>
115 </div>
3b7ceeb2 116
7ad5ae6a
CW
117 <div class="crm-submit-buttons">
118 <span class="crm-button crm-i-button">
119 <i class="crm-i fa-wrench"></i> <input type="submit" value="{ts}Save{/ts}" name="save" class="crm-form-submit" accesskey="S"/>
120 </span>
121 <span class="crm-button crm-i-button">
122 <i class="crm-i fa-times"></i> <input type="submit" value="{ts}Revert to Default{/ts}" name="revert" class="crm-form-submit" onclick="return confirm('{$revertConfirm}');"/>
123 </span>
124 </div>
125 <input type="hidden" value="{$preset}" name="preset" />
126 </fieldset>
7266e09b 127</form>
3b7ceeb2
CW
128<script type="text/template" id="config-row-tpl">
129 <div class="crm-config-option-row">
130 <input class="huge crm-config-option-name" placeholder="{ts}Option{/ts}"/>
131 </div>
132</script>