PluginProbe
WP Directory Kit / 1.2.3
WP Directory Kit v1.2.3
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.2.3, at application/views/wdk_settings/index.php

198 lines 8.2 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 <!-- This file should primarily consist of HTML with a little bit of PHP. -->
14
15 <div class="wrap wdk-wrap">
16 <h1 class="wp-heading-inline"><?php echo __('Settings', 'wpdirectorykit'); ?></h1>
17 <br /><br />
18 <div class="wdk-body">
19 <form method="post" action="" novalidate="novalidate">
20 <?php wp_nonce_field( 'wdk-settings-edit', '_wpnonce'); ?>
21 <div class="postbox" style="display: block;">
22 <div class="postbox-header">
23 <h3><?php echo __('General Settings', 'wpdirectorykit'); ?></h3>
24 </div>
25 <div class="inside">
26 <?php
27 $form->messages('class="alert alert-danger"', __('Successfully saved', 'wpdirectorykit'));
28 ?>
29 <?php if(!get_option('wdk_results_page')):?>
30 <p class="alert alert-info"><?php echo __('Missing results page', 'wpdirectorykit'); ?></p>
31 <?php endif;?>
32 <?php echo wdk_generate_fields($fields, $db_data); ?>
33 <div class="wdk-field-edit">
34 <a href="<?php echo get_admin_url() . "admin.php?page=wdk_settings&function=remove&_wpnonce=".wp_create_nonce( 'remove-data'); ?>"
35
36 class="button button-primary event-ajax-indicator confirm" id="reset_data_field_button"><?php echo __('Remove plugin data (Listings, fields, location, categories)','wpdirectorykit'); ?></a>
37 <span class="wdk-ajax-indicator wdk-infinity-load color-primary dashicons dashicons-update-alt hidden" style="margin-top: 4px;margin-left: 4px;"></span>
38 </div>
39 <div class="wdk-field-edit">
40 <a href="<?php echo 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>
41 </div>
42 <div class="wdk-field-edit">
43 <a href="#" class="button button-primary" id="generate_listings_images_path"><?php echo __('Generate Listings Images Path','wpdirectorykit'); ?></a>
44 </div>
45 <div class="wdk-field-edit">
46 <a href="#" class="button button-primary" id="optimization_listingfields_table"><?php echo __('Optimization Listing Fields Table','wpdirectorykit'); ?></a>
47 </div>
48 <div class="wdk-field-edit">
49 <a href="#" class="button button-primary ajax_query" data-function="generated_strings"><?php echo __('Generate translation strings','wpdirectorykit'); ?></a>
50 </div>
51 </div>
52 </div>
53 <input type="submit" name="submit" id="submit" class="button button-primary" value="<?php echo __('Save Changes', 'wpdirectorykit'); ?>">
54 </form>
55 </div>
56 <br/>
57 <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>
58 </div>
59
60 <script>
61 jQuery(document).ready(function($) {
62 $('#reset_data_field_button').on('click', function(e){
63 var self = $(this);
64
65 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')?>", "");
66
67 if(res == "<?php echo __('remove', 'wpdirectorykit')?>") {
68 return true;
69 } else {
70 e.preventDefault();
71 e.stopPropagation();
72 $(this).parent().find('.wdk-ajax-indicator').addClass('hidden');
73 return false;
74 }
75 })
76 $('#generate_listings_images_path').on('click', function(e){
77 e.preventDefault();
78 e.stopPropagation();
79 var self = $(this);
80
81 if(self.attr('disabled')) {
82 return false;
83 }
84
85 self.addClass('wdk_btn_load_indicator out');
86
87 self.attr('disabled','disabled');
88 var ajax_param = {
89 "page": 'wdk_backendajax',
90 "function": 'generated_listings_images_path',
91 "action": 'wdk_public_action',
92 "_wpnonce": '<?php echo esc_js(wp_create_nonce( 'wdk-generated_listings_images_path'));?>',
93 };
94 $.post("<?php echo admin_url( 'admin-ajax.php' );?>", ajax_param,
95 function(data){
96
97 if(data.popup_text_success)
98 wdk_log_notify(data.popup_text_success);
99
100 if(data.popup_text_error)
101 wdk_log_notify(data.popup_text_error, 'error');
102
103 if(data.success) {
104 self.removeClass('wdk_btn_load_indicator out');
105 self.addClass('wdk_btn_load_success out');
106 } else {
107 self.removeClass('wdk_btn_load_indicator out');
108 self.addClass('wdk_btn_load_error out');
109 }
110 }).always(function(data) {
111
112 });
113 return false;
114 })
115
116 $('#optimization_listingfields_table').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": 'optimization_listingfields_table',
131 "action": 'wdk_public_action',
132 "_wpnonce": '<?php echo esc_js(wp_create_nonce( 'wdk-optimization_listingfields_table'));?>',
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 $('.ajax_query').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": self.data('function'),
171 "action": 'wdk_public_action',
172 "_wpnonce": '<?php echo esc_js(wp_create_nonce( 'wdk-backendajax'));?>',
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 </script>
197
198 <?php $this->view('general/footer', $data); ?>