diff --git a/classes/controllers/FrmAppController.php b/classes/controllers/FrmAppController.php
index b38f4ca167..db46708e60 100644
--- a/classes/controllers/FrmAppController.php
+++ b/classes/controllers/FrmAppController.php
@@ -300,7 +300,7 @@ public static function localize_script($location) {
'nonce' => wp_create_nonce( 'frm_ajax' ),
'no_save_warning' => __( 'Warning: There is no way to retrieve unsaved entries.', 'formidable' ),
'jquery_ui_url' => FrmAppHelper::jquery_ui_base_url(),
- ));
+ ) );
}
}
diff --git a/classes/controllers/FrmFormsController.php b/classes/controllers/FrmFormsController.php
index 1f496cd7f6..c34c1a3772 100644
--- a/classes/controllers/FrmFormsController.php
+++ b/classes/controllers/FrmFormsController.php
@@ -179,28 +179,28 @@ public static function update( $values = false ) {
$values = FrmProEntry::mod_other_vals( $values, 'back' );
}
- $errors = FrmForm::validate($values);
- $permission_error = FrmAppHelper::permission_nonce_error('frm_edit_forms', 'frm_save_form', 'frm_save_form_nonce');
+ $errors = FrmForm::validate( $values );
+ $permission_error = FrmAppHelper::permission_nonce_error( 'frm_edit_forms', 'frm_save_form', 'frm_save_form_nonce' );
if ( $permission_error !== false ) {
$errors['form'] = $permission_error;
}
- $id = isset($values['id']) ? (int) $values['id'] : (int) FrmAppHelper::get_param('id');
+ $id = isset( $values['id'] ) ? (int) $values['id'] : (int) FrmAppHelper::get_param( 'id' );
if ( count( $errors ) > 0 ) {
- return self::get_edit_vars($id, $errors);
+ return self::get_edit_vars( $id, $errors );
} else {
FrmForm::update( $id, $values );
$message = __( 'Form was Successfully Updated', 'formidable' );
- if ( defined('DOING_AJAX') ) {
- die($message);
+ if ( defined( 'DOING_AJAX' ) ) {
+ die( $message );
}
- return self::get_edit_vars($id, '', $message);
+ return self::get_edit_vars( $id, '', $message );
}
}
- public static function bulk_create_template($ids) {
- FrmAppHelper::permission_check('frm_edit_forms');
+ public static function bulk_create_template( $ids ) {
+ FrmAppHelper::permission_check( 'frm_edit_forms' );
foreach ( $ids as $id ) {
FrmForm::duplicate( $id, true, true );
@@ -247,22 +247,22 @@ public static function page_preview() {
return;
}
- $form = FrmForm::getOne($params['form']);
+ $form = FrmForm::getOne( $params['form'] );
if ( ! $form ) {
return;
}
- return self::show_form($form->id, '', true, true);
+ return self::show_form( $form->id, '', true, true );
}
public static function preview() {
- do_action('frm_wp');
+ do_action( 'frm_wp' );
global $frm_vars;
$frm_vars['preview'] = true;
- if ( !defined( 'ABSPATH' ) && !defined( 'XMLRPC_REQUEST' )) {
+ if ( ! defined( 'ABSPATH' ) && ! defined( 'XMLRPC_REQUEST' ) ) {
global $wp;
- $root = dirname(dirname(dirname(dirname(__FILE__))));
+ $root = dirname( dirname( dirname( dirname( __FILE__ ) ) ) );
include_once( $root.'/wp-config.php' );
$wp->init();
$wp->register_globals();
@@ -456,7 +456,7 @@ public static function get_shortcode_opts() {
}
public static function display_forms_list( $params = array(), $message = '', $current_page_ov = false, $errors = array() ) {
- FrmAppHelper::permission_check('frm_view_forms');
+ FrmAppHelper::permission_check( 'frm_view_forms' );
global $wpdb, $frm_vars;
@@ -464,7 +464,7 @@ public static function display_forms_list( $params = array(), $message = '', $cu
$params = FrmFormsHelper::get_params();
}
- $wp_list_table = new FrmFormsListHelper( compact('params') );
+ $wp_list_table = new FrmFormsListHelper( compact( 'params' ) );
$pagenum = $wp_list_table->get_pagenum();
@@ -498,7 +498,7 @@ public static function get_columns($columns) {
$columns['created_at'] = __( 'Date', 'formidable' );
- add_screen_option( 'per_page', array( 'label' => __( 'Forms', 'formidable' ), 'default' => 20, 'option' => 'formidable_page_formidable_per_page') );
+ add_screen_option( 'per_page', array( 'label' => __( 'Forms', 'formidable' ), 'default' => 20, 'option' => 'formidable_page_formidable_per_page' ) );
return $columns;
}
@@ -513,7 +513,7 @@ public static function get_sortable_columns() {
);
}
- public static function hidden_columns($result) {
+ public static function hidden_columns( $result ) {
$return = false;
foreach ( (array) $result as $r ) {
if ( ! empty( $r ) ) {
@@ -537,7 +537,7 @@ public static function hidden_columns($result) {
return $result;
}
- public static function save_per_page($save, $option, $value) {
+ public static function save_per_page( $save, $option, $value ) {
if ( $option == 'formidable_page_formidable_per_page' ) {
$save = (int) $value;
}
@@ -652,81 +652,81 @@ public static function get_email_html() {
}
public static function filter_content( $content, $form, $entry = false ) {
- if ( ! $entry || ! is_object($entry) ) {
- if ( ! $entry || ! is_numeric($entry) ) {
- $entry = ( $_POST && isset($_POST['id']) ) ? $_POST['id'] : false;
+ if ( ! $entry || ! is_object( $entry ) ) {
+ if ( ! $entry || ! is_numeric( $entry ) ) {
+ $entry = ( $_POST && isset( $_POST['id'] ) ) ? $_POST['id'] : false;
}
- FrmEntriesHelper::maybe_get_entry($entry);
+ FrmEntriesHelper::maybe_get_entry( $entry );
}
if ( ! $entry ) {
return $content;
}
- if ( is_object($form) ) {
+ if ( is_object( $form ) ) {
$form = $form->id;
}
- $shortcodes = FrmFieldsHelper::get_shortcodes($content, $form);
- $content = apply_filters('frm_replace_content_shortcodes', $content, $entry, $shortcodes);
+ $shortcodes = FrmFieldsHelper::get_shortcodes( $content, $form );
+ $content = apply_filters( 'frm_replace_content_shortcodes', $content, $entry, $shortcodes );
return $content;
}
- public static function replace_content_shortcodes($content, $entry, $shortcodes) {
- return FrmFieldsHelper::replace_content_shortcodes($content, $entry, $shortcodes);
+ public static function replace_content_shortcodes( $content, $entry, $shortcodes ) {
+ return FrmFieldsHelper::replace_content_shortcodes( $content, $entry, $shortcodes );
}
- public static function process_bulk_form_actions($errors) {
+ public static function process_bulk_form_actions( $errors ) {
if ( ! $_REQUEST ) {
return $errors;
}
- $bulkaction = FrmAppHelper::get_param('action');
+ $bulkaction = FrmAppHelper::get_param( 'action' );
if ( $bulkaction == -1 ) {
- $bulkaction = FrmAppHelper::get_param('action2');
+ $bulkaction = FrmAppHelper::get_param( 'action2' );
}
- if ( ! empty($bulkaction) && strpos($bulkaction, 'bulk_') === 0 ) {
+ if ( ! empty( $bulkaction ) && strpos( $bulkaction, 'bulk_' ) === 0 ) {
FrmAppHelper::remove_get_action();
- $bulkaction = str_replace('bulk_', '', $bulkaction);
+ $bulkaction = str_replace( 'bulk_', '', $bulkaction );
}
- $ids = FrmAppHelper::get_param('item-action', '');
- if ( empty($ids) ) {
+ $ids = FrmAppHelper::get_param( 'item-action', '' );
+ if ( empty( $ids ) ) {
$errors[] = __( 'No forms were specified', 'formidable' );
return $errors;
}
- $permission_error = FrmAppHelper::permission_nonce_error('', '_wpnonce', 'bulk-toplevel_page_formidable');
+ $permission_error = FrmAppHelper::permission_nonce_error( '', '_wpnonce', 'bulk-toplevel_page_formidable' );
if ( $permission_error !== false ) {
$errors[] = $permission_error;
return $errors;
}
- if ( ! is_array($ids) ) {
- $ids = explode(',', $ids);
+ if ( ! is_array( $ids ) ) {
+ $ids = explode( ',', $ids );
}
switch ( $bulkaction ) {
case 'delete':
- $message = self::bulk_destroy($ids);
+ $message = self::bulk_destroy( $ids );
break;
case 'trash':
- $message = self::bulk_trash($ids);
+ $message = self::bulk_trash( $ids );
break;
case 'untrash':
- $message = self::bulk_untrash($ids);
+ $message = self::bulk_untrash( $ids );
break;
case 'create_template':
- $message = self::bulk_create_template($ids);
+ $message = self::bulk_create_template( $ids );
break;
}
if ( isset( $message ) && ! empty( $message ) ) {
- echo '
'. $message .'
';
+ echo ''.$message.'
';
}
return $errors;
@@ -841,7 +841,7 @@ public static function route() {
}
}
- public static function json_error($errors) {
+ public static function json_error( $errors ) {
$errors['json'] = __( 'Abnormal HTML characters prevented your form from saving correctly', 'formidable' );
return $errors;
}
@@ -930,57 +930,57 @@ public static function get_form_shortcode($atts) {
);
}
- public static function show_form($id = '', $key = '', $title = false, $description = false, $atts = array()) {
- if ( empty($id) ) {
+ public static function show_form( $id = '', $key = '', $title = false, $description = false, $atts = array() ) {
+ if ( empty( $id ) ) {
$id = $key;
}
// no form id or key set
- if ( empty($id) ) {
+ if ( empty( $id ) ) {
return __( 'Please select a valid form', 'formidable' );
}
- $form = FrmForm::getOne($id);
+ $form = FrmForm::getOne( $id );
if ( ! $form || $form->parent_form_id ) {
return __( 'Please select a valid form', 'formidable' );
}
- add_action('frm_load_form_hooks', 'FrmFormsController::trigger_load_form_hooks');
+ add_action( 'frm_load_form_hooks', 'FrmFormsController::trigger_load_form_hooks' );
FrmAppHelper::trigger_hook_load( 'form', $form );
- $form = apply_filters('frm_pre_display_form', $form);
+ $form = apply_filters( 'frm_pre_display_form', $form );
$frm_settings = FrmAppHelper::get_settings();
// don't show a draft form on a page
global $post;
- if ( $form->status == 'draft' && current_user_can('frm_edit_forms') && ( ! $post || $post->ID != $frm_settings->preview_page_id ) && ! FrmAppHelper::is_preview_page() ) {
+ if ( $form->status == 'draft' && current_user_can( 'frm_edit_forms' ) && ( ! $post || $post->ID != $frm_settings->preview_page_id ) && ! FrmAppHelper::is_preview_page() ) {
return __( 'Please select a valid form', 'formidable' );
}
// don't show the form if user should be logged in
if ( $form->logged_in && ! is_user_logged_in() ) {
- return do_shortcode($frm_settings->login_msg);
+ return do_shortcode( $frm_settings->login_msg );
}
// don't show the form if user doesn't have permission
- if ( $form->logged_in && get_current_user_id() && isset($form->options['logged_in_role']) && $form->options['logged_in_role'] != '' && !FrmAppHelper::user_has_permission($form->options['logged_in_role']) ) {
- return do_shortcode($frm_settings->login_msg);
+ if ( $form->logged_in && get_current_user_id() && isset( $form->options['logged_in_role'] ) && $form->options['logged_in_role'] != '' && ! FrmAppHelper::user_has_permission( $form->options['logged_in_role'] ) ) {
+ return do_shortcode( $frm_settings->login_msg );
}
- $form = self::get_form($form, $title, $description, $atts);
+ $form = self::get_form( $form, $title, $description, $atts );
// check for external shortcodes
- $form = do_shortcode($form);
+ $form = do_shortcode( $form );
return $form;
}
- public static function get_form($form, $title, $description, $atts = array()) {
+ public static function get_form( $form, $title, $description, $atts = array() ) {
ob_start();
- self::get_form_contents($form, $title, $description, $atts);
- FrmEntriesHelper::enqueue_scripts( FrmEntriesController::get_params($form) );
+ self::get_form_contents( $form, $title, $description, $atts );
+ FrmEntriesHelper::enqueue_scripts( FrmEntriesController::get_params( $form ) );
$contents = ob_get_contents();
ob_end_clean();
diff --git a/classes/controllers/FrmHooksController.php b/classes/controllers/FrmHooksController.php
index bc365b41be..11336dcdcb 100644
--- a/classes/controllers/FrmHooksController.php
+++ b/classes/controllers/FrmHooksController.php
@@ -5,7 +5,7 @@ class FrmHooksController {
* Trigger plugin-wide hook loading
*/
public static function trigger_load_hook( $hooks = 'load_hooks' ) {
- $controllers = apply_filters('frm_load_controllers', array( 'FrmHooksController' ) );
+ $controllers = apply_filters( 'frm_load_controllers', array( 'FrmHooksController' ) );
$trigger_hooks = $hooks;
$hooks = (array) $hooks;
@@ -13,7 +13,7 @@ public static function trigger_load_hook( $hooks = 'load_hooks' ) {
if ( 'load_hooks' == $trigger_hooks ) {
if ( is_admin() ) {
$hooks[] = 'load_admin_hooks';
- if ( defined('DOING_AJAX') ) {
+ if ( defined( 'DOING_AJAX' ) ) {
$hooks[] = 'load_ajax_hooks';
$hooks[] = 'load_form_hooks';
}
diff --git a/classes/controllers/FrmSettingsController.php b/classes/controllers/FrmSettingsController.php
index 2ae865aecf..5b2aef522b 100644
--- a/classes/controllers/FrmSettingsController.php
+++ b/classes/controllers/FrmSettingsController.php
@@ -31,18 +31,18 @@ public static function process_form( $stop_load = false ) {
$frm_settings = FrmAppHelper::get_settings();
- if ( ! isset($_POST['process_form']) || ! wp_verify_nonce($_POST['process_form'], 'process_form_nonce') ) {
- wp_die($frm_settings->admin_permission);
+ if ( ! isset( $_POST['process_form'] ) || ! wp_verify_nonce( $_POST['process_form'], 'process_form_nonce' ) ) {
+ wp_die( $frm_settings->admin_permission );
}
$errors = array();
$message = '';
- if ( ! isset($frm_vars['settings_routed']) || ! $frm_vars['settings_routed'] ) {
+ if ( ! isset( $frm_vars['settings_routed'] ) || ! $frm_vars['settings_routed'] ) {
//$errors = $frm_settings->validate($_POST,array());
- $frm_settings->update(stripslashes_deep($_POST));
+ $frm_settings->update( stripslashes_deep( $_POST ) );
- if ( empty($errors) ) {
+ if ( empty( $errors ) ) {
$frm_settings->store();
$message = __( 'Settings Saved', 'formidable' );
}
@@ -55,14 +55,14 @@ public static function process_form( $stop_load = false ) {
return;
}
- self::display_form($errors, $message);
+ self::display_form( $errors, $message );
}
public static function route( $stop_load = false ) {
- $action = isset($_REQUEST['frm_action']) ? 'frm_action' : 'action';
- $action = FrmAppHelper::get_param($action);
+ $action = isset( $_REQUEST['frm_action'] ) ? 'frm_action' : 'action';
+ $action = FrmAppHelper::get_param( $action );
if ( $action == 'process-form' ) {
- return self::process_form($stop_load);
+ return self::process_form( $stop_load );
} else if ( $stop_load != 'stop_load' ) {
return self::display_form();
}
diff --git a/classes/controllers/FrmStatisticsController.php b/classes/controllers/FrmStatisticsController.php
index d082af99a9..f35e3d24c7 100644
--- a/classes/controllers/FrmStatisticsController.php
+++ b/classes/controllers/FrmStatisticsController.php
@@ -2,19 +2,19 @@
class FrmStatisticsController {
- public static function menu() {
- add_submenu_page( 'formidable', 'Formidable | '. __( 'Views', 'formidable' ), '', 'administrator', 'formidable-entry-templates', 'FrmStatisticsController::list_displays' );
- }
+ public static function menu() {
+ add_submenu_page( 'formidable', 'Formidable | '. __( 'Views', 'formidable' ), '', 'administrator', 'formidable-entry-templates', 'FrmStatisticsController::list_displays' );
+ }
- public static function list_reports() {
- add_filter('frm_form_stop_action_reports', '__return_true');
- $form = FrmAppHelper::get_param('form', false);
- require(FrmAppHelper::plugin_path() .'/classes/views/frm-statistics/list.php');
- }
+ public static function list_reports() {
+ add_filter('frm_form_stop_action_reports', '__return_true');
+ $form = FrmAppHelper::get_param('form', false);
+ require(FrmAppHelper::plugin_path() .'/classes/views/frm-statistics/list.php');
+ }
- public static function list_displays() {
- $form = FrmAppHelper::get_param('form', false);
- require(FrmAppHelper::plugin_path() .'/classes/views/frm-statistics/list_displays.php');
- }
+ public static function list_displays() {
+ $form = FrmAppHelper::get_param('form', false);
+ require(FrmAppHelper::plugin_path() .'/classes/views/frm-statistics/list_displays.php');
+ }
}
diff --git a/classes/controllers/FrmStylesController.php b/classes/controllers/FrmStylesController.php
index ccbc2a6c61..60db6640b5 100644
--- a/classes/controllers/FrmStylesController.php
+++ b/classes/controllers/FrmStylesController.php
@@ -11,7 +11,7 @@ public static function load_pro_hooks() {
}
public static function register_post_types() {
- register_post_type(self::$post_type, array(
+ register_post_type( self::$post_type, array(
'label' => __( 'Styles', 'formidable' ),
'public' => false,
'show_ui' => false,
@@ -24,7 +24,7 @@ public static function register_post_types() {
'name' => __( 'Styles', 'formidable' ),
'singular_name' => __( 'Style', 'formidable' ),
'menu_name' => __( 'Style', 'formidable' ),
- 'edit' => __( 'Edit'),
+ 'edit' => __( 'Edit' ),
'add_new_item' => __( 'Create a New Style', 'formidable' ),
'edit_item' => __( 'Edit Style', 'formidable' )
)
@@ -187,8 +187,8 @@ public static function route() {
case 'save_css':
return self::$action();
default:
- do_action('frm_style_action_route', $action);
- if ( apply_filters('frm_style_stop_action_route', false, $action) ) {
+ do_action( 'frm_style_action_route', $action );
+ if ( apply_filters( 'frm_style_stop_action_route', false, $action ) ) {
return;
}
@@ -206,7 +206,7 @@ public static function reset_styling() {
$frm_style = new FrmStyle();
$defaults = $frm_style->get_defaults();
- echo json_encode($defaults);
+ echo json_encode( $defaults );
wp_die();
}
@@ -275,14 +275,14 @@ public static function load_css() {
public static function enqueue_style() {
global $frm_vars;
- if ( isset($frm_vars['css_loaded']) && $frm_vars['css_loaded'] ) {
+ if ( isset( $frm_vars['css_loaded'] ) && $frm_vars['css_loaded'] ) {
// the CSS has already been loaded
return;
}
$frm_settings = FrmAppHelper::get_settings();
if ( $frm_settings->load_style != 'none' ) {
- wp_enqueue_style('formidable' );
+ wp_enqueue_style( 'formidable' );
$frm_vars['css_loaded'] = true;
}
}
@@ -295,14 +295,14 @@ public static function get_style_opts() {
return $styles;
}
- public static function get_form_style($form = 'default') {
- $style = FrmFormsHelper::get_form_style($form);
+ public static function get_form_style( $form = 'default' ) {
+ $style = FrmFormsHelper::get_form_style( $form );
- if ( empty($style) || 1 == $style ) {
+ if ( empty( $style ) || 1 == $style ) {
$style = 'default';
}
- $frm_style = new FrmStyle($style);
+ $frm_style = new FrmStyle( $style );
return $frm_style->get_one();
}
@@ -366,7 +366,7 @@ public static function &important_style($important, $field) {
* Fallback for WP < 3.6
*/
public static function do_accordion_sections( $screen, $context, $object ) {
- if ( function_exists('do_accordion_sections') ) {
+ if ( function_exists( 'do_accordion_sections' ) ) {
return do_accordion_sections( $screen, $context, $object );
}
@@ -416,7 +416,7 @@ public static function do_accordion_sections( $screen, $context, $object ) {
}
}
}
- } while(0);
+ } while ( 0 );
?>
array( null, '', 'published' ) ), 'name' );
- $export_types = apply_filters('frm_xml_export_types',
- array( 'forms' => __( 'Forms', 'formidable' ))
+ $export_types = apply_filters( 'frm_xml_export_types',
+ array( 'forms' => __( 'Forms', 'formidable' ) )
);
- $export_format = apply_filters('frm_export_formats', array(
- 'xml' => array( 'name' => 'XML', 'support' => 'forms', 'count' => 'multiple'),
- ));
+ $export_format = apply_filters( 'frm_export_formats', array(
+ 'xml' => array( 'name' => 'XML', 'support' => 'forms', 'count' => 'multiple' ),
+ ) );
if ( FrmAppHelper::pro_is_installed() ) {
$frmpro_settings = new FrmProSettings();
diff --git a/classes/helpers/FrmAppHelper.php b/classes/helpers/FrmAppHelper.php
index 5358d2cf21..20aee62995 100644
--- a/classes/helpers/FrmAppHelper.php
+++ b/classes/helpers/FrmAppHelper.php
@@ -1400,7 +1400,7 @@ public static function &getRecordCount( $where = '', $table_name ) {
return $count;
}
- public static function get_referer_info(){
+ public static function get_referer_info() {
_deprecated_function( __FUNCTION__, '2.0', 'FrmAppHelper::get_server_value' );
return self::get_server_value('HTTP_REFERER');
}
diff --git a/classes/helpers/FrmFieldsHelper.php b/classes/helpers/FrmFieldsHelper.php
index 86b39f3c8b..6254f1cc9d 100644
--- a/classes/helpers/FrmFieldsHelper.php
+++ b/classes/helpers/FrmFieldsHelper.php
@@ -469,7 +469,7 @@ public static function replace_shortcodes($html, $field, $errors = array(), $for
* @param $field_id int
* @param $html string
*/
- private static function get_more_field_classes( &$error_class, $field, $field_id, $html ){
+ private static function get_more_field_classes( &$error_class, $field, $field_id, $html ) {
$error_class .= ' frm_'. $field['label'] .'_container';
if ( $field['id'] != $field_id ) {
// add a class for repeating/embedded fields
diff --git a/classes/helpers/FrmFormActionsHelper.php b/classes/helpers/FrmFormActionsHelper.php
index 8beb765066..3732424581 100644
--- a/classes/helpers/FrmFormActionsHelper.php
+++ b/classes/helpers/FrmFormActionsHelper.php
@@ -3,7 +3,7 @@
die( 'You are not allowed to call this page directly.' );
}
-class FrmFormActionsHelper{
+class FrmFormActionsHelper {
public static function get_action_for_form($form_id, $type = 'all', $limit = 99) {
$action_controls = FrmFormActionsController::get_form_actions( $type );
@@ -101,7 +101,7 @@ public static function action_conditions_met($action, $entry) {
return $stop;
}
- public static function default_action_opts($class = ''){
+ public static function default_action_opts($class = '') {
return array(
'classes' => 'frm_icon_font '. $class,
'active' => false,
diff --git a/classes/helpers/FrmFormsHelper.php b/classes/helpers/FrmFormsHelper.php
index 0f492ab90d..44eb9c790d 100644
--- a/classes/helpers/FrmFormsHelper.php
+++ b/classes/helpers/FrmFormsHelper.php
@@ -3,7 +3,7 @@
die( 'You are not allowed to call this page directly.' );
}
-class FrmFormsHelper{
+class FrmFormsHelper {
/**
* If $form is numeric, get the form object
* @param object|int $form
@@ -62,7 +62,7 @@ public static function forms_dropdown( $field_name, $field_value = '', $args = a
'', 'description' => '') as $var => $default){
+ foreach ( array( 'name' => '', 'description' => '') as $var => $default) {
if ( ! isset( $values[ $var ] ) ) {
$values[ $var ] = FrmAppHelper::get_param( $var, $default );
}
@@ -131,7 +131,7 @@ public static function setup_new_vars( $values = array() ) {
$values['description'] = FrmAppHelper::use_wpautop($values['description']);
- foreach ( array( 'form_id' => '', 'logged_in' => '', 'editable' => '', 'default_template' => 0, 'is_template' => 0, 'status' => 'draft', 'parent_form_id' => 0) as $var => $default){
+ foreach ( array( 'form_id' => '', 'logged_in' => '', 'editable' => '', 'default_template' => 0, 'is_template' => 0, 'status' => 'draft', 'parent_form_id' => 0) as $var => $default) {
if ( ! isset( $values[ $var ] ) ) {
$values[ $var ] = FrmAppHelper::get_param( $var, $default );
}
@@ -192,7 +192,7 @@ public static function fill_default_opts($values, $record, $post_values) {
unset($k, $v);
}
- }else{
+ } else {
$values[$var] = ($post_values && isset($post_values['options'][$var])) ? $post_values['options'][$var] : (($record && isset($record->options[$var])) ? $record->options[$var] : $default);
}
@@ -202,7 +202,7 @@ public static function fill_default_opts($values, $record, $post_values) {
return $values;
}
- public static function get_default_opts(){
+ public static function get_default_opts() {
$frm_settings = FrmAppHelper::get_settings();
return array(
@@ -218,7 +218,7 @@ public static function get_default_opts(){
/**
* @param string $loc
*/
- public static function get_default_html($loc){
+ public static function get_default_html($loc) {
if ( $loc == 'submit' ) {
$sending = __( 'Sending', 'formidable' );
$draft_link = self::get_draft_link();
@@ -243,12 +243,12 @@ public static function get_default_html($loc){
return $default_html;
}
- public static function get_draft_link(){
+ public static function get_draft_link() {
$link = '[if save_draft][draft_label][/if save_draft]';
return $link;
}
- public static function get_custom_submit($html, $form, $submit, $form_action, $values){
+ public static function get_custom_submit($html, $form, $submit, $form_action, $values) {
$button = self::replace_shortcodes($html, $form, $submit, $form_action, $values);
if ( ! strpos($button, '[button_action]') ) {
return;
@@ -327,7 +327,7 @@ public static function maybe_create_end_section( &$open, &$reset_fields, $end_se
}
public static function replace_shortcodes( $html, $form, $title = false, $description = false, $values = array() ) {
- foreach ( array( 'form_name' => $title, 'form_description' => $description, 'entry_key' => true) as $code => $show){
+ foreach ( array( 'form_name' => $title, 'form_description' => $description, 'entry_key' => true) as $code => $show) {
if ( $code == 'form_name' ) {
$replace_with = $form->name;
} else if ( $code == 'form_description' ) {
@@ -366,7 +366,7 @@ public static function replace_shortcodes( $html, $form, $title = false, $descri
return $html;
}
- public static function submit_button_label($submit){
+ public static function submit_button_label($submit) {
if ( ! $submit || empty($submit) ) {
$frm_settings = FrmAppHelper::get_settings();
$submit = $frm_settings->submit_value;
diff --git a/classes/helpers/FrmFormsListHelper.php b/classes/helpers/FrmFormsListHelper.php
index 7fbd5302ec..eefab60367 100644
--- a/classes/helpers/FrmFormsListHelper.php
+++ b/classes/helpers/FrmFormsListHelper.php
@@ -77,13 +77,13 @@ public function no_items() {
%1$sForms%2$s.', 'formidable' ), '', '') ?>
-
status, array( '', 'published')) ) {
diff --git a/classes/helpers/FrmStylesHelper.php b/classes/helpers/FrmStylesHelper.php
index d9a9ced1e3..bcf6b2f081 100644
--- a/classes/helpers/FrmStylesHelper.php
+++ b/classes/helpers/FrmStylesHelper.php
@@ -1,7 +1,7 @@
'UI Lightness',
'ui-darkness' => 'UI Darkness',
@@ -33,7 +33,7 @@ public static function jquery_themes(){
return $themes;
}
- public static function jquery_css_url($theme_css){
+ public static function jquery_css_url($theme_css) {
if ( $theme_css == -1 ) {
return;
}
diff --git a/classes/helpers/FrmXMLHelper.php b/classes/helpers/FrmXMLHelper.php
index c490358d60..4e7ee53a47 100644
--- a/classes/helpers/FrmXMLHelper.php
+++ b/classes/helpers/FrmXMLHelper.php
@@ -3,7 +3,7 @@
die( 'You are not allowed to call this page directly.' );
}
-class FrmXMLHelper{
+class FrmXMLHelper {
public static function get_xml_values( $opt, $padding ) {
if ( is_array( $opt ) ) {
@@ -21,7 +21,7 @@ public static function get_xml_values( $opt, $padding ) {
}
}
- public static function import_xml($file){
+ public static function import_xml($file) {
$defaults = array(
'forms' => 0, 'fields' => 0, 'terms' => 0,
'posts' => 0, 'views' => 0, 'actions' => 0,
@@ -557,7 +557,7 @@ public static function cdata( $str ) {
return $str;
}
- public static function migrate_form_settings_to_actions( $form_options, $form_id, &$imported = array(), $switch = false ){
+ public static function migrate_form_settings_to_actions( $form_options, $form_id, &$imported = array(), $switch = false ) {
// Get post type
$post_type = FrmFormActionsController::$action_post_type;
diff --git a/classes/models/FrmDb.php b/classes/models/FrmDb.php
index 99fca35021..b029eaa062 100644
--- a/classes/models/FrmDb.php
+++ b/classes/models/FrmDb.php
@@ -1,12 +1,12 @@
admin_permission);
diff --git a/classes/models/FrmEntry.php b/classes/models/FrmEntry.php
index dfca519e9e..4219b6e3e1 100644
--- a/classes/models/FrmEntry.php
+++ b/classes/models/FrmEntry.php
@@ -3,7 +3,7 @@
die( 'You are not allowed to call this page directly.' );
}
-class FrmEntry{
+class FrmEntry {
public static function create( $values ) {
global $wpdb;
@@ -139,7 +139,7 @@ public static function is_duplicate($new_values, $values) {
return $is_duplicate;
}
- public static function duplicate( $id ){
+ public static function duplicate( $id ) {
global $wpdb;
$values = self::getOne( $id );
@@ -171,7 +171,7 @@ public static function duplicate( $id ){
return $entry_id;
}
- public static function update( $id, $values ){
+ public static function update( $id, $values ) {
global $wpdb, $frm_vars;
if ( isset($frm_vars['saved_entries']) && is_array($frm_vars['saved_entries']) && in_array( (int) $id, (array) $frm_vars['saved_entries'] ) ) {
return;
@@ -256,7 +256,7 @@ public static function &update_form( $id, $value, $form_id ){
return $result;
}
- public static function getOne( $id, $meta = false){
+ public static function getOne( $id, $meta = false) {
global $wpdb;
$query = "SELECT it.*, fr.name as form_name, fr.form_key as form_key FROM {$wpdb->prefix}frm_items it
diff --git a/classes/models/FrmEntryMeta.php b/classes/models/FrmEntryMeta.php
index d1b7775b1c..ee7a519b44 100644
--- a/classes/models/FrmEntryMeta.php
+++ b/classes/models/FrmEntryMeta.php
@@ -3,7 +3,7 @@
die( 'You are not allowed to call this page directly.' );
}
-class FrmEntryMeta{
+class FrmEntryMeta {
/**
* @param string $meta_key
@@ -35,7 +35,7 @@ public static function add_entry_meta($entry_id, $field_id, $meta_key = null, $m
/**
* @param string $meta_key
*/
- public static function update_entry_meta($entry_id, $field_id, $meta_key = null, $meta_value){
+ public static function update_entry_meta($entry_id, $field_id, $meta_key = null, $meta_value) {
if ( ! $field_id ) {
return false;
}
@@ -55,7 +55,7 @@ public static function update_entry_meta($entry_id, $field_id, $meta_key = null,
return $wpdb->update( $wpdb->prefix .'frm_item_metas', array( 'meta_value' => $meta_value ), $where_values );
}
- public static function update_entry_metas($entry_id, $values){
+ public static function update_entry_metas($entry_id, $values) {
global $wpdb;
$prev_values = FrmDb::get_col( $wpdb->prefix .'frm_item_metas', array( 'item_id' => $entry_id, 'field_id !' => 0), 'field_id' );
@@ -96,7 +96,7 @@ public static function update_entry_metas($entry_id, $values){
$wpdb->query( $wpdb->prepare( 'DELETE FROM ' . $wpdb->prefix . 'frm_item_metas ' . $where['where'] ), $where['values'] );
}
- public static function duplicate_entry_metas($old_id, $new_id){
+ public static function duplicate_entry_metas($old_id, $new_id) {
$metas = self::get_entry_meta_info($old_id);
foreach ( $metas as $meta ) {
self::add_entry_meta($new_id, $meta->field_id, null, $meta->meta_value);
@@ -104,7 +104,7 @@ public static function duplicate_entry_metas($old_id, $new_id){
}
}
- public static function delete_entry_meta($entry_id, $field_id){
+ public static function delete_entry_meta($entry_id, $field_id) {
global $wpdb;
return $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->prefix}frm_item_metas WHERE field_id=%d AND item_id=%d", $field_id, $entry_id));
}
@@ -144,7 +144,7 @@ public static function get_entry_meta_by_field($entry_id, $field_id) {
return $result;
}
- public static function get_entry_metas($entry_id){
+ public static function get_entry_metas($entry_id) {
_deprecated_function( __FUNCTION__, '1.07.10');
global $wpdb;
@@ -204,7 +204,7 @@ private static function meta_field_query($field_id, $order, $limit, $args, array
$query[] = $order . $limit;
}
- public static function get_entry_meta_info($entry_id){
+ public static function get_entry_meta_info($entry_id) {
return FrmDb::get_results( 'frm_item_metas', array( 'item_id' => $entry_id) );
}
@@ -260,7 +260,7 @@ private static function get_ids_query($where, $order_by, $limit, $unique, $args,
if ( is_array($where) ) {
if ( ! $args['is_draft'] ) {
$where['e.is_draft'] = 0;
- } else if ( $args['is_draft'] == 1 ){
+ } else if ( $args['is_draft'] == 1 ) {
$where['e.is_draft'] = 1;
}
@@ -304,7 +304,7 @@ public static function search_entry_metas( $search, $field_id = '', $operator )
}
global $wpdb;
- if (is_array($search)){
+ if (is_array($search)) {
$where = '';
foreach ( $search as $field => $value ) {
if ( $value <= 0 || ! in_array($field, array( 'year', 'month', 'day')) ) {
@@ -325,7 +325,7 @@ public static function search_entry_metas( $search, $field_id = '', $operator )
}
$where .= $wpdb->prepare(' field_id=%d', $field_id);
$query = "SELECT DISTINCT item_id FROM {$wpdb->prefix}frm_item_metas". FrmAppHelper::prepend_and_or_where(' WHERE ', $where);
- }else{
+ } else {
if ( $operator == 'LIKE' ) {
$search = '%' . $search . '%';
}