| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
die( 'You are not allowed to call this page directly.' ); |
| 4 |
} |
| 5 |
?> |
| 6 |
<div id="taxonomy-linkcategory" class="categorydiv <?php echo esc_attr( $class ); ?>"> |
| 7 |
<ul id="frm-nav-tabs" class="frm-nav-tabs <?php echo esc_attr( $settings_tab ? '' : 'frm-compact-nav' ); ?>"> |
| 8 |
<li class="frm-tabs"> |
| 9 |
<a href="#frm-insert-fields-box" id="frm_insert_fields_tab"> |
| 10 |
<?php esc_html_e( 'Fields', 'formidable' ); ?> |
| 11 |
</a> |
| 12 |
</li> |
| 13 |
<?php if ( ! empty( $cond_shortcodes ) ) { ?> |
| 14 |
<li class="hide-if-no-js"> |
| 15 |
<a href="#frm-conditionals"> |
| 16 |
<?php esc_html_e( 'Conditionals', 'formidable' ); ?> |
| 17 |
</a> |
| 18 |
</li> |
| 19 |
<?php } ?> |
| 20 |
<li class="hide-if-no-js"> |
| 21 |
<a href="#frm-adv-info-tab"> |
| 22 |
<?php esc_html_e( 'Advanced', 'formidable' ); ?> |
| 23 |
</a> |
| 24 |
</li> |
| 25 |
<?php if ( $settings_tab ) { ?> |
| 26 |
<li id="frm_html_tab" class="hide-if-no-js frm_hidden"> |
| 27 |
<a href="#frm-html-tags" id="frm_html_tags_tab"> |
| 28 |
<?php esc_html_e( 'HTML Tags', 'formidable' ); ?> |
| 29 |
</a> |
| 30 |
</li> |
| 31 |
<?php } ?> |
| 32 |
</ul> |
| 33 |
|
| 34 |
<div id="frm-insert-fields-box" class="tabs-panel"> |
| 35 |
<?php |
| 36 |
if ( count( $fields ) > 8 ) { |
| 37 |
echo '<div class="dropdown-item frm-with-search">'; |
| 38 |
FrmAppHelper::show_search_box( |
| 39 |
array( |
| 40 |
'input_id' => 'field', |
| 41 |
'placeholder' => __( 'Search', 'formidable' ), |
| 42 |
'tosearch' => 'frm-customize-list', |
| 43 |
) |
| 44 |
); |
| 45 |
echo '</div>'; |
| 46 |
} |
| 47 |
?> |
| 48 |
|
| 49 |
<ul class="subsubsub"> |
| 50 |
<li><a href="javascript:void(0)" class="current frmids"><?php esc_html_e( 'IDs', 'formidable' ); ?></a> |</li> |
| 51 |
<li><a href="javascript:void(0)" class="frmkeys"><?php esc_html_e( 'Keys', 'formidable' ); ?></a></li> |
| 52 |
</ul> |
| 53 |
<ul class="frm_code_list frm_customize_field_list frm-full-hover"> |
| 54 |
<?php |
| 55 |
if ( ! empty( $fields ) ) { |
| 56 |
foreach ( $fields as $f ) { |
| 57 |
if ( FrmField::is_no_save_field( $f->type ) ) { |
| 58 |
continue; |
| 59 |
} |
| 60 |
|
| 61 |
if ( $f->type == 'data' && ( ! isset( $f->field_options['data_type'] ) || $f->field_options['data_type'] == 'data' || $f->field_options['data_type'] == '' ) ) { |
| 62 |
continue; |
| 63 |
} |
| 64 |
|
| 65 |
FrmFormsHelper::insert_opt_html( |
| 66 |
array( |
| 67 |
'id' => $f->id, |
| 68 |
'key' => $f->field_key, |
| 69 |
'name' => $f->name, |
| 70 |
'type' => $f->type, |
| 71 |
'class' => 'frm-customize-list dropdown-item', |
| 72 |
) |
| 73 |
); |
| 74 |
|
| 75 |
do_action( 'frm_field_code_tab', array( 'field' => $f ) ); |
| 76 |
|
| 77 |
if ( $f->type == 'user_id' ) { |
| 78 |
$uid = $f->id; |
| 79 |
} |
| 80 |
unset( $f ); |
| 81 |
} |
| 82 |
} |
| 83 |
?> |
| 84 |
</ul> |
| 85 |
</div> |
| 86 |
|
| 87 |
<?php |
| 88 |
$show_logic = ! empty( $cond_shortcodes ) && ! empty( $fields ); |
| 89 |
if ( $show_logic ) { |
| 90 |
?> |
| 91 |
<div id="frm-conditionals" class="tabs-panel"> |
| 92 |
<div class="frmcenter"> |
| 93 |
<?php |
| 94 |
FrmHtmlHelper::toggle( |
| 95 |
'frm-id-key-condition', |
| 96 |
'', |
| 97 |
array( |
| 98 |
'checked' => true, |
| 99 |
'on_label' => __( 'Use IDs', 'formidable' ), |
| 100 |
'off_label' => __( 'Use Keys', 'formidable' ), |
| 101 |
'value' => 'id', |
| 102 |
'show_labels' => true, |
| 103 |
'echo' => true, |
| 104 |
) |
| 105 |
); |
| 106 |
?> |
| 107 |
</div> |
| 108 |
|
| 109 |
<div class="frm_grid_container frm-fields frm-mx-sm"> |
| 110 |
<div class="frm1 frm_form_field frm-inline-select"> |
| 111 |
<label for="frm-id-condition"> |
| 112 |
<?php esc_html_e( 'IF', 'formidable' ); ?> |
| 113 |
</label> |
| 114 |
</div> |
| 115 |
|
| 116 |
<div class="frm11 frm_form_field"> |
| 117 |
<select id="frm-id-condition" class="frm-build-logic"> |
| 118 |
<option value="x"> |
| 119 |
<?php esc_html_e( 'Select a Field', 'formidable' ); ?> |
| 120 |
</option> |
| 121 |
<?php |
| 122 |
foreach ( $fields as $f ) { |
| 123 |
?> |
| 124 |
<option value="<?php echo esc_attr( $f->id ); ?>"> |
| 125 |
<?php echo esc_html( $f->name ); ?> |
| 126 |
</option> |
| 127 |
<?php |
| 128 |
} |
| 129 |
?> |
| 130 |
</select> |
| 131 |
<select id="frm-key-condition" class="frm_hidden frm-build-logic"> |
| 132 |
<option value="x"> |
| 133 |
<?php esc_html_e( 'Select a Field', 'formidable' ); ?> |
| 134 |
</option> |
| 135 |
<?php |
| 136 |
foreach ( $fields as $f ) { |
| 137 |
?> |
| 138 |
<option value="<?php echo esc_attr( $f->field_key ); ?>"> |
| 139 |
<?php echo esc_html( $f->name ); ?> |
| 140 |
</option> |
| 141 |
<?php |
| 142 |
} |
| 143 |
?> |
| 144 |
</select> |
| 145 |
</div> |
| 146 |
|
| 147 |
<div class="frm1 frm_form_field"></div> |
| 148 |
<div class="frm11 frm_form_field"> |
| 149 |
<select id="frm-is-condition" class="frm-build-logic"> |
| 150 |
<?php |
| 151 |
foreach ( $cond_shortcodes as $skey => $sname ) { |
| 152 |
?> |
| 153 |
<option value="<?php echo esc_attr( $skey ); ?>"> |
| 154 |
<?php echo esc_html( $sname ); ?> |
| 155 |
</option> |
| 156 |
<?php |
| 157 |
unset( $skey, $sname ); |
| 158 |
} |
| 159 |
?> |
| 160 |
</select> |
| 161 |
</div> |
| 162 |
|
| 163 |
<div class="frm1 frm_form_field"></div> |
| 164 |
<div class="frm11 frm_form_field"> |
| 165 |
<input id="frm-text-condition" type="text" value="" placeholder="<?php esc_attr_e( 'A blank value', 'formidable' ); ?>" class="frm-build-logic" /> |
| 166 |
</div> |
| 167 |
</div> |
| 168 |
<p class="frmcenter frm-mb-0"> |
| 169 |
<?php esc_html_e( 'Click to Insert', 'formidable' ); ?>: |
| 170 |
</p> |
| 171 |
<ul class="frm_code_list frm-full-hover frmcenter frm-m-0"> |
| 172 |
<li> |
| 173 |
<a href="#" id="frm-insert-condition" class="frm_insert_code" data-code="if x equals='']<?php esc_attr_e( 'Conditional content here', 'formidable' ); ?>[/if x"> |
| 174 |
[if x equals=""][/if x] |
| 175 |
</a> |
| 176 |
</li> |
| 177 |
</ul> |
| 178 |
</div> |
| 179 |
<?php |
| 180 |
} |
| 181 |
?> |
| 182 |
|
| 183 |
<div id="frm-adv-info-tab" class="tabs-panel"> |
| 184 |
<div class="dropdown-item frm-with-search"> |
| 185 |
<?php |
| 186 |
FrmAppHelper::show_search_box( |
| 187 |
array( |
| 188 |
'input_id' => 'advanced', |
| 189 |
'placeholder' => __( 'Search', 'formidable' ), |
| 190 |
'tosearch' => 'frm-advanced-list', |
| 191 |
) |
| 192 |
); |
| 193 |
?> |
| 194 |
</div> |
| 195 |
<ul class="frm_code_list frm-full-hover"> |
| 196 |
<?php |
| 197 |
foreach ( $entry_shortcodes as $skey => $sname ) { |
| 198 |
if ( empty( $skey ) ) { |
| 199 |
echo '<li class="clear frm_block"></li>'; |
| 200 |
continue; |
| 201 |
} |
| 202 |
|
| 203 |
$classes = 'frm-advanced-list'; |
| 204 |
$classes .= ( in_array( $skey, array( 'siteurl', 'sitename', 'entry_count' ) ) ) ? ' show_before_content show_after_content' : ''; |
| 205 |
$classes .= ( strpos( $skey, 'default-' ) === 0 ) ? ' hide_frm_not_email_subject' : ''; |
| 206 |
|
| 207 |
FrmFormsHelper::insert_code_html( |
| 208 |
array( |
| 209 |
'code' => $skey, |
| 210 |
'label' => $sname, |
| 211 |
'class' => $classes, |
| 212 |
) |
| 213 |
); |
| 214 |
|
| 215 |
unset( $skey, $sname, $classes ); |
| 216 |
} |
| 217 |
|
| 218 |
foreach ( $advanced_helpers as $helper_type => $helper ) { |
| 219 |
if ( 'user_id' === $helper_type && ! isset( $uid ) ) { |
| 220 |
continue; |
| 221 |
} |
| 222 |
|
| 223 |
if ( isset( $helper['heading'] ) && ! empty( $helper['heading'] ) ) { |
| 224 |
?> |
| 225 |
<li style="padding:0 25px;"> |
| 226 |
<p class="howto"><?php echo esc_html( $helper['heading'] ); ?></p> |
| 227 |
</li> |
| 228 |
<?php |
| 229 |
} |
| 230 |
|
| 231 |
foreach ( $helper['codes'] as $code => $code_label ) { |
| 232 |
if ( isset( $uid ) ) { |
| 233 |
$code = str_replace( '|user_id|', $uid, $code ); |
| 234 |
} else { |
| 235 |
$code = str_replace( '|user_id|', 'x', $code ); |
| 236 |
} |
| 237 |
$include_x = strpos( $code, ' ' ) ? '' : 'x '; |
| 238 |
|
| 239 |
if ( ! is_array( $code_label ) ) { |
| 240 |
$code_label = array( |
| 241 |
'label' => $code_label, |
| 242 |
); |
| 243 |
} |
| 244 |
|
| 245 |
FrmFormsHelper::insert_code_html( |
| 246 |
array( |
| 247 |
'code' => $include_x . $code, |
| 248 |
'label' => $code_label['label'], |
| 249 |
'title' => isset( $code_label['title'] ) ? $code_label['title'] : '', |
| 250 |
'class' => 'frm-advanced-list', |
| 251 |
) |
| 252 |
); |
| 253 |
|
| 254 |
unset( $code ); |
| 255 |
} |
| 256 |
} |
| 257 |
?> |
| 258 |
</ul> |
| 259 |
</div> |
| 260 |
|
| 261 |
<?php |
| 262 |
if ( $settings_tab ) { |
| 263 |
include( FrmAppHelper::plugin_path() . '/classes/views/frm-forms/mb_html_tab.php' ); |
| 264 |
} |
| 265 |
?> |
| 266 |
</div> |
| 267 |
|