| 1 |
<?php |
| 2 |
global $post, $pagenow; |
| 3 |
$cf7_key = $post->post_name; |
| 4 |
?> |
| 5 |
<h2><?php echo esc_html( __cf7sg( 'Form' ) ); ?></h2> |
| 6 |
<div id="top-tags"> |
| 7 |
<?php |
| 8 |
$tag_generator = WPCF7_TagGenerator::get_instance(); |
| 9 |
$tag_generator->print_buttons(); |
| 10 |
?> |
| 11 |
</div> |
| 12 |
<?php require_once plugin_dir_path( __FILE__ ) .'helpers/cf7sg-js-events.php'; ?> |
| 13 |
<div id="editors"> |
| 14 |
<?php |
| 15 |
$js_file = str_replace(ABSPATH, '', get_stylesheet_directory()."/js/{$cf7_key}.js"); |
| 16 |
$js_file_exists = file_exists(ABSPATH.$js_file); |
| 17 |
$jscm_required = $js_file_exists ? ' required':''; |
| 18 |
$editor_disable = ('post-new.php'==$pagenow) ? ' disabled':''; |
| 19 |
$css_file = str_replace(ABSPATH, '', get_stylesheet_directory()."/css/{$cf7_key}.css"); |
| 20 |
$css_file_exists = file_exists(ABSPATH.$css_file); |
| 21 |
$csscm_required = $css_file_exists ? ' required':''; |
| 22 |
?> |
| 23 |
|
| 24 |
<div id="optional-editors"> |
| 25 |
<a class="button jstab cf7sg-cmtab<?=$jscm_required.$editor_disable?>" href="javascript:void(0);"><?=__('Add custom JS','cf7-grid-layout')?></a> |
| 26 |
<div id="cf7-js-codemirror" class="display-none"> |
| 27 |
<div class="codemirror-theme"><?=__('Editor theme:','cf7-grid-layout')?> |
| 28 |
<?php $user_js_theme = get_user_meta(get_current_user_id(),'_cf7sg_js_cm_theme', true); ?> |
| 29 |
<label> |
| 30 |
<input type="radio" value="light" name="cf7sg_js_codemirror_theme"<?=('light'==$user_js_theme ? ' checked' : '')?>/><?=__('Light','cf7-grid-layout')?> |
| 31 |
</label> |
| 32 |
<label> |
| 33 |
<input type="radio" value="dark" name="cf7sg_js_codemirror_theme" <?=('dark'==$user_js_theme ? ' checked' : '')?>/><?=__('Dark','cf7-grid-layout')?> |
| 34 |
</label> |
| 35 |
<input type="hidden" name="cf7sg_prev_js_file" class="prev-file" /> |
| 36 |
</div> |
| 37 |
<textarea id="cf7-form-js" class="cf7-sg-hidden" data-file="<?=__('File','cf7-grid-layout')?> >> /<?=$js_file?>" name="cf7sg_js_file" data-form=""> |
| 38 |
<?php |
| 39 |
if($js_file_exists){ |
| 40 |
$file = file_get_contents(ABSPATH.$js_file); |
| 41 |
echo esc_textarea( $file ); |
| 42 |
}else{ |
| 43 |
do_action('cf7sg_default_custom_js_template', $cf7_key); |
| 44 |
} |
| 45 |
?> |
| 46 |
</textarea> |
| 47 |
</div> |
| 48 |
<a class="button csstab cf7sg-cmtab<?=$csscm_required.$editor_disable?>" href=""><?=__('Add custom CSS','cf7-grid-layout')?></a> |
| 49 |
<div id="cf7-css-codemirror" class="display-none"> |
| 50 |
<div class="codemirror-theme"><?=__('Editor theme:','cf7-grid-layout')?> |
| 51 |
<?php $user_css_theme = get_user_meta(get_current_user_id(),'_cf7sg_css_cm_theme', true); ?> |
| 52 |
<label> |
| 53 |
<input type="radio" value="light" name="cf7sg_css_codemirror_theme"<?=('light'==$user_css_theme ? ' checked' : '')?>/><?=__('Light','cf7-grid-layout')?> |
| 54 |
</label> |
| 55 |
<label> |
| 56 |
<input type="radio" value="dark" name="cf7sg_css_codemirror_theme" <?=('dark'==$user_css_theme ? ' checked' : '')?>/><?=__('Dark','cf7-grid-layout')?> |
| 57 |
</label> |
| 58 |
<input type="hidden" name="cf7sg_prev_css_file" class="prev-file" /> |
| 59 |
</div> |
| 60 |
<textarea id="cf7-form-css" class="cf7-sg-hidden" data-file="<?=__('File','cf7-grid-layout')?> >> /<?=$css_file?>" name="cf7sg_css_file" data-form=""> |
| 61 |
<?php |
| 62 |
if($css_file_exists){ |
| 63 |
$file = file_get_contents(ABSPATH.$css_file); |
| 64 |
echo esc_textarea( $file ); |
| 65 |
}else{ |
| 66 |
do_action('cf7sg_default_custom_css_template', $cf7_key); |
| 67 |
} |
| 68 |
?> |
| 69 |
</textarea> |
| 70 |
</div> |
| 71 |
</div> |
| 72 |
|
| 73 |
<div id="form-editor-tabs"> |
| 74 |
<ul> |
| 75 |
<li><a class="button" href="#cf7-editor-grid"><?=__('Grid','cf7-grid-layout')?></a></li> |
| 76 |
<li><a class="button" href="#cf7-codemirror"><HTML/></a></li> |
| 77 |
</ul> |
| 78 |
<div id="cf7-editor-grid"> |
| 79 |
<div id="grid-form"></div> |
| 80 |
</div> |
| 81 |
<div id="cf7-codemirror"> |
| 82 |
<div class="codemirror-theme"><?=__('Editor theme:','cf7-grid-layout')?> |
| 83 |
<?php $user_theme = get_user_meta(get_current_user_id(),'_cf7sg_cm_theme', true);?> |
| 84 |
<label> |
| 85 |
<input type="radio" value="light" name="cf7sg_codemirror_theme"<?=('light'==$user_theme ? ' checked' : '')?>/><?=__('Light','cf7-grid-layout')?> |
| 86 |
</label> |
| 87 |
<label> |
| 88 |
<input type="radio" value="dark" name="cf7sg_codemirror_theme" <?=('dark'==$user_theme ? ' checked' : '')?>/><?=__('Dark','cf7-grid-layout')?> |
| 89 |
</label> |
| 90 |
</div> |
| 91 |
<textarea id="wpcf7-form" class="cf7-sg-hidden codemirror-cf7-update"> |
| 92 |
<?= esc_textarea( $form_post->prop( 'form' ) ); |
| 93 |
/** @since 2.8.3 rename codemirror textarea##wpcf7-form adn initially popullate with form. */?> |
| 94 |
</textarea> |
| 95 |
</div> |
| 96 |
</div> |
| 97 |
</div> |
| 98 |
<textarea id="wpcf7-form-hidden" name="wpcf7-form" class="hidden" data-config-field="form.body"><?= esc_textarea( $form_post->prop( 'form' ) );?></textarea> |
| 99 |
<!-- cf7sg - track embeded sub-forms --> |
| 100 |
<input type="hidden" value="" id="cf7sg-embeded-forms" name="cf7sg-embeded-forms" /> |
| 101 |
<input type="hidden" value="" id="cf7sg-tabs-fields" name="cf7sg-tabs-fields" /> |
| 102 |
<input type="hidden" value="" id="cf7sg-table-fields" name="cf7sg-table-fields" /> |
| 103 |
<input type="hidden" value="" id="cf7sg-toggle-fields" name="cf7sg-toggle-fields" /> |
| 104 |
<input type="hidden" value="" id="cf7sg-tabbed-toggles" name="cf7sg-tabbed-toggles" /> |
| 105 |
<input type="hidden" value="" id="cf7sg-grouped-toggles" name="cf7sg-grouped-toggles" /> |
| 106 |
<div id="bottom-tags"> |
| 107 |
<?php |
| 108 |
$tag_generator = WPCF7_TagGenerator::get_instance(); |
| 109 |
$tag_generator->print_buttons(); |
| 110 |
?> |
| 111 |
</div> |
| 112 |
<div id="grid-row"> |
| 113 |
<div class="container"> |
| 114 |
<div class="row"> |
| 115 |
<div class="columns full"></div> |
| 116 |
<div class="row-controls"> |
| 117 |
<span class="dashicons dashicons-edit row-control"></span> |
| 118 |
<span class="dashicons dashicons-no-alt row-control"></span> |
| 119 |
<span class="dashicons dashicons-move row-control"></span> |
| 120 |
<span class="dashicons dashicons-plus row-control"></span> |
| 121 |
<span class="dashicons dashicons-trash row-control"></span> |
| 122 |
<div class="grid-controls"> |
| 123 |
<label class="collapsible-row-label unique-mod"> |
| 124 |
<?=__('Row collapsible','cf7-grid-layout')?> |
| 125 |
<input type="checkbox" class="collapsible-row" /> |
| 126 |
</label> |
| 127 |
<label class="cf7-sg-hidden table-row-label unique-mod"> |
| 128 |
<?=__('Row table input','cf7-grid-layout')?> |
| 129 |
<input type="checkbox" class="table-row" /> |
| 130 |
</label> |
| 131 |
<label class="table-row-button"> |
| 132 |
<?=__('Button label','cf7-grid-layout')?> |
| 133 |
<input type="text" value="<?= __('Add Row','cf7-grid-layout')?>"/> |
| 134 |
</label> |
| 135 |
<label class="cf7-sg-hidden footer-row-label unique-mod"> |
| 136 |
<?=__('Row table footer','cf7-grid-layout')?> |
| 137 |
<input type="checkbox" class="footer-row" /> |
| 138 |
</label> |
| 139 |
<label class="cf7-sg-hidden tabs-row-label unique-mod"> |
| 140 |
<?=__('Tabbed section','cf7-grid-layout')?> |
| 141 |
<input type="checkbox" class="tabs-row" /> |
| 142 |
</label> |
| 143 |
<a class="display-none button make-grid row-control" href="javascript:void(0);"><?= __('Make grid', 'cf7-grid-layout');?></a> |
| 144 |
</div> |
| 145 |
</div> |
| 146 |
</div> |
| 147 |
</div> |
| 148 |
</div> |
| 149 |
<div id="grid-cf7-forms"> |
| 150 |
<div class="cf7sg-external-form" data-form=""> |
| 151 |
<div class="form-controls"> |
| 152 |
<select class="form-select"> |
| 153 |
<option value=""><?=__('Select contact form 7','cf7-grid-layout')?></option> |
| 154 |
<?php |
| 155 |
$cf7_forms = get_posts(array( |
| 156 |
'post_type' => 'wpcf7_contact_form', |
| 157 |
'post_status'=> 'publish', |
| 158 |
'posts_per_page' => -1, |
| 159 |
'post__not_in' => array($form_post->id()) |
| 160 |
)); |
| 161 |
if(!empty($cf7_forms)): |
| 162 |
foreach($cf7_forms as $cf7_form): |
| 163 |
?> |
| 164 |
<option value="<?php echo $cf7_form->post_name ?>"><?php echo $cf7_form->post_title ?></option> |
| 165 |
<?php endforeach; |
| 166 |
wp_reset_postdata(); |
| 167 |
endif; |
| 168 |
?> |
| 169 |
</select> |
| 170 |
<div class="row-controls"> |
| 171 |
<span class="dashicons dashicons-move form-control"></span> |
| 172 |
<span class="dashicons dashicons-plus form-control"></span> |
| 173 |
<span class="dashicons dashicons-trash form-control"></span> |
| 174 |
</div> |
| 175 |
</div> |
| 176 |
<div class="cf7sg-external-form-content"></div> |
| 177 |
</div> |
| 178 |
</div> |
| 179 |
<div id="grid-collapsible"> |
| 180 |
<div class="cf7sg-collapsible-title"><label><?=__('Section title','cf7-grid-layout')?> <input type="text" /><input type="hidden" /><input type="checkbox" /><span><?=__('toggled','cf7-grid-layout')?></span></label></div> |
| 181 |
</div> |
| 182 |
<div id="grid-collapsible-with-toggle"> |
| 183 |
<div class="toggle toggle-light" data-on="Yes" data-off="No"></div> |
| 184 |
</div> |
| 185 |
<div id="grid-tabs"> |
| 186 |
<ul class="cf7-sg-tabs-list"> |
| 187 |
<li><a href="" class="cf7-sg-hidden"></a><label><?=__('Tab label','cf7-grid-layout')?><input type="text" /></label></li> |
| 188 |
</ul> |
| 189 |
</div> |
| 190 |
<div id="grid-helper"> |
| 191 |
<span class="dashicons dashicons-no-alt"></span> |
| 192 |
<span class="copy-helper"><?=__('Click to copy!','cf7-grid-layout')?></span> |
| 193 |
<p><?=__('Click-to-copy & paste in your <em>functions.php</em> file.','cf7-grid-layout')?></p> |
| 194 |
<ul class="cf7sg-helper-list"></ul> |
| 195 |
</div> |
| 196 |
<div id="grid-js-helper"> |
| 197 |
<span class="dashicons dashicons-no-alt"></span> |
| 198 |
<span class="copy-helper"><?=__('Click to copy!','cf7-grid-layout')?></span> |
| 199 |
<p class="js-help"><?= sprintf(__('Click-to-copy & paste in<br/><em><theme folder>/js/%s.js</em> file.','cf7-grid-layout'), $cf7_key);?></p> |
| 200 |
<ul class="cf7sg-helper-list"></ul> |
| 201 |
</div> |
| 202 |
<div id="grid-col"> |
| 203 |
<div class="grid-column"> |
| 204 |
<span class="dashicons dashicons-edit column-control"></span> |
| 205 |
<span class="dashicons dashicons-no-alt column-control"></span> |
| 206 |
<span class="dashicons dashicons-plus column-control"></span> |
| 207 |
<span class="dashicons php-icon column-control" style="display:none;"></span> |
| 208 |
<span class="js-icon column-control" style="display:none;"></span> |
| 209 |
<span class="dashicons dashicons-trash column-control"></span> |
| 210 |
<span class="dashicons dashicons-move column-control"></span> |
| 211 |
<span class="icon-code column-control"></span> |
| 212 |
<div class="grid-controls"> |
| 213 |
<?=__('Column offset:','cf7-grid-layout')?><br /> |
| 214 |
<select class="column-offset select2 column-setting"> |
| 215 |
<option value="" selected><?=__('no offset','cf7-grid-layout')?></option> |
| 216 |
<option value="offset-one"><?=__('one (1/12<sup>th</sup>)','cf7-grid-layout')?></option> |
| 217 |
<option value="offset-two"><?=__('two (1/6<sup>th</sup>)','cf7-grid-layout')?></option> |
| 218 |
<option value="offset-three"><?=__('three (1/4<sup>th</sup>)','cf7-grid-layout')?></option> |
| 219 |
<option value="offset-four"><?=__('four (1/3<sup>rd</sup>)','cf7-grid-layout')?></option> |
| 220 |
<option value="offset-five"><?=__('five (5/12<sup>ths</sup>)','cf7-grid-layout')?></option> |
| 221 |
<option value="offset-six"><?=__('half','cf7-grid-layout')?></option> |
| 222 |
<option value="offset-seven"><?=__('seven (7/12<sup>ths</sup>)','cf7-grid-layout')?></option> |
| 223 |
<option value="offset-eight"><?=__('eight (2/3<sup>rds</sup>)','cf7-grid-layout')?></option> |
| 224 |
<option value="offset-nine"><?=__('nine (3/4<sup>ths</sup>)','cf7-grid-layout')?></option> |
| 225 |
<option value="offset-ten"><?=__('ten (5/6<sup>ths</sup>)','cf7-grid-layout')?></option> |
| 226 |
<option value="offset-eleven"><?=__('eleven (11/12<sup>ths</sup>)','cf7-grid-layout')?></option> |
| 227 |
</select> |
| 228 |
<?=__('Column size:','cf7-grid-layout')?><br /> |
| 229 |
<select class="column-size select2 column-setting"> |
| 230 |
<option value="one"><?=__('one (1/12<sup>th</sup>)','cf7-grid-layout')?></option> |
| 231 |
<option value="two"><?=__('two (1/6<sup>th</sup>)','cf7-grid-layout')?></option> |
| 232 |
<option value="one-fourth"><?=__('three (1/4<sup>th</sup>)','cf7-grid-layout')?></option> |
| 233 |
<option value="one-third"><?=__('four (1/3<sup>rd</sup>)','cf7-grid-layout')?></option> |
| 234 |
<option value="five"><?=__('five (5/12<sup>ths</sup>)','cf7-grid-layout')?></option> |
| 235 |
<option value="one-half"><?=__('half width','cf7-grid-layout')?></option> |
| 236 |
<option value="seven"><?=__('seven (7/12<sup>ths</sup>)','cf7-grid-layout')?></option> |
| 237 |
<option value="two-thirds"><?=__('eight (2/3<sup>rds</sup>)','cf7-grid-layout')?></option> |
| 238 |
<option value="nine"><?=__('nine (3/4<sup>ths</sup>)','cf7-grid-layout')?></option> |
| 239 |
<option value="ten"><?=__('ten (5/6<sup>ths</sup>)','cf7-grid-layout')?></option> |
| 240 |
<option value="eleven"><?=__('eleven (11/12<sup>ths</sup>)','cf7-grid-layout')?></option> |
| 241 |
<option value="full" selected><?=__('full width','cf7-grid-layout')?></option> |
| 242 |
</select> |
| 243 |
<a id="new-row" class="button make-grid column-control" href="javascript:void(0);"><?= __('Make grid', 'cf7-grid-layout');?></a> |
| 244 |
<a class="button external-form" href="javascript:void(0);"><?= __('Insert form', 'cf7-grid-layout');?></a> |
| 245 |
<label class="display-none accordion-label grouping-option"><input type="checkbox" name="grouping-option" class="accordion-rows column-control" /><?=__('Enable accordion','cf7-smart-grid')?></label><span class="popup display-none"><?= __('Group collapsible rows as jQuery accordion','cf7-smart-grid')?></span> |
| 246 |
<label class="display-none slider-label grouping-option"><input type="checkbox" name="grouping-option" class="slider-rows column-control" /><?=__('Enable slider','cf7-smart-grid')?></label><span class="popup display-none"><?= __('Convert collapsible rows into sides','cf7-smart-grid')?></span> |
| 247 |
</div> |
| 248 |
<div class="cf7-field-label cf7-field-inner"> |
| 249 |
<p class="content"><?=__('Field label','cf7-grid-layout')?></p> |
| 250 |
<input type="text" placeholder="<?=__('Field label','cf7-grid-layout')?>"/> |
| 251 |
<span class="dashicons dashicons-no-alt field-control"></span> |
| 252 |
</div> |
| 253 |
<div class="cf7-field-type cf7-field-inner"> |
| 254 |
<p class="content"><?=__('[select a field]','cf7-grid-layout')?></p> |
| 255 |
<textarea class="field-entry" placeholder="<?=__('select a field','cf7-grid-layout')?>"></textarea> |
| 256 |
<span class="dashicons dashicons-no-alt field-control"></span> |
| 257 |
</div> |
| 258 |
<div class="cf7-field-tip cf7-field-inner"> |
| 259 |
<p class="content"><?=__('describe your field','cf7-grid-layout')?></p> |
| 260 |
<input type="text" placeholder="<?=__('describe your field here','cf7-grid-layout')?>" /> |
| 261 |
<span class="dashicons dashicons-no-alt field-control"></span> |
| 262 |
</div> |
| 263 |
<textarea class="grid-input"></textarea> |
| 264 |
</div> |
| 265 |
</div> |
| 266 |
<?php |
| 267 |
|