@@ -143,8 +143,8 @@ |
||
| 143 | 143 | add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' ); |
| 144 | 144 | |
| 145 | 145 | // Addons Controller |
| 146 | - add_action('wp_ajax_frm_addon_activate', 'FrmAddon::activate' ); |
|
| 147 | - add_action('wp_ajax_frm_addon_deactivate', 'FrmAddon::deactivate' ); |
|
| 146 | + add_action( 'wp_ajax_frm_addon_activate', 'FrmAddon::activate' ); |
|
| 147 | + add_action( 'wp_ajax_frm_addon_deactivate', 'FrmAddon::deactivate' ); |
|
| 148 | 148 | |
| 149 | 149 | // Fields Controller |
| 150 | 150 | add_action( 'wp_ajax_frm_load_field', 'FrmFieldsController::load_field' ); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined('ABSPATH') ) { |
|
| 2 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 3 | 3 | die( 'You are not allowed to call this page directly.' ); |
| 4 | 4 | } |
| 5 | 5 | |
@@ -9,12 +9,12 @@ discard block |
||
| 9 | 9 | global $frm_vars; |
| 10 | 10 | $values = array(); |
| 11 | 11 | foreach ( array( 'name' => '', 'description' => '', 'item_key' => '' ) as $var => $default ) { |
| 12 | - $values[ $var ] = FrmAppHelper::get_post_param( $var, $default ); |
|
| 12 | + $values[$var] = FrmAppHelper::get_post_param( $var, $default ); |
|
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | $values['fields'] = array(); |
| 16 | - if ( empty($fields) ) { |
|
| 17 | - return apply_filters('frm_setup_new_entry', $values); |
|
| 16 | + if ( empty( $fields ) ) { |
|
| 17 | + return apply_filters( 'frm_setup_new_entry', $values ); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | foreach ( (array) $fields as $field ) { |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | 'default_value' => $field->default_value, |
| 27 | 27 | 'name' => $field->name, |
| 28 | 28 | 'description' => $field->description, |
| 29 | - 'type' => apply_filters('frm_field_type', $field->type, $field, $new_value), |
|
| 29 | + 'type' => apply_filters( 'frm_field_type', $field->type, $field, $new_value ), |
|
| 30 | 30 | 'options' => $field->options, |
| 31 | 31 | 'required' => $field->required, |
| 32 | 32 | 'field_key' => $field->field_key, |
@@ -35,43 +35,43 @@ discard block |
||
| 35 | 35 | 'parent_form_id' => isset( $args['parent_form_id'] ) ? $args['parent_form_id'] : $field->form_id, |
| 36 | 36 | ); |
| 37 | 37 | |
| 38 | - $opt_defaults = FrmFieldsHelper::get_default_field_opts($field_array['type'], $field, true); |
|
| 38 | + $opt_defaults = FrmFieldsHelper::get_default_field_opts( $field_array['type'], $field, true ); |
|
| 39 | 39 | $opt_defaults['required_indicator'] = ''; |
| 40 | 40 | $opt_defaults['original_type'] = $field->type; |
| 41 | 41 | |
| 42 | 42 | foreach ( $opt_defaults as $opt => $default_opt ) { |
| 43 | - $field_array[ $opt ] = ( isset( $field->field_options[ $opt ] ) && $field->field_options[ $opt ] != '' ) ? $field->field_options[ $opt ] : $default_opt; |
|
| 44 | - unset($opt, $default_opt); |
|
| 43 | + $field_array[$opt] = ( isset( $field->field_options[$opt] ) && $field->field_options[$opt] != '' ) ? $field->field_options[$opt] : $default_opt; |
|
| 44 | + unset( $opt, $default_opt ); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - unset($opt_defaults); |
|
| 47 | + unset( $opt_defaults ); |
|
| 48 | 48 | |
| 49 | 49 | if ( $field_array['custom_html'] == '' ) { |
| 50 | - $field_array['custom_html'] = FrmFieldsHelper::get_default_html($field->type); |
|
| 50 | + $field_array['custom_html'] = FrmFieldsHelper::get_default_html( $field->type ); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - $field_array = apply_filters('frm_setup_new_fields_vars', $field_array, $field); |
|
| 53 | + $field_array = apply_filters( 'frm_setup_new_fields_vars', $field_array, $field ); |
|
| 54 | 54 | $field_array = array_merge( $field->field_options, $field_array ); |
| 55 | 55 | |
| 56 | 56 | $values['fields'][] = $field_array; |
| 57 | 57 | |
| 58 | - if ( ! $form || ! isset($form->id) ) { |
|
| 59 | - $form = FrmForm::getOne($field->form_id); |
|
| 58 | + if ( ! $form || ! isset( $form->id ) ) { |
|
| 59 | + $form = FrmForm::getOne( $field->form_id ); |
|
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - $form->options = maybe_unserialize($form->options); |
|
| 64 | - if ( is_array($form->options) ) { |
|
| 63 | + $form->options = maybe_unserialize( $form->options ); |
|
| 64 | + if ( is_array( $form->options ) ) { |
|
| 65 | 65 | foreach ( $form->options as $opt => $value ) { |
| 66 | - $values[ $opt ] = FrmAppHelper::get_post_param( $opt, $value ); |
|
| 67 | - unset($opt, $value); |
|
| 66 | + $values[$opt] = FrmAppHelper::get_post_param( $opt, $value ); |
|
| 67 | + unset( $opt, $value ); |
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | $form_defaults = FrmFormsHelper::get_default_opts(); |
| 72 | 72 | |
| 73 | 73 | $frm_settings = FrmAppHelper::get_settings(); |
| 74 | - $form_defaults['custom_style'] = ( $frm_settings->load_style != 'none' ); |
|
| 74 | + $form_defaults['custom_style'] = ( $frm_settings->load_style != 'none' ); |
|
| 75 | 75 | |
| 76 | 76 | $values = array_merge( $form_defaults, $values ); |
| 77 | 77 | |
@@ -93,15 +93,15 @@ discard block |
||
| 93 | 93 | $return_array = FrmField::is_field_with_multiple_values( $field ); |
| 94 | 94 | |
| 95 | 95 | // Do any shortcodes in default value and allow customization of default value |
| 96 | - $field->default_value = apply_filters('frm_get_default_value', $field->default_value, $field, true, $return_array); |
|
| 96 | + $field->default_value = apply_filters( 'frm_get_default_value', $field->default_value, $field, true, $return_array ); |
|
| 97 | 97 | // Calls FrmProFieldsHelper::get_default_value |
| 98 | 98 | |
| 99 | 99 | $new_value = $field->default_value; |
| 100 | 100 | |
| 101 | - if ( ! $reset && $_POST && isset( $_POST['item_meta'][ $field->id ] ) ) { |
|
| 101 | + if ( ! $reset && $_POST && isset( $_POST['item_meta'][$field->id] ) ) { |
|
| 102 | 102 | // If value was posted, get it |
| 103 | 103 | |
| 104 | - $new_value = stripslashes_deep( $_POST['item_meta'][ $field->id ] ); |
|
| 104 | + $new_value = stripslashes_deep( $_POST['item_meta'][$field->id] ); |
|
| 105 | 105 | |
| 106 | 106 | } else if ( FrmField::is_option_true( $field, 'clear_on_focus' ) ) { |
| 107 | 107 | // If clear on focus is selected, the value should be blank (unless it was posted, of course) |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | if ( ! is_array( $new_value ) ) { |
| 113 | - $new_value = str_replace('"', '"', $new_value); |
|
| 113 | + $new_value = str_replace( '"', '"', $new_value ); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | return $new_value; |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $values['item_key'] = FrmAppHelper::get_post_param( 'item_key', $record->item_key, 'sanitize_title' ); |
| 121 | 121 | $values['form_id'] = $record->form_id; |
| 122 | 122 | $values['is_draft'] = $record->is_draft; |
| 123 | - return apply_filters('frm_setup_edit_entry_vars', $values, $record); |
|
| 123 | + return apply_filters( 'frm_setup_edit_entry_vars', $values, $record ); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | public static function get_admin_params( $form = null ) { |
@@ -149,22 +149,22 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | public static function replace_default_message( $message, $atts ) { |
| 152 | - if ( strpos($message, '[default-message') === false && |
|
| 153 | - strpos($message, '[default_message') === false && |
|
| 152 | + if ( strpos( $message, '[default-message' ) === false && |
|
| 153 | + strpos( $message, '[default_message' ) === false && |
|
| 154 | 154 | ! empty( $message ) ) { |
| 155 | 155 | return $message; |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | - if ( empty($message) ) { |
|
| 158 | + if ( empty( $message ) ) { |
|
| 159 | 159 | $message = '[default-message]'; |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | - preg_match_all("/\[(default-message|default_message)\b(.*?)(?:(\/))?\]/s", $message, $shortcodes, PREG_PATTERN_ORDER); |
|
| 162 | + preg_match_all( "/\[(default-message|default_message)\b(.*?)(?:(\/))?\]/s", $message, $shortcodes, PREG_PATTERN_ORDER ); |
|
| 163 | 163 | |
| 164 | 164 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
| 165 | - $add_atts = shortcode_parse_atts( $shortcodes[2][ $short_key ] ); |
|
| 165 | + $add_atts = shortcode_parse_atts( $shortcodes[2][$short_key] ); |
|
| 166 | 166 | if ( $add_atts ) { |
| 167 | - $this_atts = array_merge($atts, $add_atts); |
|
| 167 | + $this_atts = array_merge( $atts, $add_atts ); |
|
| 168 | 168 | } else { |
| 169 | 169 | $this_atts = $atts; |
| 170 | 170 | } |
@@ -172,31 +172,31 @@ discard block |
||
| 172 | 172 | $default = FrmEntryFormat::show_entry( $this_atts ); |
| 173 | 173 | |
| 174 | 174 | // Add the default message |
| 175 | - $message = str_replace( $shortcodes[0][ $short_key ], $default, $message ); |
|
| 175 | + $message = str_replace( $shortcodes[0][$short_key], $default, $message ); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | return $message; |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | public static function prepare_display_value( $entry, $field, $atts ) { |
| 182 | - $field_value = isset( $entry->metas[ $field->id ] ) ? $entry->metas[ $field->id ] : false; |
|
| 182 | + $field_value = isset( $entry->metas[$field->id] ) ? $entry->metas[$field->id] : false; |
|
| 183 | 183 | if ( FrmAppHelper::pro_is_installed() ) { |
| 184 | 184 | FrmProEntriesHelper::get_dynamic_list_values( $field, $entry, $field_value ); |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | - if ( $field->form_id == $entry->form_id || empty($atts['embedded_field_id']) ) { |
|
| 188 | - return self::display_value($field_value, $field, $atts); |
|
| 187 | + if ( $field->form_id == $entry->form_id || empty( $atts['embedded_field_id'] ) ) { |
|
| 188 | + return self::display_value( $field_value, $field, $atts ); |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | // this is an embeded form |
| 192 | 192 | $val = ''; |
| 193 | 193 | |
| 194 | - if ( strpos($atts['embedded_field_id'], 'form') === 0 ) { |
|
| 194 | + if ( strpos( $atts['embedded_field_id'], 'form' ) === 0 ) { |
|
| 195 | 195 | //this is a repeating section |
| 196 | 196 | $child_entries = FrmEntry::getAll( array( 'it.parent_item_id' => $entry->id ) ); |
| 197 | 197 | } else { |
| 198 | 198 | // get all values for this field |
| 199 | - $child_values = isset( $entry->metas[ $atts['embedded_field_id'] ] ) ? $entry->metas[ $atts['embedded_field_id'] ] : false; |
|
| 199 | + $child_values = isset( $entry->metas[$atts['embedded_field_id']] ) ? $entry->metas[$atts['embedded_field_id']] : false; |
|
| 200 | 200 | |
| 201 | 201 | if ( $child_values ) { |
| 202 | 202 | $child_entries = FrmEntry::getAll( array( 'it.id' => (array) $child_values ) ); |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | |
| 206 | 206 | $field_value = array(); |
| 207 | 207 | |
| 208 | - if ( ! isset($child_entries) || ! $child_entries || ! FrmAppHelper::pro_is_installed() ) { |
|
| 208 | + if ( ! isset( $child_entries ) || ! $child_entries || ! FrmAppHelper::pro_is_installed() ) { |
|
| 209 | 209 | return $val; |
| 210 | 210 | } |
| 211 | 211 | |
@@ -214,17 +214,17 @@ discard block |
||
| 214 | 214 | $atts['post_id'] = $child_entry->post_id; |
| 215 | 215 | |
| 216 | 216 | // get the value for this field -- check for post values as well |
| 217 | - $entry_val = FrmProEntryMetaHelper::get_post_or_meta_value($child_entry, $field); |
|
| 217 | + $entry_val = FrmProEntryMetaHelper::get_post_or_meta_value( $child_entry, $field ); |
|
| 218 | 218 | |
| 219 | 219 | if ( $entry_val ) { |
| 220 | 220 | // foreach entry get display_value |
| 221 | - $field_value[] = self::display_value($entry_val, $field, $atts); |
|
| 221 | + $field_value[] = self::display_value( $entry_val, $field, $atts ); |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | - unset($child_entry); |
|
| 224 | + unset( $child_entry ); |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | - $val = implode(', ', (array) $field_value ); |
|
| 227 | + $val = implode( ', ', (array) $field_value ); |
|
| 228 | 228 | $val = wp_kses_post( $val ); |
| 229 | 229 | |
| 230 | 230 | return $val; |
@@ -244,22 +244,22 @@ discard block |
||
| 244 | 244 | ); |
| 245 | 245 | |
| 246 | 246 | $atts = wp_parse_args( $atts, $defaults ); |
| 247 | - $atts = apply_filters('frm_display_value_atts', $atts, $field, $value); |
|
| 247 | + $atts = apply_filters( 'frm_display_value_atts', $atts, $field, $value ); |
|
| 248 | 248 | |
| 249 | - if ( ! isset($field->field_options['post_field']) ) { |
|
| 249 | + if ( ! isset( $field->field_options['post_field'] ) ) { |
|
| 250 | 250 | $field->field_options['post_field'] = ''; |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | - if ( ! isset($field->field_options['custom_field']) ) { |
|
| 253 | + if ( ! isset( $field->field_options['custom_field'] ) ) { |
|
| 254 | 254 | $field->field_options['custom_field'] = ''; |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | if ( FrmAppHelper::pro_is_installed() && $atts['post_id'] && ( $field->field_options['post_field'] || $atts['type'] == 'tag' ) ) { |
| 258 | 258 | $atts['pre_truncate'] = $atts['truncate']; |
| 259 | 259 | $atts['truncate'] = true; |
| 260 | - $atts['exclude_cat'] = isset($field->field_options['exclude_cat']) ? $field->field_options['exclude_cat'] : 0; |
|
| 260 | + $atts['exclude_cat'] = isset( $field->field_options['exclude_cat'] ) ? $field->field_options['exclude_cat'] : 0; |
|
| 261 | 261 | |
| 262 | - $value = FrmProEntryMetaHelper::get_post_value($atts['post_id'], $field->field_options['post_field'], $field->field_options['custom_field'], $atts); |
|
| 262 | + $value = FrmProEntryMetaHelper::get_post_value( $atts['post_id'], $field->field_options['post_field'], $field->field_options['custom_field'], $atts ); |
|
| 263 | 263 | $atts['truncate'] = $atts['pre_truncate']; |
| 264 | 264 | } |
| 265 | 265 | |
@@ -267,38 +267,38 @@ discard block |
||
| 267 | 267 | return $value; |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | - $value = apply_filters('frm_display_value_custom', maybe_unserialize($value), $field, $atts); |
|
| 270 | + $value = apply_filters( 'frm_display_value_custom', maybe_unserialize( $value ), $field, $atts ); |
|
| 271 | 271 | |
| 272 | 272 | $new_value = ''; |
| 273 | 273 | |
| 274 | - if ( is_array($value) && $atts['type'] != 'file' ) { |
|
| 274 | + if ( is_array( $value ) && $atts['type'] != 'file' ) { |
|
| 275 | 275 | foreach ( $value as $val ) { |
| 276 | - if ( is_array($val) ) { |
|
| 276 | + if ( is_array( $val ) ) { |
|
| 277 | 277 | //TODO: add options for display (li or ,) |
| 278 | - $new_value .= implode($atts['sep'], $val); |
|
| 278 | + $new_value .= implode( $atts['sep'], $val ); |
|
| 279 | 279 | if ( $atts['type'] != 'data' ) { |
| 280 | 280 | $new_value .= '<br/>'; |
| 281 | 281 | } |
| 282 | 282 | } |
| 283 | - unset($val); |
|
| 283 | + unset( $val ); |
|
| 284 | 284 | } |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | - if ( ! empty($new_value) ) { |
|
| 287 | + if ( ! empty( $new_value ) ) { |
|
| 288 | 288 | $value = $new_value; |
| 289 | - } else if ( is_array($value) && $atts['type'] != 'file' && ! $atts['return_array'] ) { |
|
| 290 | - $value = implode($atts['sep'], $value); |
|
| 289 | + } else if ( is_array( $value ) && $atts['type'] != 'file' && ! $atts['return_array'] ) { |
|
| 290 | + $value = implode( $atts['sep'], $value ); |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | if ( $atts['truncate'] && $atts['type'] != 'image' ) { |
| 294 | - $value = FrmAppHelper::truncate($value, 50); |
|
| 294 | + $value = FrmAppHelper::truncate( $value, 50 ); |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | if ( ! $atts['keepjs'] && ! is_array( $value ) ) { |
| 298 | 298 | $value = wp_kses_post( $value ); |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | - return apply_filters('frm_display_value', $value, $field, $atts); |
|
| 301 | + return apply_filters( 'frm_display_value', $value, $field, $atts ); |
|
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | public static function set_posted_value( $field, $value, $args ) { |
@@ -306,20 +306,20 @@ discard block |
||
| 306 | 306 | if ( isset( $args['other'] ) && $args['other'] ) { |
| 307 | 307 | $value = $args['temp_value']; |
| 308 | 308 | } |
| 309 | - if ( empty($args['parent_field_id']) ) { |
|
| 310 | - $_POST['item_meta'][ $field->id ] = $value; |
|
| 309 | + if ( empty( $args['parent_field_id'] ) ) { |
|
| 310 | + $_POST['item_meta'][$field->id] = $value; |
|
| 311 | 311 | } else { |
| 312 | - $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] = $value; |
|
| 312 | + $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field->id] = $value; |
|
| 313 | 313 | } |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | public static function get_posted_value( $field, &$value, $args ) { |
| 317 | 317 | $field_id = is_object( $field ) ? $field->id : $field; |
| 318 | 318 | |
| 319 | - if ( empty($args['parent_field_id']) ) { |
|
| 320 | - $value = isset( $_POST['item_meta'][ $field_id ] ) ? $_POST['item_meta'][ $field_id ] : ''; |
|
| 319 | + if ( empty( $args['parent_field_id'] ) ) { |
|
| 320 | + $value = isset( $_POST['item_meta'][$field_id] ) ? $_POST['item_meta'][$field_id] : ''; |
|
| 321 | 321 | } else { |
| 322 | - $value = isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] ) ? $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field_id ] : ''; |
|
| 322 | + $value = isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] ) ? $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']][$field_id] : ''; |
|
| 323 | 323 | } |
| 324 | 324 | } |
| 325 | 325 | |
@@ -342,12 +342,12 @@ discard block |
||
| 342 | 342 | self::set_other_repeating_vals( $field, $value, $args ); |
| 343 | 343 | |
| 344 | 344 | // Check if there are any posted "Other" values |
| 345 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][ $field->id ] ) ) { |
|
| 345 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta']['other'][$field->id] ) ) { |
|
| 346 | 346 | |
| 347 | 347 | // Save original value |
| 348 | 348 | $args['temp_value'] = $value; |
| 349 | 349 | $args['other'] = true; |
| 350 | - $other_vals = stripslashes_deep( $_POST['item_meta']['other'][ $field->id ] ); |
|
| 350 | + $other_vals = stripslashes_deep( $_POST['item_meta']['other'][$field->id] ); |
|
| 351 | 351 | |
| 352 | 352 | // Set the validation value now |
| 353 | 353 | self::set_other_validation_val( $value, $other_vals, $field, $args ); |
@@ -369,12 +369,12 @@ discard block |
||
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | // Check if there are any other posted "other" values for this field |
| 372 | - if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ] ) ) { |
|
| 372 | + if ( FrmField::is_option_true( $field, 'other' ) && isset( $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id] ) ) { |
|
| 373 | 373 | // Save original value |
| 374 | 374 | $args['temp_value'] = $value; |
| 375 | 375 | $args['other'] = true; |
| 376 | 376 | |
| 377 | - $other_vals = $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ]['other'][ $field->id ]; |
|
| 377 | + $other_vals = $_POST['item_meta'][$args['parent_field_id']][$args['key_pointer']]['other'][$field->id]; |
|
| 378 | 378 | |
| 379 | 379 | // Set the validation value now |
| 380 | 380 | self::set_other_validation_val( $value, $other_vals, $field, $args ); |
@@ -406,27 +406,27 @@ discard block |
||
| 406 | 406 | } |
| 407 | 407 | } else { |
| 408 | 408 | // Radio and dropdowns |
| 409 | - $other_key = array_filter( array_keys($field->options), 'is_string'); |
|
| 409 | + $other_key = array_filter( array_keys( $field->options ), 'is_string' ); |
|
| 410 | 410 | $other_key = reset( $other_key ); |
| 411 | 411 | |
| 412 | 412 | // Multi-select dropdown |
| 413 | 413 | if ( is_array( $value ) ) { |
| 414 | - $o_key = array_search( $field->options[ $other_key ], $value ); |
|
| 414 | + $o_key = array_search( $field->options[$other_key], $value ); |
|
| 415 | 415 | |
| 416 | 416 | if ( $o_key !== false ) { |
| 417 | 417 | // Modify the original value so other key will be preserved |
| 418 | - $value[ $other_key ] = $value[ $o_key ]; |
|
| 418 | + $value[$other_key] = $value[$o_key]; |
|
| 419 | 419 | |
| 420 | 420 | // By default, the array keys will be numeric for multi-select dropdowns |
| 421 | 421 | // If going backwards and forwards between pages, the array key will match the other key |
| 422 | 422 | if ( $o_key != $other_key ) { |
| 423 | - unset( $value[ $o_key ] ); |
|
| 423 | + unset( $value[$o_key] ); |
|
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | $args['temp_value'] = $value; |
| 427 | - $value[ $other_key ] = reset( $other_vals ); |
|
| 427 | + $value[$other_key] = reset( $other_vals ); |
|
| 428 | 428 | } |
| 429 | - } else if ( $field->options[ $other_key ] == $value ) { |
|
| 429 | + } else if ( $field->options[$other_key] == $value ) { |
|
| 430 | 430 | $value = $other_vals; |
| 431 | 431 | } |
| 432 | 432 | } |
@@ -445,9 +445,9 @@ discard block |
||
| 445 | 445 | $content .= "\n\n"; |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | - if ( is_array($val) ) { |
|
| 448 | + if ( is_array( $val ) ) { |
|
| 449 | 449 | $val = FrmAppHelper::array_flatten( $val ); |
| 450 | - $val = implode(',', $val); |
|
| 450 | + $val = implode( ',', $val ); |
|
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | $content .= $val; |
@@ -492,6 +492,6 @@ discard block |
||
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | public static function entries_dropdown() { |
| 495 | - _deprecated_function( __FUNCTION__, '1.07.09'); |
|
| 495 | + _deprecated_function( __FUNCTION__, '1.07.09' ); |
|
| 496 | 496 | } |
| 497 | 497 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -class FrmSettings{ |
|
| 3 | +class FrmSettings { |
|
| 4 | 4 | public $option_name = 'frm_options'; |
| 5 | 5 | public $menu; |
| 6 | 6 | public $mu_menu; |
@@ -28,19 +28,19 @@ discard block |
||
| 28 | 28 | public $re_msg; |
| 29 | 29 | |
| 30 | 30 | public function __construct() { |
| 31 | - if ( ! defined('ABSPATH') ) { |
|
| 32 | - die('You are not allowed to call this page directly.'); |
|
| 31 | + if ( ! defined( 'ABSPATH' ) ) { |
|
| 32 | + die( 'You are not allowed to call this page directly.' ); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - $settings = get_transient($this->option_name); |
|
| 35 | + $settings = get_transient( $this->option_name ); |
|
| 36 | 36 | |
| 37 | - if ( ! is_object($settings) ) { |
|
| 38 | - $settings = $this->translate_settings($settings); |
|
| 37 | + if ( ! is_object( $settings ) ) { |
|
| 38 | + $settings = $this->translate_settings( $settings ); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | foreach ( $settings as $setting_name => $setting ) { |
| 42 | 42 | $this->{$setting_name} = $setting; |
| 43 | - unset($setting_name, $setting); |
|
| 43 | + unset( $setting_name, $setting ); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | $this->set_default_options(); |
@@ -48,24 +48,24 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | private function translate_settings( $settings ) { |
| 50 | 50 | if ( $settings ) { //workaround for W3 total cache conflict |
| 51 | - return unserialize(serialize($settings)); |
|
| 51 | + return unserialize( serialize( $settings ) ); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - $settings = get_option($this->option_name); |
|
| 55 | - if ( is_object($settings) ) { |
|
| 56 | - set_transient($this->option_name, $settings); |
|
| 54 | + $settings = get_option( $this->option_name ); |
|
| 55 | + if ( is_object( $settings ) ) { |
|
| 56 | + set_transient( $this->option_name, $settings ); |
|
| 57 | 57 | return $settings; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | // If unserializing didn't work |
| 61 | 61 | if ( $settings ) { //workaround for W3 total cache conflict |
| 62 | - $settings = unserialize(serialize($settings)); |
|
| 62 | + $settings = unserialize( serialize( $settings ) ); |
|
| 63 | 63 | } else { |
| 64 | 64 | $settings = $this; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - update_option($this->option_name, $settings); |
|
| 68 | - set_transient($this->option_name, $settings); |
|
| 67 | + update_option( $this->option_name, $settings ); |
|
| 68 | + set_transient( $this->option_name, $settings ); |
|
| 69 | 69 | |
| 70 | 70 | return $settings; |
| 71 | 71 | } |
@@ -98,8 +98,8 @@ discard block |
||
| 98 | 98 | private function set_default_options() { |
| 99 | 99 | $this->fill_recaptcha_settings(); |
| 100 | 100 | |
| 101 | - if ( ! isset($this->load_style) ) { |
|
| 102 | - if ( ! isset($this->custom_style) ) { |
|
| 101 | + if ( ! isset( $this->load_style ) ) { |
|
| 102 | + if ( ! isset( $this->custom_style ) ) { |
|
| 103 | 103 | $this->custom_style = true; |
| 104 | 104 | } |
| 105 | 105 | |
@@ -109,16 +109,16 @@ discard block |
||
| 109 | 109 | $this->fill_with_defaults(); |
| 110 | 110 | |
| 111 | 111 | if ( is_multisite() && is_admin() ) { |
| 112 | - $mu_menu = get_site_option('frm_admin_menu_name'); |
|
| 113 | - if ( $mu_menu && ! empty($mu_menu) ) { |
|
| 112 | + $mu_menu = get_site_option( 'frm_admin_menu_name' ); |
|
| 113 | + if ( $mu_menu && ! empty( $mu_menu ) ) { |
|
| 114 | 114 | $this->menu = $mu_menu; |
| 115 | 115 | $this->mu_menu = 1; |
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - $frm_roles = FrmAppHelper::frm_capabilities('pro'); |
|
| 119 | + $frm_roles = FrmAppHelper::frm_capabilities( 'pro' ); |
|
| 120 | 120 | foreach ( $frm_roles as $frm_role => $frm_role_description ) { |
| 121 | - if ( ! isset($this->$frm_role) ) { |
|
| 121 | + if ( ! isset( $this->$frm_role ) ) { |
|
| 122 | 122 | $this->$frm_role = 'administrator'; |
| 123 | 123 | } |
| 124 | 124 | } |
@@ -128,12 +128,12 @@ discard block |
||
| 128 | 128 | $settings = $this->default_options(); |
| 129 | 129 | |
| 130 | 130 | foreach ( $settings as $setting => $default ) { |
| 131 | - if ( isset( $params[ 'frm_' . $setting ] ) ) { |
|
| 132 | - $this->{$setting} = $params[ 'frm_' . $setting ]; |
|
| 133 | - } else if ( ! isset($this->{$setting}) ) { |
|
| 131 | + if ( isset( $params['frm_' . $setting] ) ) { |
|
| 132 | + $this->{$setting} = $params['frm_' . $setting]; |
|
| 133 | + } else if ( ! isset( $this->{$setting}) ) { |
|
| 134 | 134 | $this->{$setting} = $default; |
| 135 | 135 | } |
| 136 | - unset($setting, $default); |
|
| 136 | + unset( $setting, $default ); |
|
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | |
@@ -141,23 +141,23 @@ discard block |
||
| 141 | 141 | $privkey = ''; |
| 142 | 142 | $re_lang = 'en'; |
| 143 | 143 | |
| 144 | - if ( ! isset($this->pubkey) ) { |
|
| 144 | + if ( ! isset( $this->pubkey ) ) { |
|
| 145 | 145 | // get the options from the database |
| 146 | - $recaptcha_opt = is_multisite() ? get_site_option('recaptcha') : get_option('recaptcha'); |
|
| 147 | - $this->pubkey = isset($recaptcha_opt['pubkey']) ? $recaptcha_opt['pubkey'] : ''; |
|
| 148 | - $privkey = isset($recaptcha_opt['privkey']) ? $recaptcha_opt['privkey'] : $privkey; |
|
| 149 | - $re_lang = isset($recaptcha_opt['re_lang']) ? $recaptcha_opt['re_lang'] : $re_lang; |
|
| 146 | + $recaptcha_opt = is_multisite() ? get_site_option( 'recaptcha' ) : get_option( 'recaptcha' ); |
|
| 147 | + $this->pubkey = isset( $recaptcha_opt['pubkey'] ) ? $recaptcha_opt['pubkey'] : ''; |
|
| 148 | + $privkey = isset( $recaptcha_opt['privkey'] ) ? $recaptcha_opt['privkey'] : $privkey; |
|
| 149 | + $re_lang = isset( $recaptcha_opt['re_lang'] ) ? $recaptcha_opt['re_lang'] : $re_lang; |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - if ( ! isset($this->re_msg) || empty($this->re_msg) ) { |
|
| 152 | + if ( ! isset( $this->re_msg ) || empty( $this->re_msg ) ) { |
|
| 153 | 153 | $this->re_msg = __( 'The reCAPTCHA was not entered correctly', 'formidable' ); |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - if ( ! isset($this->privkey) ) { |
|
| 156 | + if ( ! isset( $this->privkey ) ) { |
|
| 157 | 157 | $this->privkey = $privkey; |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - if ( ! isset($this->re_lang) ) { |
|
| 160 | + if ( ! isset( $this->re_lang ) ) { |
|
| 161 | 161 | $this->re_lang = $re_lang; |
| 162 | 162 | } |
| 163 | 163 | } |
@@ -168,31 +168,31 @@ discard block |
||
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | public function update( $params ) { |
| 171 | - $this->fill_with_defaults($params); |
|
| 172 | - $this->update_settings($params); |
|
| 171 | + $this->fill_with_defaults( $params ); |
|
| 172 | + $this->update_settings( $params ); |
|
| 173 | 173 | |
| 174 | 174 | if ( $this->mu_menu ) { |
| 175 | - update_site_option('frm_admin_menu_name', $this->menu); |
|
| 176 | - } else if ( current_user_can('administrator') ) { |
|
| 177 | - update_site_option('frm_admin_menu_name', false); |
|
| 175 | + update_site_option( 'frm_admin_menu_name', $this->menu ); |
|
| 176 | + } else if ( current_user_can( 'administrator' ) ) { |
|
| 177 | + update_site_option( 'frm_admin_menu_name', false ); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - $this->update_roles($params); |
|
| 180 | + $this->update_roles( $params ); |
|
| 181 | 181 | |
| 182 | 182 | do_action( 'frm_update_settings', $params ); |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | private function update_settings( $params ) { |
| 186 | - $this->mu_menu = isset($params['frm_mu_menu']) ? $params['frm_mu_menu'] : 0; |
|
| 186 | + $this->mu_menu = isset( $params['frm_mu_menu'] ) ? $params['frm_mu_menu'] : 0; |
|
| 187 | 187 | |
| 188 | - $this->pubkey = trim($params['frm_pubkey']); |
|
| 188 | + $this->pubkey = trim( $params['frm_pubkey'] ); |
|
| 189 | 189 | $this->privkey = $params['frm_privkey']; |
| 190 | 190 | $this->re_lang = $params['frm_re_lang']; |
| 191 | 191 | |
| 192 | 192 | $this->load_style = $params['frm_load_style']; |
| 193 | 193 | $this->preview_page_id = (int) $params['frm-preview-page-id']; |
| 194 | 194 | |
| 195 | - $this->use_html = isset($params['frm_use_html']) ? $params['frm_use_html'] : 0; |
|
| 195 | + $this->use_html = isset( $params['frm_use_html'] ) ? $params['frm_use_html'] : 0; |
|
| 196 | 196 | //$this->custom_style = isset($params['frm_custom_style']) ? $params['frm_custom_style'] : 0; |
| 197 | 197 | $this->jquery_css = isset( $params['frm_jquery_css'] ) ? absint( $params['frm_jquery_css'] ) : 0; |
| 198 | 198 | $this->accordion_js = isset( $params['frm_accordion_js'] ) ? absint( $params['frm_accordion_js'] ) : 0; |
@@ -205,30 +205,30 @@ discard block |
||
| 205 | 205 | $frm_roles = FrmAppHelper::frm_capabilities(); |
| 206 | 206 | $roles = get_editable_roles(); |
| 207 | 207 | foreach ( $frm_roles as $frm_role => $frm_role_description ) { |
| 208 | - $this->$frm_role = (array) ( isset( $params[ $frm_role ] ) ? $params[ $frm_role ] : 'administrator' ); |
|
| 208 | + $this->$frm_role = (array) ( isset( $params[$frm_role] ) ? $params[$frm_role] : 'administrator' ); |
|
| 209 | 209 | |
| 210 | - if ( count($this->$frm_role) === 1 ) { |
|
| 211 | - $set_role = reset($this->$frm_role); |
|
| 210 | + if ( count( $this->$frm_role ) === 1 ) { |
|
| 211 | + $set_role = reset( $this->$frm_role ); |
|
| 212 | 212 | switch ( $set_role ) { |
| 213 | 213 | case 'subscriber': |
| 214 | - array_push($this->$frm_role, 'contributor'); |
|
| 214 | + array_push( $this->$frm_role, 'contributor' ); |
|
| 215 | 215 | case 'contributor': |
| 216 | - array_push($this->$frm_role, 'author'); |
|
| 216 | + array_push( $this->$frm_role, 'author' ); |
|
| 217 | 217 | case 'author': |
| 218 | - array_push($this->$frm_role, 'editor'); |
|
| 218 | + array_push( $this->$frm_role, 'editor' ); |
|
| 219 | 219 | case 'editor': |
| 220 | - array_push($this->$frm_role, 'administrator'); |
|
| 220 | + array_push( $this->$frm_role, 'administrator' ); |
|
| 221 | 221 | } |
| 222 | - unset($set_role); |
|
| 222 | + unset( $set_role ); |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | foreach ( $roles as $role => $details ) { |
| 226 | - if ( in_array($role, $this->$frm_role) ) { |
|
| 226 | + if ( in_array( $role, $this->$frm_role ) ) { |
|
| 227 | 227 | $wp_roles->add_cap( $role, $frm_role ); |
| 228 | 228 | } else { |
| 229 | 229 | $wp_roles->remove_cap( $role, $frm_role ); |
| 230 | 230 | } |
| 231 | - unset($role, $details); |
|
| 231 | + unset( $role, $details ); |
|
| 232 | 232 | } |
| 233 | 233 | } |
| 234 | 234 | } |
@@ -236,10 +236,10 @@ discard block |
||
| 236 | 236 | public function store() { |
| 237 | 237 | // Save the posted value in the database |
| 238 | 238 | |
| 239 | - update_option('frm_options', $this); |
|
| 239 | + update_option( 'frm_options', $this ); |
|
| 240 | 240 | |
| 241 | - delete_transient('frm_options'); |
|
| 242 | - set_transient('frm_options', $this); |
|
| 241 | + delete_transient( 'frm_options' ); |
|
| 242 | + set_transient( 'frm_options', $this ); |
|
| 243 | 243 | |
| 244 | 244 | do_action( 'frm_store_settings' ); |
| 245 | 245 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! isset( $entry) ) { |
|
| 2 | +if ( ! isset( $entry ) ) { |
|
| 3 | 3 | $entry = $record; |
| 4 | 4 | } ?> |
| 5 | 5 | |
@@ -18,4 +18,4 @@ discard block |
||
| 18 | 18 | </div> |
| 19 | 19 | <?php } ?> |
| 20 | 20 | |
| 21 | -<?php do_action('frm_entry_shared_sidebar', $entry); ?> |
|
| 21 | +<?php do_action( 'frm_entry_shared_sidebar', $entry ); ?> |
|
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( isset($include_extra_container) ) { ?> |
|
| 2 | +if ( isset( $include_extra_container ) ) { ?> |
|
| 3 | 3 | <div class="<?php echo esc_attr( $include_extra_container ) ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container"> |
| 4 | 4 | <?php |
| 5 | 5 | } |
@@ -7,14 +7,14 @@ discard block |
||
| 7 | 7 | if ( FrmAppHelper::is_admin() ) { |
| 8 | 8 | ?><div id="message" class="frm_message updated frm_msg_padding"><?php echo wp_kses_post( $message ) ?></div><?php |
| 9 | 9 | } else { |
| 10 | - FrmFormsHelper::get_scroll_js($form->id); |
|
| 10 | + FrmFormsHelper::get_scroll_js( $form->id ); |
|
| 11 | 11 | |
| 12 | 12 | // we need to allow scripts here for javascript in the success message |
| 13 | 13 | echo $message; |
| 14 | 14 | } |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | -if ( isset($errors) && is_array( $errors ) && ! empty( $errors ) ) { |
|
| 17 | +if ( isset( $errors ) && is_array( $errors ) && ! empty( $errors ) ) { |
|
| 18 | 18 | |
| 19 | 19 | if ( isset( $form ) && is_object( $form ) ) { |
| 20 | 20 | FrmFormsHelper::get_scroll_js( $form->id ); |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | <?php |
| 24 | 24 | $img = ''; |
| 25 | 25 | if ( ! FrmAppHelper::is_admin() ) { |
| 26 | - $img = apply_filters('frm_error_icon', $img); |
|
| 27 | - if ( $img && ! empty($img) ) { |
|
| 26 | + $img = apply_filters( 'frm_error_icon', $img ); |
|
| 27 | + if ( $img && ! empty( $img ) ) { |
|
| 28 | 28 | ?><img src="<?php echo esc_attr( $img ) ?>" alt="" /> |
| 29 | 29 | <?php |
| 30 | 30 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | <?php |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | -if ( isset($include_extra_container) ) { ?> |
|
| 40 | +if ( isset( $include_extra_container ) ) { ?> |
|
| 41 | 41 | </div> |
| 42 | 42 | <?php |
| 43 | 43 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( empty($values) || ! isset($values['fields']) || empty($values['fields']) ) { ?> |
|
| 3 | -<div class="frm_forms <?php echo FrmFormsHelper::get_form_style_class($form); ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container"> |
|
| 2 | +if ( empty( $values ) || ! isset( $values['fields'] ) || empty( $values['fields'] ) ) { ?> |
|
| 3 | +<div class="frm_forms <?php echo FrmFormsHelper::get_form_style_class( $form ); ?>" id="frm_form_<?php echo esc_attr( $form->id ) ?>_container"> |
|
| 4 | 4 | <div class="frm_error_style"><strong><?php _e( 'Oops!', 'formidable' ) ?></strong> <?php printf( __( 'You did not add any fields to your form. %1$sGo back%2$s and add some.', 'formidable' ), '<a href="' . esc_url( admin_url( '?page=formidable&frm_action=edit&id=' . $form->id ) ) . '">', '</a>' ) ?> |
| 5 | 5 | </div> |
| 6 | 6 | </div> |
@@ -21,11 +21,11 @@ discard block |
||
| 21 | 21 | <div class="frm_form_fields <?php echo esc_attr( apply_filters( 'frm_form_fields_class', '', $values ) ); ?>"> |
| 22 | 22 | <fieldset> |
| 23 | 23 | <?php echo FrmFormsHelper::replace_shortcodes( $values['before_html'], $form, $title, $description ); ?> |
| 24 | -<input type="hidden" name="frm_action" value="<?php echo esc_attr($form_action) ?>" /> |
|
| 25 | -<input type="hidden" name="form_id" value="<?php echo esc_attr($form->id) ?>" /> |
|
| 26 | -<input type="hidden" name="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" id="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" value="<?php echo esc_attr($frm_hide_fields) ?>" /> |
|
| 24 | +<input type="hidden" name="frm_action" value="<?php echo esc_attr( $form_action ) ?>" /> |
|
| 25 | +<input type="hidden" name="form_id" value="<?php echo esc_attr( $form->id ) ?>" /> |
|
| 26 | +<input type="hidden" name="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" id="frm_hide_fields_<?php echo esc_attr( $form->id ) ?>" value="<?php echo esc_attr( $frm_hide_fields ) ?>" /> |
|
| 27 | 27 | <input type="hidden" name="frm_helpers_<?php echo esc_attr( $form->id ) ?>" id="frm_helpers_<?php echo esc_attr( $form->id ) ?>" value="<?php echo esc_attr( $frm_helpers ) ?>" /> |
| 28 | -<input type="hidden" name="form_key" value="<?php echo esc_attr($form->form_key) ?>" /> |
|
| 28 | +<input type="hidden" name="form_key" value="<?php echo esc_attr( $form->form_key ) ?>" /> |
|
| 29 | 29 | <input type="hidden" name="item_meta[0]" value="" /> |
| 30 | 30 | <?php wp_nonce_field( 'frm_submit_entry_nonce', 'frm_submit_entry_' . $form->id ); ?> |
| 31 | 31 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | } else { |
| 39 | 39 | do_action( 'frm_show_other_field_type', $field, $form, array( 'action' => $form_action ) ); |
| 40 | 40 | } |
| 41 | - do_action('frm_get_field_scripts', $field, $form, $form->id); |
|
| 41 | + do_action( 'frm_get_field_scripts', $field, $form, $form->id ); |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
@@ -46,13 +46,13 @@ discard block |
||
| 46 | 46 | if ( FrmAppHelper::is_admin() ) { ?> |
| 47 | 47 | <div class="frm_form_field form-field"> |
| 48 | 48 | <label class="frm_primary_label"><?php _e( 'Entry Key', 'formidable' ) ?></label> |
| 49 | -<input type="text" name="item_key" value="<?php echo esc_attr($values['item_key']) ?>" /> |
|
| 49 | +<input type="text" name="item_key" value="<?php echo esc_attr( $values['item_key'] ) ?>" /> |
|
| 50 | 50 | </div> |
| 51 | 51 | <?php } else { ?> |
| 52 | -<input type="hidden" name="item_key" value="<?php echo esc_attr($values['item_key']) ?>" /> |
|
| 52 | +<input type="hidden" name="item_key" value="<?php echo esc_attr( $values['item_key'] ) ?>" /> |
|
| 53 | 53 | <?php } |
| 54 | 54 | |
| 55 | -do_action('frm_entry_form', $form, $form_action, $errors); |
|
| 55 | +do_action( 'frm_entry_form', $form, $form_action, $errors ); |
|
| 56 | 56 | |
| 57 | 57 | global $frm_vars; |
| 58 | 58 | // close open section div |
@@ -62,23 +62,23 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | // close open collapsible toggle div |
| 65 | -if ( isset($frm_vars['collapse_div']) && $frm_vars['collapse_div'] ) { |
|
| 65 | +if ( isset( $frm_vars['collapse_div'] ) && $frm_vars['collapse_div'] ) { |
|
| 66 | 66 | echo "</div>\n"; |
| 67 | - unset($frm_vars['collapse_div']); |
|
| 67 | + unset( $frm_vars['collapse_div'] ); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | -echo FrmFormsHelper::replace_shortcodes($values['after_html'], $form); |
|
| 70 | +echo FrmFormsHelper::replace_shortcodes( $values['after_html'], $form ); |
|
| 71 | 71 | |
| 72 | 72 | |
| 73 | -if ( has_action('frm_entries_footer_scripts') ) { ?> |
|
| 73 | +if ( has_action( 'frm_entries_footer_scripts' ) ) { ?> |
|
| 74 | 74 | <script type="text/javascript"> |
| 75 | -<?php do_action('frm_entries_footer_scripts', $values['fields'], $form); ?> |
|
| 75 | +<?php do_action( 'frm_entries_footer_scripts', $values['fields'], $form ); ?> |
|
| 76 | 76 | </script><?php |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | if ( FrmForm::show_submit( $form ) ) { |
| 80 | - unset($values['fields']); |
|
| 81 | - FrmFormsHelper::get_custom_submit($values['submit_html'], $form, $submit, $form_action, $values); |
|
| 80 | + unset( $values['fields'] ); |
|
| 81 | + FrmFormsHelper::get_custom_submit( $values['submit_html'], $form, $submit, $form_action, $values ); |
|
| 82 | 82 | } |
| 83 | 83 | ?> |
| 84 | 84 | </fieldset> |
@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <li id="frm_delete_field_<?php echo esc_attr( $field['id'] ); ?>-<?php echo esc_attr( $opt_key ) ?>_container" class="frm_single_option"> |
| 2 | 2 | <a href="javascript:void(0)" class="frm_single_visible_hover frm_icon_font frm_delete_icon" data-fid="<?php echo esc_attr( $field['id'] ); ?>"> </a> |
| 3 | 3 | <?php if ( $field['type'] != 'select' ) { ?> |
| 4 | - <input type="<?php echo esc_attr( $field['type'] ) ?>" name="<?php echo esc_attr( $field_name ) ?><?php echo ( $field['type'] == 'checkbox' ) ? '[]' : ''; ?>" value="<?php echo esc_attr($field_val) ?>"<?php echo isset( $checked ) ? $checked : ''; ?>/> |
|
| 4 | + <input type="<?php echo esc_attr( $field['type'] ) ?>" name="<?php echo esc_attr( $field_name ) ?><?php echo ( $field['type'] == 'checkbox' ) ? '[]' : ''; ?>" value="<?php echo esc_attr( $field_val ) ?>"<?php echo isset( $checked ) ? $checked : ''; ?>/> |
|
| 5 | 5 | <?php } ?> |
| 6 | - <label class="frm_ipe_field_option field_<?php echo esc_attr( $field['id'] ) ?>_option <?php echo $field['separate_value'] ? 'frm_with_key' : ''; ?>" id="<?php echo esc_attr( $html_id . '-' . $opt_key ) ?>"><?php echo ($opt == '') ? __( '(Blank)', 'formidable' ) : $opt ?></label> |
|
| 6 | + <label class="frm_ipe_field_option field_<?php echo esc_attr( $field['id'] ) ?>_option <?php echo $field['separate_value'] ? 'frm_with_key' : ''; ?>" id="<?php echo esc_attr( $html_id . '-' . $opt_key ) ?>"><?php echo ( $opt == '' ) ? __( '(Blank)', 'formidable' ) : $opt ?></label> |
|
| 7 | 7 | <span class="frm_option_key field_<?php echo esc_attr( $field['id'] ) ?>_option_key<?php echo $field['separate_value'] ? '' : ' frm_hidden'; ?>"> |
| 8 | 8 | <label class="frm-show-click frm_ipe_field_option_key" id="field_key_<?php echo esc_attr( $field['id'] . '-' . $opt_key ) ?>"><?php echo ( $field_val == '' ) ? esc_html__( '(Blank)', 'formidable' ) : $field_val ?></label> |
| 9 | 9 | </span> |
| 10 | 10 | </li> |
| 11 | 11 | <?php |
| 12 | -unset($field_val, $opt, $opt_key); |
|
| 12 | +unset( $field_val, $opt, $opt_key ); |
|
@@ -1,16 +1,16 @@ discard block |
||
| 1 | -<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name('post_excerpt', '') ) ?>" class="frm_action_name" value="<?php echo esc_attr( $form_action->post_excerpt ); ?>" /> |
|
| 2 | -<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name('ID', '') ) ?>" value="<?php echo esc_attr( $form_action->ID ); ?>" /> |
|
| 1 | +<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'post_excerpt', '' ) ) ?>" class="frm_action_name" value="<?php echo esc_attr( $form_action->post_excerpt ); ?>" /> |
|
| 2 | +<input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'ID', '' ) ) ?>" value="<?php echo esc_attr( $form_action->ID ); ?>" /> |
|
| 3 | 3 | |
| 4 | 4 | <table class="form-table"> |
| 5 | 5 | <tr> |
| 6 | 6 | <th> |
| 7 | - <label <?php FrmAppHelper::maybe_add_tooltip('action_title') ?>><?php _e( 'Label', 'formidable' ) ?></label> |
|
| 7 | + <label <?php FrmAppHelper::maybe_add_tooltip( 'action_title' ) ?>><?php _e( 'Label', 'formidable' ) ?></label> |
|
| 8 | 8 | </th> |
| 9 | - <td><input type="text" name="<?php echo esc_attr( $action_control->get_field_name('post_title', '') ) ?>" value="<?php echo esc_attr($form_action->post_title); ?>" class="large-text <?php FrmAppHelper::maybe_add_tooltip('action_title', 'open') ?>" id="<?php echo esc_attr( $action_control->get_field_id('action_post_title') ) ?>" /> |
|
| 9 | + <td><input type="text" name="<?php echo esc_attr( $action_control->get_field_name( 'post_title', '' ) ) ?>" value="<?php echo esc_attr( $form_action->post_title ); ?>" class="large-text <?php FrmAppHelper::maybe_add_tooltip( 'action_title', 'open' ) ?>" id="<?php echo esc_attr( $action_control->get_field_id( 'action_post_title' ) ) ?>" /> |
|
| 10 | 10 | </td> |
| 11 | 11 | </tr> |
| 12 | 12 | </table> |
| 13 | -<?php $action_control->form($form_action, compact('form', 'action_key', 'values')); ?> |
|
| 13 | +<?php $action_control->form( $form_action, compact( 'form', 'action_key', 'values' ) ); ?> |
|
| 14 | 14 | |
| 15 | 15 | <table class="form-table frm-no-margin"> |
| 16 | 16 | <tr><td> |
@@ -25,18 +25,18 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | if ( count( $action_control->action_options['event'] ) == 1 || $action_control->action_options['force_event'] ) { |
| 27 | 27 | foreach ( $action_control->action_options['event'] as $e ) { ?> |
| 28 | - <input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name('event') ) ?>[]" value="<?php echo esc_attr( $e ) ?>" /> |
|
| 28 | + <input type="hidden" name="<?php echo esc_attr( $action_control->get_field_name( 'event' ) ) ?>[]" value="<?php echo esc_attr( $e ) ?>" /> |
|
| 29 | 29 | <?php |
| 30 | 30 | } |
| 31 | 31 | } else { |
| 32 | 32 | ?> |
| 33 | 33 | <p><label class="frm_left_label"><?php _e( 'Trigger this action after', 'formidable' ) ?></label> |
| 34 | - <select name="<?php echo esc_attr( $action_control->get_field_name('event') ) ?>[]" multiple="multiple" class="frm_multiselect" id="<?php echo esc_attr( $action_control->get_field_id('event') ) ?>"> |
|
| 34 | + <select name="<?php echo esc_attr( $action_control->get_field_name( 'event' ) ) ?>[]" multiple="multiple" class="frm_multiselect" id="<?php echo esc_attr( $action_control->get_field_id( 'event' ) ) ?>"> |
|
| 35 | 35 | <?php |
| 36 | 36 | |
| 37 | 37 | $event_labels = FrmFormAction::trigger_labels(); |
| 38 | 38 | foreach ( $action_control->action_options['event'] as $event ) { ?> |
| 39 | - <option value="<?php echo esc_attr( $event ) ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo isset( $event_labels[ $event ] ) ? $event_labels[ $event ] : $event; ?></option> |
|
| 39 | + <option value="<?php echo esc_attr( $event ) ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo isset( $event_labels[$event] ) ? $event_labels[$event] : $event; ?></option> |
|
| 40 | 40 | <?php |
| 41 | 41 | } |
| 42 | 42 | ?> </select> |
@@ -47,6 +47,6 @@ discard block |
||
| 47 | 47 | do_action( 'frm_additional_action_settings', $form_action, compact( 'form', 'action_control', 'action_key', 'values' ) ); |
| 48 | 48 | |
| 49 | 49 | ?> |
| 50 | - <span class="alignright frm_action_id <?php echo empty( $form_action->ID ) ? 'frm_hidden' : ''; ?>"><?php printf( __( 'Action ID: %1$s', 'formidable' ), $form_action->ID); ?></span> |
|
| 50 | + <span class="alignright frm_action_id <?php echo empty( $form_action->ID ) ? 'frm_hidden' : ''; ?>"><?php printf( __( 'Action ID: %1$s', 'formidable' ), $form_action->ID ); ?></span> |
|
| 51 | 51 | </td></tr> |
| 52 | 52 | </table> |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | // add register action |
| 13 | 13 | class FrmDefRegAction extends FrmFormAction { |
| 14 | 14 | public function __construct() { |
| 15 | - $action_ops = FrmFormAction::default_action_opts('frm_register_icon'); |
|
| 15 | + $action_ops = FrmFormAction::default_action_opts( 'frm_register_icon' ); |
|
| 16 | 16 | parent::__construct( 'register', __( 'Register User', 'formidable' ), $action_ops ); |
| 17 | 17 | } |
| 18 | 18 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | // add paypal action |
| 21 | 21 | class FrmDefPayPalAction extends FrmFormAction { |
| 22 | 22 | public function __construct() { |
| 23 | - $action_ops = FrmFormAction::default_action_opts('frm_paypal_icon'); |
|
| 23 | + $action_ops = FrmFormAction::default_action_opts( 'frm_paypal_icon' ); |
|
| 24 | 24 | parent::__construct( 'paypal', __( 'Collect Payment', 'formidable' ), $action_ops ); |
| 25 | 25 | } |
| 26 | 26 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | // add aweber action |
| 29 | 29 | class FrmDefAweberAction extends FrmFormAction { |
| 30 | 30 | public function __construct() { |
| 31 | - $action_ops = FrmFormAction::default_action_opts('frm_aweber_icon'); |
|
| 31 | + $action_ops = FrmFormAction::default_action_opts( 'frm_aweber_icon' ); |
|
| 32 | 32 | parent::__construct( 'aweber', __( 'Aweber', 'formidable' ), $action_ops ); |
| 33 | 33 | } |
| 34 | 34 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | // add mailchimp action |
| 37 | 37 | class FrmDefMlcmpAction extends FrmFormAction { |
| 38 | 38 | public function __construct() { |
| 39 | - $action_ops = FrmFormAction::default_action_opts('frm_mailchimp_icon'); |
|
| 39 | + $action_ops = FrmFormAction::default_action_opts( 'frm_mailchimp_icon' ); |
|
| 40 | 40 | parent::__construct( 'mailchimp', __( 'MailChimp', 'formidable' ), $action_ops ); |
| 41 | 41 | } |
| 42 | 42 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | // add twilio action |
| 45 | 45 | class FrmDefTwilioAction extends FrmFormAction { |
| 46 | 46 | public function __construct() { |
| 47 | - $action_ops = FrmFormAction::default_action_opts('frm_sms_icon'); |
|
| 47 | + $action_ops = FrmFormAction::default_action_opts( 'frm_sms_icon' ); |
|
| 48 | 48 | parent::__construct( 'twilio', __( 'Twilio', 'formidable' ), $action_ops ); |
| 49 | 49 | } |
| 50 | 50 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | // add highrise action |
| 53 | 53 | class FrmDefHrsAction extends FrmFormAction { |
| 54 | 54 | public function __construct() { |
| 55 | - $action_ops = FrmFormAction::default_action_opts('frm_highrise_icon'); |
|
| 55 | + $action_ops = FrmFormAction::default_action_opts( 'frm_highrise_icon' ); |
|
| 56 | 56 | parent::__construct( 'highrise', __( 'Highrise', 'formidable' ), $action_ops ); |
| 57 | 57 | } |
| 58 | 58 | } |