PluginProbe
WP Directory Kit / 1.3.1
WP Directory Kit v1.3.1
1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 1.4.0 1.4.1 All 35 releases
wpdirectorykit / application / views / wdk_settings / index.php

index.php in WP Directory Kit 1.3.1, at application/views/wdk_settings/index.php

238 lines 11.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The template for Settings.
4 *
5 * This is the template that edit form settings
6 *
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly.
11 }
12
13
14 ?>
15 <!-- This file should primarily consist of HTML with a little bit of PHP. -->
16
17 <div class="wrap wdk-wrap">
18 <h1 class="wp-heading-inline"><?php echo __('Settings', 'wpdirectorykit'); ?></h1>
19 <br />
20 <div class="wdk-body">
21 <form method="post" action="" novalidate="novalidate">
22 <?php wp_nonce_field( 'wdk-settings-edit', '_wpnonce'); ?>
23 <?php
24 $form->messages('class="alert alert-danger"', __('Successfully saved', 'wpdirectorykit'));
25 ?>
26 <?php if(!get_option('wdk_results_page')):?>
27 <p class="alert alert-info"><?php echo __('Missing results page', 'wpdirectorykit'); ?></p>
28 <?php endif;?>
29
30 <div class="wdk-tabs-navs">
31 <label for="wdk_tab_general"<?php if(!wmvc_show_data('wdk_tabs',$_POST, false) || wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_general'):?> class="active" <?php endif;?>><?php echo esc_html__('General','wpdirectorykit');?></label>
32 <label for="wdk_tab_apis" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_apis'):?> class="active" <?php endif;?>><?php echo esc_html__('Api-s','wpdirectorykit');?></label>
33 <label for="wdk_tab_templates" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_templates'):?> class="active" <?php endif;?>><?php echo esc_html__('Templates','wpdirectorykit');?></label>
34 <label for="wdk_tab_fields" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_fields'):?> class="active" <?php endif;?>><?php echo esc_html__('Fields','wpdirectorykit' );?></label>
35 <label for="wdk_tab_tools" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_tools'):?> class="active" <?php endif;?>><?php echo esc_html__('Tools','wpdirectorykit' );?></label>
36 <?php if(get_option('wdk_experimental_features')):?>
37 <label for="wdk_tab_experimental" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_experimental'):?> class="active" <?php endif;?>><?php echo esc_html__('Experimental','wpdirectorykit' );?></label>
38 <?php endif;?>
39 </div>
40 <div class="postbox" style="display: block;">
41 <div class="inside">
42 <div class="wdk-tabs-panel">
43 <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_general" checked value="wdk_tab_general">
44 <div class="wdk-tab">
45 <?php echo wdk_generate_fields($fields_list_tabs['general'], $db_data); ?>
46 </div>
47
48 <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_apis" value="wdk_tab_apis" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_apis'):?> checked="checked" <?php endif;?>>
49 <div class="wdk-tab">
50 <?php echo wdk_generate_fields($fields_list_tabs['apis'], $db_data); ?>
51 </div>
52
53 <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_templates" value="wdk_tab_templates" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_templates'):?> checked="checked" <?php endif;?>>
54 <div class="wdk-tab">
55 <?php echo wdk_generate_fields($fields_list_tabs['templates'], $db_data); ?>
56 </div>
57
58 <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_fields" value="wdk_tab_fields" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_fields'):?> checked="checked" <?php endif;?>>
59 <div class="wdk-tab">
60 <?php echo wdk_generate_fields($fields_list_tabs['fields'], $db_data); ?>
61 </div>
62
63 <?php if(get_option('wdk_experimental_features')):?>
64 <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_experimental" value="wdk_tab_experimental" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_experimental'):?> checked="checked" <?php endif;?>>
65 <div class="wdk-tab">
66 <?php echo wdk_generate_fields($fields_list_tabs['experimental'], $db_data); ?>
67 </div>
68 <?php endif;?>
69
70 <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_tools" value="wdk_tab_tools" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_tools'):?> checked="checked" <?php endif;?>>
71 <div class="wdk-tab">
72 <div class="wdk-field-edit">
73 <a href="<?php echo esc_url(get_admin_url() . "admin.php?page=wdk_settings&function=remove&_wpnonce=".wp_create_nonce( 'remove-data')); ?>"
74 class="button button-primary event-ajax-indicator confirm" id="reset_data_field_button"><?php echo __('Remove plugin data (Listings, fields, location, categories)','wpdirectorykit'); ?></a>
75 <span class="wdk-ajax-indicator wdk-infinity-load color-primary dashicons dashicons-update-alt hidden" style="margin-top: 4px;margin-left: 4px;"></span>
76 </div>
77 <div class="wdk-field-edit">
78 <a href="<?php echo esc_url(get_admin_url() . "admin.php?page=wdk_settings&function=import_demo"); ?>" class="button button-primary" id="import_demo_field_button"><?php echo __('Import Demo Data','wpdirectorykit'); ?></a>
79 </div>
80 <div class="wdk-field-edit">
81 <a href="#" class="button button-primary" id="generate_listings_images_path"><?php echo __('Generate Listings Images Path','wpdirectorykit'); ?></a>
82 </div>
83 <div class="wdk-field-edit">
84 <a href="#" class="button button-primary" id="optimization_listingfields_table"><?php echo __('Optimization Listing Fields Table','wpdirectorykit'); ?></a>
85 </div>
86 <div class="wdk-field-edit">
87 <a href="#" class="button button-primary ajax_query" data-function="generated_strings"><?php echo __('Generate translation strings','wpdirectorykit'); ?></a>
88 </div>
89 </div>
90 </div>
91 </div>
92 </div>
93 <input type="submit" name="submit" id="submit" class="button button-primary" value="<?php echo __('Save Changes', 'wpdirectorykit'); ?>">
94 </form>
95 </div>
96 <br/>
97 <div class="alert alert-info" role="alert"><a href="//wpdirectorykit.com/documentation/#change_currency" target="_blank"><?php echo __('How to change currency?','wpdirectorykit'); ?></a></div>
98 </div>
99
100 <script>
101 jQuery(document).ready(function($) {
102 $('#reset_data_field_button').on('click', function(e){
103 var self = $(this);
104
105 var res = prompt("<?php echo __('Are you sure? All Listings, fields, categories, locations will be completely removed, check url and type remove if you are sure', 'wpdirectorykit')?>", "");
106
107 if(res == "<?php echo __('remove', 'wpdirectorykit')?>") {
108 return true;
109 } else {
110 e.preventDefault();
111 e.stopPropagation();
112 $(this).parent().find('.wdk-ajax-indicator').addClass('hidden');
113 return false;
114 }
115 })
116 $('#generate_listings_images_path').on('click', function(e){
117 e.preventDefault();
118 e.stopPropagation();
119 var self = $(this);
120
121 if(self.attr('disabled')) {
122 return false;
123 }
124
125 self.addClass('wdk_btn_load_indicator out');
126
127 self.attr('disabled','disabled');
128 var ajax_param = {
129 "page": 'wdk_backendajax',
130 "function": 'generated_listings_images_path',
131 "action": 'wdk_public_action',
132 "_wpnonce": '<?php echo esc_js(wp_create_nonce( 'wdk-generated_listings_images_path'));?>',
133 };
134 $.post("<?php echo admin_url( 'admin-ajax.php' );?>", ajax_param,
135 function(data){
136
137 if(data.popup_text_success)
138 wdk_log_notify(data.popup_text_success);
139
140 if(data.popup_text_error)
141 wdk_log_notify(data.popup_text_error, 'error');
142
143 if(data.success) {
144 self.removeClass('wdk_btn_load_indicator out');
145 self.addClass('wdk_btn_load_success out');
146 } else {
147 self.removeClass('wdk_btn_load_indicator out');
148 self.addClass('wdk_btn_load_error out');
149 }
150 }).always(function(data) {
151
152 });
153 return false;
154 })
155
156 $('#optimization_listingfields_table').on('click', function(e){
157 e.preventDefault();
158 e.stopPropagation();
159 var self = $(this);
160
161 if(self.attr('disabled')) {
162 return false;
163 }
164
165 self.addClass('wdk_btn_load_indicator out');
166
167 self.attr('disabled','disabled');
168 var ajax_param = {
169 "page": 'wdk_backendajax',
170 "function": 'optimization_listingfields_table',
171 "action": 'wdk_public_action',
172 "_wpnonce": '<?php echo esc_js(wp_create_nonce( 'wdk-optimization_listingfields_table'));?>',
173 };
174 $.post("<?php echo admin_url( 'admin-ajax.php' );?>", ajax_param,
175 function(data){
176
177 if(data.popup_text_success)
178 wdk_log_notify(data.popup_text_success);
179
180 if(data.popup_text_error)
181 wdk_log_notify(data.popup_text_error, 'error');
182
183 if(data.success) {
184 self.removeClass('wdk_btn_load_indicator out');
185 self.addClass('wdk_btn_load_success out');
186 } else {
187 self.removeClass('wdk_btn_load_indicator out');
188 self.addClass('wdk_btn_load_error out');
189 }
190 }).always(function(data) {
191
192 });
193 return false;
194 })
195
196 $('.ajax_query').on('click', function(e){
197 e.preventDefault();
198 e.stopPropagation();
199 var self = $(this);
200
201 if(self.attr('disabled')) {
202 return false;
203 }
204
205 self.addClass('wdk_btn_load_indicator out');
206
207 self.attr('disabled','disabled');
208 var ajax_param = {
209 "page": 'wdk_backendajax',
210 "function": self.data('function'),
211 "action": 'wdk_public_action',
212 "_wpnonce": '<?php echo esc_js(wp_create_nonce( 'wdk-backendajax'));?>',
213 };
214 $.post("<?php echo admin_url( 'admin-ajax.php' );?>", ajax_param,
215 function(data){
216
217 if(data.popup_text_success)
218 wdk_log_notify(data.popup_text_success);
219
220 if(data.popup_text_error)
221 wdk_log_notify(data.popup_text_error, 'error');
222
223 if(data.success) {
224 self.removeClass('wdk_btn_load_indicator out');
225 self.addClass('wdk_btn_load_success out');
226 } else {
227 self.removeClass('wdk_btn_load_indicator out');
228 self.addClass('wdk_btn_load_error out');
229 }
230 }).always(function(data) {
231
232 });
233 return false;
234 })
235 })
236 </script>
237
238 <?php $this->view('general/footer', $data); ?>