PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 1.07.11
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v1.07.11
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / controllers / FrmSettingsController.php

FrmSettingsController.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 1.07.11, at classes/controllers/FrmSettingsController.php

90 lines 3.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package Formidable
4 */
5
6 if(!defined('ABSPATH')) die('You are not allowed to call this page directly.');
7
8 if(class_exists('FrmSettingsController'))
9 return;
10
11 class FrmSettingsController{
12 public static function load_hooks(){
13 add_action('admin_menu', 'FrmSettingsController::menu', 45);
14 add_action('frm_before_settings', 'FrmSettingsController::license_box');
15 }
16
17 public static function menu(){
18 add_submenu_page('formidable', 'Formidable | '. __('Global Settings', 'formidable'), __('Global Settings', 'formidable'), 'frm_change_settings', 'formidable-settings', 'FrmSettingsController::route');
19 }
20
21 public static function license_box(){
22 $a = isset($_GET['t']) ? $_GET['t'] : 'general_settings';
23 include(FrmAppHelper::plugin_path() .'/classes/views/frm-settings/license_box.php');
24 }
25
26 public static function display_form($errors=array(), $message=''){
27 global $frm_settings, $frm_vars;
28
29 $frm_roles = FrmAppHelper::frm_capabilities();
30
31 $uploads = wp_upload_dir();
32 $target_path = $uploads['basedir'] . '/formidable/css';
33 $sections = apply_filters('frm_add_settings_section', array(
34 'styling' => array('name' => __('Form Styling', 'formidable'), 'class' => 'FrmSettingsController', 'function' => 'styling_tab')
35 ));
36
37 $recaptcha_themes = array(
38 'red' => __('Red', 'formidable'),
39 'white' => __('White', 'formidable'),
40 'blackglass' => __('Black Glass', 'formidable'),
41 'clean' => __('Clean', 'formidable'),
42 //'custom' => __('Custom', 'formidable'),
43 );
44
45 require(FrmAppHelper::plugin_path() .'/classes/views/frm-settings/form.php');
46 }
47
48 public static function process_form($stop_load=false){
49 global $frm_settings, $frm_vars;
50
51 if(!isset($_POST['process_form']) or !wp_verify_nonce($_POST['process_form'], 'process_form_nonce'))
52 wp_die($frm_settings->admin_permission);
53
54 $errors = array();
55 $message = '';
56
57 if(!isset($frm_vars['settings_routed']) or !$frm_vars['settings_routed']){
58 //$errors = $frm_settings->validate($_POST,array());
59 $frm_settings->update(stripslashes_deep($_POST));
60
61 if( empty($errors) ){
62 $frm_settings->store();
63 $message = __('Settings Saved', 'formidable');
64 }
65 }else{
66 $message = __('Settings Saved', 'formidable');
67 }
68
69 if($stop_load == 'stop_load'){
70 $frm_vars['settings_routed'] = true;
71 return;
72 }
73
74 self::display_form($errors, $message);
75 }
76
77 public static function styling_tab(){
78 include(FrmAppHelper::plugin_path() .'/classes/views/frm-settings/styling_tab.php');
79 }
80
81 public static function route($stop_load=false){
82 $action = isset($_REQUEST['frm_action']) ? 'frm_action' : 'action';
83 $action = FrmAppHelper::get_param($action);
84 if($action == 'process-form')
85 return self::process_form($stop_load);
86 else if($stop_load != 'stop_load')
87 return self::display_form();
88 }
89 }
90