PluginProbe ʕ •ᴥ•ʔ
Email Encoder – Protect Email Addresses and Phone Numbers / 2.0.5
Email Encoder – Protect Email Addresses and Phone Numbers v2.0.5
2.5.0 2.4.8 trunk 0.10 0.11 0.12 0.20 0.21 0.22 0.30 0.31 0.32 0.40 0.41 0.42 0.50 0.60 0.70 0.71 0.80 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.5 1.5.2 1.51 1.53 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.10 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7
email-encoder-bundle / core / includes / partials / widgets / main.php
email-encoder-bundle / core / includes / partials / widgets Last commit date
main.php 6 years ago sidebar.php 6 years ago
main.php
105 lines
1 <?php
2
3 $settings = EEB()->settings->get_setting();
4 $advanced_settings = (bool) EEB()->settings->get_setting( 'advanced_settings', true );
5
6 ?>
7 <div id="post-body-content">
8 <div class="postbox">
9 <div class="inside">
10 <fieldset>
11 <table class="form-table">
12 <?php foreach( $settings as $setting_name => $setting ) :
13 $hide_main_layer = '';
14
15 if( ! $advanced_settings && isset( $setting['advanced'] ) && $setting['advanced'] === true ){
16 $hide_main_layer = 'style="display:none !important;"';
17 }
18
19 //Validate settings value
20 $main_settings_value = '';
21 if( isset( $setting['value'] ) ){
22 $main_settings_value = $setting['value'];
23 }
24
25 $is_checked = ( $setting['type'] == 'checkbox' && ( $main_settings_value === 1 || $main_settings_value === '1' ) ) ? 'checked' : '';
26 $value = ( $setting['type'] != 'checkbox' && $setting['type'] != 'multi-input' ) ? $main_settings_value : '1';
27
28 ?>
29 <tr valign="top" <?php echo $hide_main_layer; ?>>
30 <th scope="row">
31 <?php echo $setting['title']; ?>
32 </th>
33 <td scope="row" valign="top">
34 <p>
35 <?php if( $setting['type'] === 'multi-input' ) : ?>
36 <?php foreach( $setting['inputs'] as $si_key => $data ) :
37 $hide_sub_layer = '';
38
39 if( ! $advanced_settings && isset( $data['advanced'] ) && $data['advanced'] === true ){
40 $hide_sub_layer = 'style="display:none !important;"';
41 }
42
43 //Always set the radio value of single inputs to their key
44 if( $setting['input-type'] === 'radio' ){
45 $data['value'] = $si_key;
46 }
47
48 $mi_is_checked = ( $setting['input-type'] == 'checkbox' && ( isset( $data['value'] ) && ( $data['value'] === 1 || $data['value'] === '1' ) ) ) ? 'checked' : '';
49 $mi_value = ( $setting['input-type'] != 'checkbox' ) ? $data['value'] : '1';
50 $si_name = $si_key;
51
52 //Re-validate for radio inputs
53 if( $setting['input-type'] == 'radio' ){
54 $si_name = $setting_name;
55
56 //Check radio button
57 if( (string) $main_settings_value === (string) $data['value'] ){
58 $mi_is_checked = 'checked';
59 }
60 }
61 ?>
62 <p <?php echo $hide_sub_layer; ?>>
63 <input id="<?php echo $si_name . '_' . $si_key; ?>" name="<?php echo $this->settings_key; ?>[<?php echo $si_name; ?>]" type="<?php echo $setting['input-type']; ?>" class="regular-text" value="<?php echo $mi_value; ?>" <?php echo $mi_is_checked; ?> />
64 <label for="<?php echo $si_name . '_' . $si_key; ?>">
65 <?php echo $data['label']; ?>
66 </label>
67 </p>
68 <?php if( isset( $data['description'] ) ) : ?>
69 <p class="description" <?php echo $hide_sub_layer; ?>>
70 <?php if( in_array( $setting['input-type'], array( 'checkbox', 'radio' ) ) ) : ?>
71 <input name="email-encoder-bundle-hidden-margin" type="radio" class="regular-text" value="" style="visibility:hidden !important;pointer-events:none !important;"/>
72 <?php endif; ?>
73 <?php echo $data['description']; ?>
74 </p>
75 <?php endif; ?>
76 <?php endforeach; ?>
77 <?php else : ?>
78 <input id="<?php echo $setting['id']; ?>" name="<?php echo $this->settings_key; ?>[<?php echo $setting_name; ?>]" type="<?php echo $setting['type']; ?>" class="regular-text" value="<?php echo $value; ?>" <?php echo $is_checked; ?> />
79 <?php if( isset( $setting['label'] ) ) : ?>
80 <label for="<?php echo $setting_name; ?>">
81 <?php echo $setting['label']; ?>
82 </label>
83 <?php endif; ?>
84 <?php endif; ?>
85 </p>
86 <?php if( isset( $setting['description'] ) ) : ?>
87 <p class="description">
88 <?php echo $setting['description']; ?>
89 </p>
90 <?php endif; ?>
91 </td>
92 <td>
93
94 </td>
95 </tr>
96 <?php endforeach; ?>
97 </table>
98 </fieldset>
99
100 <p>
101 <?php submit_button( __( 'Save all', 'email-encoder-bundle' ) ); ?>
102 </p>
103 </div>
104 </div>
105 </div>