PluginProbe ʕ •ᴥ•ʔ
WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets / 2.13
WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets v2.13
3.9.5 3.9.6 4.0.0 4.0.1 4.1.0 trunk 2.12 2.13 2.14 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 3.4.9 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 3.5.6 3.5.7 3.5.8 3.5.9 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.6.9 3.7.0 3.7.1 3.7.2 3.7.3 3.7.3-beta-1.0 3.7.4 3.7.4-beta-1.0 3.7.5 3.7.6 3.7.7 3.7.8 3.7.9 3.8.0 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4
wp-all-import / controllers / admin / settings.php
wp-all-import / controllers / admin Last commit date
help.php 13 years ago home.php 13 years ago import.php 13 years ago manage.php 13 years ago settings.php 13 years ago
settings.php
56 lines
1 <?php
2 /**
3 * Admin Statistics page
4 *
5 * @author Pavel Kulbakin <p.kulbakin@gmail.com>
6 */
7 class PMXI_Admin_Settings extends PMXI_Controller_Admin {
8
9 public function index() {
10 $this->data['post'] = $post = $this->input->post(PMXI_Plugin::getInstance()->getOption());
11
12 if ($this->input->post('is_settings_submitted')) { // save settings form
13 check_admin_referer('edit-settings', '_wpnonce_edit-settings');
14
15 if ( ! preg_match('%^\d+$%', $post['history_file_count'])) {
16 $this->errors->add('form-validation', __('History File Count must be a non-negative integer', 'pmxi_plugin'));
17 }
18 if ( ! preg_match('%^\d+$%', $post['history_file_age'])) {
19 $this->errors->add('form-validation', __('History Age must be a non-negative integer', 'pmxi_plugin'));
20 }
21 if (empty($post['html_entities'])) $post['html_entities'] = 0;
22
23 if ( ! $this->errors->get_error_codes()) { // no validation errors detected
24
25 PMXI_Plugin::getInstance()->updateOption($post);
26 $files = new PMXI_File_List(); $files->sweepHistory(); // adjust file history to new settings specified
27
28 wp_redirect(add_query_arg('pmxi_nt', urlencode(__('Settings saved', 'pmxi_plugin')), $this->baseUrl)); die();
29 }
30 }
31
32 if ($this->input->post('is_templates_submitted')) { // delete templates form
33 $templates_ids = $this->input->post('templates', array());
34 if (empty($templates_ids)) {
35 $this->errors->add('form-validation', __('Templates must be selected', 'pmxi_plugin'));
36 }
37 if ( ! $this->errors->get_error_codes()) { // no validation errors detected
38 $template = new PMXI_Template_Record();
39 foreach ($templates_ids as $template_id) {
40 $template->clear()->set('id', $template_id)->delete();
41 }
42 wp_redirect(add_query_arg('pmxi_nt', urlencode(sprintf(_n('%d template deleted', '%d templates deleted', count($templates_ids), 'pmxi_plugin'), count($templates_ids))), $this->baseUrl)); die();
43 }
44 }
45
46 $this->render();
47 }
48
49 public function dismiss(){
50
51 PMXI_Plugin::getInstance()->updateOption("dismiss", 1);
52
53 exit('OK');
54 }
55
56 }