@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <div class="field-group clearfix frm-half frm-first-row"> |
| 2 | 2 | <label><?php _e( 'Size', 'formidable' ) ?></label> |
| 3 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_size') ) ?>" id="frm_title_size" value="<?php echo esc_attr( $style->post_content['title_size'] ) ?>" /> |
|
| 3 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'title_size' ) ) ?>" id="frm_title_size" value="<?php echo esc_attr( $style->post_content['title_size'] ) ?>" /> |
|
| 4 | 4 | </div> |
| 5 | 5 | |
| 6 | 6 | <div class="field-group clearfix frm-half frm-first-row"> |
| 7 | 7 | <label><?php _e( 'Color', 'formidable' ) ?></label> |
| 8 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_color') ) ?>" id="frm_title_color" class="hex" value="<?php echo esc_attr( $style->post_content['title_color'] ) ?>" /> |
|
| 8 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'title_color' ) ) ?>" id="frm_title_color" class="hex" value="<?php echo esc_attr( $style->post_content['title_color'] ) ?>" /> |
|
| 9 | 9 | </div> |
| 10 | 10 | <div class="field-group clearfix frm-half"> |
| 11 | 11 | <label><?php _e( 'Margin Top', 'formidable' ) ?></label> |
| 12 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_margin_top') ) ?>" id="frm_title_margin_top" value="<?php echo esc_attr( $style->post_content['title_margin_top'] ) ?>" size="4" /> |
|
| 12 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'title_margin_top' ) ) ?>" id="frm_title_margin_top" value="<?php echo esc_attr( $style->post_content['title_margin_top'] ) ?>" size="4" /> |
|
| 13 | 13 | </div> |
| 14 | 14 | <div class="field-group clearfix frm-half"> |
| 15 | 15 | <label><?php _e( 'Margin Bottom', 'formidable' ) ?></label> |
| 16 | - <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name('title_margin_bottom') ) ?>" id="frm_title_margin_bottom" value="<?php echo esc_attr( $style->post_content['title_margin_bottom'] ) ?>" size="4" /> |
|
| 16 | + <input type="text" name="<?php echo esc_attr( $frm_style->get_field_name( 'title_margin_bottom' ) ) ?>" id="frm_title_margin_bottom" value="<?php echo esc_attr( $style->post_content['title_margin_bottom'] ) ?>" size="4" /> |
|
| 17 | 17 | </div> |
@@ -181,13 +181,13 @@ |
||
| 181 | 181 | ), |
| 182 | 182 | ); |
| 183 | 183 | $random = rand( 0, count( $tips ) - 1 ); |
| 184 | - $tip = $tips[ $random ]; |
|
| 184 | + $tip = $tips[$random]; |
|
| 185 | 185 | $tip['num'] = $random; |
| 186 | 186 | return $tip; |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | public static function get_random_tip( $tips ) { |
| 190 | 190 | $random = rand( 0, count( $tips ) - 1 ); |
| 191 | - return $tips[ $random ]; |
|
| 191 | + return $tips[$random]; |
|
| 192 | 192 | } |
| 193 | 193 | } |
@@ -48,17 +48,17 @@ discard block |
||
| 48 | 48 | 'highrise' => 'FrmDefHrsAction', |
| 49 | 49 | ) ); |
| 50 | 50 | |
| 51 | - include_once(FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/email_action.php'); |
|
| 52 | - include_once(FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/default_actions.php'); |
|
| 51 | + include_once( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/email_action.php' ); |
|
| 52 | + include_once( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/default_actions.php' ); |
|
| 53 | 53 | |
| 54 | 54 | foreach ( $action_classes as $action_class ) { |
| 55 | - self::$registered_actions->register($action_class); |
|
| 55 | + self::$registered_actions->register( $action_class ); |
|
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | public static function get_form_actions( $action = 'all' ) { |
| 60 | 60 | $temp_actions = self::$registered_actions; |
| 61 | - if ( empty($temp_actions) ) { |
|
| 61 | + if ( empty( $temp_actions ) ) { |
|
| 62 | 62 | self::actions_init(); |
| 63 | 63 | $temp_actions = self::$registered_actions->actions; |
| 64 | 64 | } else { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | return $a; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - $actions[ $a->id_base ] = $a; |
|
| 75 | + $actions[$a->id_base] = $a; |
|
| 76 | 76 | } |
| 77 | 77 | unset( $temp_actions, $a ); |
| 78 | 78 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | arsort( $temp_actions ); |
| 87 | 87 | foreach ( $temp_actions as $type => $a ) { |
| 88 | 88 | if ( ! isset( $a->action_options['active'] ) || empty( $a->action_options['active'] ) ) { |
| 89 | - unset( $actions[ $type ] ); |
|
| 89 | + unset( $actions[$type] ); |
|
| 90 | 90 | if ( count( $actions ) <= $action_limit ) { |
| 91 | 91 | break; |
| 92 | 92 | } |
@@ -118,26 +118,26 @@ discard block |
||
| 118 | 118 | $action_map = array(); |
| 119 | 119 | |
| 120 | 120 | foreach ( $action_controls as $key => $control ) { |
| 121 | - $action_map[ $control->id_base ] = $key; |
|
| 121 | + $action_map[$control->id_base] = $key; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | foreach ( $form_actions as $action ) { |
| 125 | - if ( ! isset( $action_map[ $action->post_excerpt ] ) ) { |
|
| 125 | + if ( ! isset( $action_map[$action->post_excerpt] ) ) { |
|
| 126 | 126 | // don't try and show settings if action no longer exists |
| 127 | 127 | continue; |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - self::action_control( $action, $form, $action->ID, $action_controls[ $action_map[ $action->post_excerpt ] ], $values ); |
|
| 130 | + self::action_control( $action, $form, $action->ID, $action_controls[$action_map[$action->post_excerpt]], $values ); |
|
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | public static function action_control( $form_action, $form, $action_key, $action_control, $values ) { |
| 135 | - $action_control->_set($action_key); |
|
| 135 | + $action_control->_set( $action_key ); |
|
| 136 | 136 | include( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/form_action.php' ); |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | public static function add_form_action() { |
| 140 | - FrmAppHelper::permission_check('frm_edit_forms'); |
|
| 140 | + FrmAppHelper::permission_check( 'frm_edit_forms' ); |
|
| 141 | 141 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
| 142 | 142 | |
| 143 | 143 | global $frm_vars; |
@@ -146,55 +146,55 @@ discard block |
||
| 146 | 146 | $action_type = sanitize_text_field( $_POST['type'] ); |
| 147 | 147 | |
| 148 | 148 | $action_control = self::get_form_actions( $action_type ); |
| 149 | - $action_control->_set($action_key); |
|
| 149 | + $action_control->_set( $action_key ); |
|
| 150 | 150 | |
| 151 | 151 | $form_id = absint( $_POST['form_id'] ); |
| 152 | 152 | |
| 153 | - $form_action = $action_control->prepare_new($form_id); |
|
| 153 | + $form_action = $action_control->prepare_new( $form_id ); |
|
| 154 | 154 | |
| 155 | 155 | $values = array(); |
| 156 | - $form = self::fields_to_values($form_id, $values); |
|
| 156 | + $form = self::fields_to_values( $form_id, $values ); |
|
| 157 | 157 | |
| 158 | 158 | include( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/form_action.php' ); |
| 159 | 159 | wp_die(); |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | public static function fill_action() { |
| 163 | - FrmAppHelper::permission_check('frm_edit_forms'); |
|
| 163 | + FrmAppHelper::permission_check( 'frm_edit_forms' ); |
|
| 164 | 164 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
| 165 | 165 | |
| 166 | 166 | $action_key = absint( $_POST['action_id'] ); |
| 167 | 167 | $action_type = sanitize_text_field( $_POST['action_type'] ); |
| 168 | 168 | |
| 169 | 169 | $action_control = self::get_form_actions( $action_type ); |
| 170 | - if ( empty($action_control) ) { |
|
| 170 | + if ( empty( $action_control ) ) { |
|
| 171 | 171 | wp_die(); |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | $form_action = $action_control->get_single_action( $action_key ); |
| 175 | 175 | |
| 176 | 176 | $values = array(); |
| 177 | - $form = self::fields_to_values($form_action->menu_order, $values); |
|
| 177 | + $form = self::fields_to_values( $form_action->menu_order, $values ); |
|
| 178 | 178 | |
| 179 | 179 | include( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/_action_inside.php' ); |
| 180 | 180 | wp_die(); |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | private static function fields_to_values( $form_id, array &$values ) { |
| 184 | - $form = FrmForm::getOne($form_id); |
|
| 184 | + $form = FrmForm::getOne( $form_id ); |
|
| 185 | 185 | |
| 186 | 186 | $values = array( 'fields' => array(), 'id' => $form->id ); |
| 187 | 187 | |
| 188 | - $fields = FrmField::get_all_for_form($form->id); |
|
| 188 | + $fields = FrmField::get_all_for_form( $form->id ); |
|
| 189 | 189 | foreach ( $fields as $k => $f ) { |
| 190 | 190 | $f = (array) $f; |
| 191 | 191 | $opts = (array) $f['field_options']; |
| 192 | - $f = array_merge($opts, $f); |
|
| 192 | + $f = array_merge( $opts, $f ); |
|
| 193 | 193 | if ( ! isset( $f['post_field'] ) ) { |
| 194 | 194 | $f['post_field'] = ''; |
| 195 | 195 | } |
| 196 | 196 | $values['fields'][] = $f; |
| 197 | - unset($k, $f); |
|
| 197 | + unset( $k, $f ); |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | return $form; |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | $new_actions = array(); |
| 210 | 210 | |
| 211 | 211 | foreach ( $registered_actions as $registered_action ) { |
| 212 | - $action_ids = $registered_action->update_callback($form_id); |
|
| 212 | + $action_ids = $registered_action->update_callback( $form_id ); |
|
| 213 | 213 | if ( ! empty( $action_ids ) ) { |
| 214 | 214 | $new_actions[] = $action_ids; |
| 215 | 215 | } |
@@ -291,33 +291,33 @@ discard block |
||
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | // store actions so they can be triggered with the correct priority |
| 294 | - $stored_actions[ $action->ID ] = $action; |
|
| 295 | - $action_priority[ $action->ID ] = $link_settings[ $action->post_excerpt ]->action_options['priority']; |
|
| 294 | + $stored_actions[$action->ID] = $action; |
|
| 295 | + $action_priority[$action->ID] = $link_settings[$action->post_excerpt]->action_options['priority']; |
|
| 296 | 296 | |
| 297 | - unset($action); |
|
| 297 | + unset( $action ); |
|
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | if ( ! empty( $stored_actions ) ) { |
| 301 | - asort($action_priority); |
|
| 301 | + asort( $action_priority ); |
|
| 302 | 302 | |
| 303 | 303 | // make sure hooks are loaded |
| 304 | 304 | new FrmNotification(); |
| 305 | 305 | |
| 306 | 306 | foreach ( $action_priority as $action_id => $priority ) { |
| 307 | - $action = $stored_actions[ $action_id ]; |
|
| 307 | + $action = $stored_actions[$action_id]; |
|
| 308 | 308 | do_action( 'frm_trigger_' . $action->post_excerpt . '_action', $action, $entry, $form, $event ); |
| 309 | 309 | do_action( 'frm_trigger_' . $action->post_excerpt . '_' . $event . '_action', $action, $entry, $form ); |
| 310 | 310 | |
| 311 | 311 | // If post is created, get updated $entry object |
| 312 | 312 | if ( $action->post_excerpt == 'wppost' && $event == 'create' ) { |
| 313 | - $entry = FrmEntry::getOne($entry->id, true); |
|
| 313 | + $entry = FrmEntry::getOne( $entry->id, true ); |
|
| 314 | 314 | } |
| 315 | 315 | } |
| 316 | 316 | } |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | public static function duplicate_form_actions( $form_id, $values, $args = array() ) { |
| 320 | - if ( ! isset($args['old_id']) || empty($args['old_id']) ) { |
|
| 320 | + if ( ! isset( $args['old_id'] ) || empty( $args['old_id'] ) ) { |
|
| 321 | 321 | // continue if we know which actions to copy |
| 322 | 322 | return; |
| 323 | 323 | } |
@@ -351,22 +351,22 @@ discard block |
||
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | public function register( $action_class ) { |
| 354 | - $this->actions[ $action_class ] = new $action_class(); |
|
| 354 | + $this->actions[$action_class] = new $action_class(); |
|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | public function unregister( $action_class ) { |
| 358 | - if ( isset( $this->actions[ $action_class ] ) ) { |
|
| 359 | - unset($this->actions[ $action_class ]); |
|
| 358 | + if ( isset( $this->actions[$action_class] ) ) { |
|
| 359 | + unset( $this->actions[$action_class] ); |
|
| 360 | 360 | } |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | public function _register_actions() { |
| 364 | - $keys = array_keys($this->actions); |
|
| 364 | + $keys = array_keys( $this->actions ); |
|
| 365 | 365 | |
| 366 | 366 | foreach ( $keys as $key ) { |
| 367 | 367 | // don't register new action if old action with the same id is already registered |
| 368 | - if ( ! isset( $this->actions[ $key ] ) ) { |
|
| 369 | - $this->actions[ $key ]->_register(); |
|
| 368 | + if ( ! isset( $this->actions[$key] ) ) { |
|
| 369 | + $this->actions[$key]->_register(); |
|
| 370 | 370 | } |
| 371 | 371 | } |
| 372 | 372 | } |
@@ -1,109 +1,109 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | class FrmFormActionsController { |
| 4 | - public static $action_post_type = 'frm_form_actions'; |
|
| 5 | - public static $registered_actions; |
|
| 6 | - |
|
| 7 | - public static function register_post_types() { |
|
| 8 | - register_post_type( self::$action_post_type, array( |
|
| 9 | - 'label' => __( 'Form Actions', 'formidable' ), |
|
| 10 | - 'description' => '', |
|
| 11 | - 'public' => false, |
|
| 12 | - 'show_ui' => false, |
|
| 13 | - 'exclude_from_search' => true, |
|
| 14 | - 'show_in_nav_menus' => false, |
|
| 15 | - 'show_in_menu' => true, |
|
| 16 | - 'capability_type' => 'page', |
|
| 17 | - 'supports' => array( |
|
| 4 | + public static $action_post_type = 'frm_form_actions'; |
|
| 5 | + public static $registered_actions; |
|
| 6 | + |
|
| 7 | + public static function register_post_types() { |
|
| 8 | + register_post_type( self::$action_post_type, array( |
|
| 9 | + 'label' => __( 'Form Actions', 'formidable' ), |
|
| 10 | + 'description' => '', |
|
| 11 | + 'public' => false, |
|
| 12 | + 'show_ui' => false, |
|
| 13 | + 'exclude_from_search' => true, |
|
| 14 | + 'show_in_nav_menus' => false, |
|
| 15 | + 'show_in_menu' => true, |
|
| 16 | + 'capability_type' => 'page', |
|
| 17 | + 'supports' => array( |
|
| 18 | 18 | 'title', 'editor', 'excerpt', 'custom-fields', |
| 19 | 19 | 'page-attributes', |
| 20 | - ), |
|
| 21 | - 'has_archive' => false, |
|
| 22 | - ) ); |
|
| 23 | - |
|
| 24 | - /** |
|
| 25 | - * post_content: json settings |
|
| 26 | - * menu_order: form id |
|
| 27 | - * post_excerpt: action type |
|
| 28 | - */ |
|
| 29 | - |
|
| 30 | - self::actions_init(); |
|
| 31 | - } |
|
| 32 | - |
|
| 33 | - public static function actions_init() { |
|
| 34 | - self::$registered_actions = new Frm_Form_Action_Factory(); |
|
| 35 | - self::register_actions(); |
|
| 36 | - do_action( 'frm_form_actions_init' ); |
|
| 37 | - } |
|
| 38 | - |
|
| 39 | - public static function register_actions() { |
|
| 40 | - $action_classes = apply_filters( 'frm_registered_form_actions', array( |
|
| 41 | - 'email' => 'FrmEmailAction', |
|
| 42 | - 'wppost' => 'FrmDefPostAction', |
|
| 43 | - 'register' => 'FrmDefRegAction', |
|
| 44 | - 'paypal' => 'FrmDefPayPalAction', |
|
| 45 | - //'aweber' => 'FrmDefAweberAction', |
|
| 46 | - 'mailchimp' => 'FrmDefMlcmpAction', |
|
| 47 | - 'twilio' => 'FrmDefTwilioAction', |
|
| 48 | - 'highrise' => 'FrmDefHrsAction', |
|
| 49 | - ) ); |
|
| 50 | - |
|
| 51 | - include_once(FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/email_action.php'); |
|
| 52 | - include_once(FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/default_actions.php'); |
|
| 53 | - |
|
| 54 | - foreach ( $action_classes as $action_class ) { |
|
| 55 | - self::$registered_actions->register($action_class); |
|
| 56 | - } |
|
| 57 | - } |
|
| 20 | + ), |
|
| 21 | + 'has_archive' => false, |
|
| 22 | + ) ); |
|
| 23 | + |
|
| 24 | + /** |
|
| 25 | + * post_content: json settings |
|
| 26 | + * menu_order: form id |
|
| 27 | + * post_excerpt: action type |
|
| 28 | + */ |
|
| 29 | + |
|
| 30 | + self::actions_init(); |
|
| 31 | + } |
|
| 32 | + |
|
| 33 | + public static function actions_init() { |
|
| 34 | + self::$registered_actions = new Frm_Form_Action_Factory(); |
|
| 35 | + self::register_actions(); |
|
| 36 | + do_action( 'frm_form_actions_init' ); |
|
| 37 | + } |
|
| 38 | + |
|
| 39 | + public static function register_actions() { |
|
| 40 | + $action_classes = apply_filters( 'frm_registered_form_actions', array( |
|
| 41 | + 'email' => 'FrmEmailAction', |
|
| 42 | + 'wppost' => 'FrmDefPostAction', |
|
| 43 | + 'register' => 'FrmDefRegAction', |
|
| 44 | + 'paypal' => 'FrmDefPayPalAction', |
|
| 45 | + //'aweber' => 'FrmDefAweberAction', |
|
| 46 | + 'mailchimp' => 'FrmDefMlcmpAction', |
|
| 47 | + 'twilio' => 'FrmDefTwilioAction', |
|
| 48 | + 'highrise' => 'FrmDefHrsAction', |
|
| 49 | + ) ); |
|
| 50 | + |
|
| 51 | + include_once(FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/email_action.php'); |
|
| 52 | + include_once(FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/default_actions.php'); |
|
| 53 | + |
|
| 54 | + foreach ( $action_classes as $action_class ) { |
|
| 55 | + self::$registered_actions->register($action_class); |
|
| 56 | + } |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | 59 | public static function get_form_actions( $action = 'all' ) { |
| 60 | - $temp_actions = self::$registered_actions; |
|
| 61 | - if ( empty($temp_actions) ) { |
|
| 62 | - self::actions_init(); |
|
| 63 | - $temp_actions = self::$registered_actions->actions; |
|
| 64 | - } else { |
|
| 65 | - $temp_actions = $temp_actions->actions; |
|
| 66 | - } |
|
| 60 | + $temp_actions = self::$registered_actions; |
|
| 61 | + if ( empty($temp_actions) ) { |
|
| 62 | + self::actions_init(); |
|
| 63 | + $temp_actions = self::$registered_actions->actions; |
|
| 64 | + } else { |
|
| 65 | + $temp_actions = $temp_actions->actions; |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - $actions = array(); |
|
| 68 | + $actions = array(); |
|
| 69 | 69 | |
| 70 | - foreach ( $temp_actions as $a ) { |
|
| 71 | - if ( 'all' != $action && $a->id_base == $action ) { |
|
| 72 | - return $a; |
|
| 73 | - } |
|
| 70 | + foreach ( $temp_actions as $a ) { |
|
| 71 | + if ( 'all' != $action && $a->id_base == $action ) { |
|
| 72 | + return $a; |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | 75 | $actions[ $a->id_base ] = $a; |
| 76 | - } |
|
| 77 | - unset( $temp_actions, $a ); |
|
| 78 | - |
|
| 79 | - $action_limit = 10; |
|
| 80 | - if ( count( $actions ) <= $action_limit ) { |
|
| 81 | - return $actions; |
|
| 82 | - } |
|
| 83 | - |
|
| 84 | - // remove the last few inactive icons if there are too many |
|
| 85 | - $temp_actions = $actions; |
|
| 86 | - arsort( $temp_actions ); |
|
| 87 | - foreach ( $temp_actions as $type => $a ) { |
|
| 88 | - if ( ! isset( $a->action_options['active'] ) || empty( $a->action_options['active'] ) ) { |
|
| 76 | + } |
|
| 77 | + unset( $temp_actions, $a ); |
|
| 78 | + |
|
| 79 | + $action_limit = 10; |
|
| 80 | + if ( count( $actions ) <= $action_limit ) { |
|
| 81 | + return $actions; |
|
| 82 | + } |
|
| 83 | + |
|
| 84 | + // remove the last few inactive icons if there are too many |
|
| 85 | + $temp_actions = $actions; |
|
| 86 | + arsort( $temp_actions ); |
|
| 87 | + foreach ( $temp_actions as $type => $a ) { |
|
| 88 | + if ( ! isset( $a->action_options['active'] ) || empty( $a->action_options['active'] ) ) { |
|
| 89 | 89 | unset( $actions[ $type ] ); |
| 90 | - if ( count( $actions ) <= $action_limit ) { |
|
| 91 | - break; |
|
| 92 | - } |
|
| 93 | - } |
|
| 94 | - unset( $type, $a ); |
|
| 95 | - } |
|
| 90 | + if ( count( $actions ) <= $action_limit ) { |
|
| 91 | + break; |
|
| 92 | + } |
|
| 93 | + } |
|
| 94 | + unset( $type, $a ); |
|
| 95 | + } |
|
| 96 | 96 | |
| 97 | - return $actions; |
|
| 98 | - } |
|
| 97 | + return $actions; |
|
| 98 | + } |
|
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | 101 | * @since 2.0 |
| 102 | 102 | */ |
| 103 | - public static function list_actions( $form, $values ) { |
|
| 104 | - if ( empty( $form ) ) { |
|
| 105 | - return; |
|
| 106 | - } |
|
| 103 | + public static function list_actions( $form, $values ) { |
|
| 104 | + if ( empty( $form ) ) { |
|
| 105 | + return; |
|
| 106 | + } |
|
| 107 | 107 | |
| 108 | 108 | /** |
| 109 | 109 | * use this hook to migrate old settings into a new action |
@@ -113,116 +113,116 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | $form_actions = FrmFormAction::get_action_for_form( $form->id ); |
| 115 | 115 | |
| 116 | - $action_controls = self::get_form_actions(); |
|
| 116 | + $action_controls = self::get_form_actions(); |
|
| 117 | 117 | |
| 118 | - $action_map = array(); |
|
| 118 | + $action_map = array(); |
|
| 119 | 119 | |
| 120 | 120 | foreach ( $action_controls as $key => $control ) { |
| 121 | - $action_map[ $control->id_base ] = $key; |
|
| 122 | - } |
|
| 121 | + $action_map[ $control->id_base ] = $key; |
|
| 122 | + } |
|
| 123 | 123 | |
| 124 | - foreach ( $form_actions as $action ) { |
|
| 125 | - if ( ! isset( $action_map[ $action->post_excerpt ] ) ) { |
|
| 126 | - // don't try and show settings if action no longer exists |
|
| 127 | - continue; |
|
| 128 | - } |
|
| 124 | + foreach ( $form_actions as $action ) { |
|
| 125 | + if ( ! isset( $action_map[ $action->post_excerpt ] ) ) { |
|
| 126 | + // don't try and show settings if action no longer exists |
|
| 127 | + continue; |
|
| 128 | + } |
|
| 129 | 129 | |
| 130 | - self::action_control( $action, $form, $action->ID, $action_controls[ $action_map[ $action->post_excerpt ] ], $values ); |
|
| 131 | - } |
|
| 132 | - } |
|
| 130 | + self::action_control( $action, $form, $action->ID, $action_controls[ $action_map[ $action->post_excerpt ] ], $values ); |
|
| 131 | + } |
|
| 132 | + } |
|
| 133 | 133 | |
| 134 | 134 | public static function action_control( $form_action, $form, $action_key, $action_control, $values ) { |
| 135 | - $action_control->_set($action_key); |
|
| 135 | + $action_control->_set($action_key); |
|
| 136 | 136 | include( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/form_action.php' ); |
| 137 | - } |
|
| 137 | + } |
|
| 138 | 138 | |
| 139 | - public static function add_form_action() { |
|
| 139 | + public static function add_form_action() { |
|
| 140 | 140 | FrmAppHelper::permission_check('frm_edit_forms'); |
| 141 | - check_ajax_referer( 'frm_ajax', 'nonce' ); |
|
| 141 | + check_ajax_referer( 'frm_ajax', 'nonce' ); |
|
| 142 | 142 | |
| 143 | - global $frm_vars; |
|
| 143 | + global $frm_vars; |
|
| 144 | 144 | |
| 145 | 145 | $action_key = absint( $_POST['list_id'] ); |
| 146 | - $action_type = sanitize_text_field( $_POST['type'] ); |
|
| 146 | + $action_type = sanitize_text_field( $_POST['type'] ); |
|
| 147 | 147 | |
| 148 | - $action_control = self::get_form_actions( $action_type ); |
|
| 149 | - $action_control->_set($action_key); |
|
| 148 | + $action_control = self::get_form_actions( $action_type ); |
|
| 149 | + $action_control->_set($action_key); |
|
| 150 | 150 | |
| 151 | - $form_id = absint( $_POST['form_id'] ); |
|
| 151 | + $form_id = absint( $_POST['form_id'] ); |
|
| 152 | 152 | |
| 153 | - $form_action = $action_control->prepare_new($form_id); |
|
| 153 | + $form_action = $action_control->prepare_new($form_id); |
|
| 154 | 154 | |
| 155 | - $values = array(); |
|
| 156 | - $form = self::fields_to_values($form_id, $values); |
|
| 155 | + $values = array(); |
|
| 156 | + $form = self::fields_to_values($form_id, $values); |
|
| 157 | 157 | |
| 158 | 158 | include( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/form_action.php' ); |
| 159 | - wp_die(); |
|
| 160 | - } |
|
| 159 | + wp_die(); |
|
| 160 | + } |
|
| 161 | 161 | |
| 162 | - public static function fill_action() { |
|
| 162 | + public static function fill_action() { |
|
| 163 | 163 | FrmAppHelper::permission_check('frm_edit_forms'); |
| 164 | - check_ajax_referer( 'frm_ajax', 'nonce' ); |
|
| 164 | + check_ajax_referer( 'frm_ajax', 'nonce' ); |
|
| 165 | 165 | |
| 166 | - $action_key = absint( $_POST['action_id'] ); |
|
| 167 | - $action_type = sanitize_text_field( $_POST['action_type'] ); |
|
| 166 | + $action_key = absint( $_POST['action_id'] ); |
|
| 167 | + $action_type = sanitize_text_field( $_POST['action_type'] ); |
|
| 168 | 168 | |
| 169 | - $action_control = self::get_form_actions( $action_type ); |
|
| 170 | - if ( empty($action_control) ) { |
|
| 171 | - wp_die(); |
|
| 172 | - } |
|
| 169 | + $action_control = self::get_form_actions( $action_type ); |
|
| 170 | + if ( empty($action_control) ) { |
|
| 171 | + wp_die(); |
|
| 172 | + } |
|
| 173 | 173 | |
| 174 | - $form_action = $action_control->get_single_action( $action_key ); |
|
| 174 | + $form_action = $action_control->get_single_action( $action_key ); |
|
| 175 | 175 | |
| 176 | - $values = array(); |
|
| 177 | - $form = self::fields_to_values($form_action->menu_order, $values); |
|
| 176 | + $values = array(); |
|
| 177 | + $form = self::fields_to_values($form_action->menu_order, $values); |
|
| 178 | 178 | |
| 179 | 179 | include( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/_action_inside.php' ); |
| 180 | - wp_die(); |
|
| 181 | - } |
|
| 180 | + wp_die(); |
|
| 181 | + } |
|
| 182 | 182 | |
| 183 | 183 | private static function fields_to_values( $form_id, array &$values ) { |
| 184 | - $form = FrmForm::getOne($form_id); |
|
| 184 | + $form = FrmForm::getOne($form_id); |
|
| 185 | 185 | |
| 186 | 186 | $values = array( 'fields' => array(), 'id' => $form->id ); |
| 187 | 187 | |
| 188 | - $fields = FrmField::get_all_for_form($form->id); |
|
| 189 | - foreach ( $fields as $k => $f ) { |
|
| 190 | - $f = (array) $f; |
|
| 191 | - $opts = (array) $f['field_options']; |
|
| 192 | - $f = array_merge($opts, $f); |
|
| 193 | - if ( ! isset( $f['post_field'] ) ) { |
|
| 194 | - $f['post_field'] = ''; |
|
| 195 | - } |
|
| 196 | - $values['fields'][] = $f; |
|
| 197 | - unset($k, $f); |
|
| 198 | - } |
|
| 199 | - |
|
| 200 | - return $form; |
|
| 201 | - } |
|
| 188 | + $fields = FrmField::get_all_for_form($form->id); |
|
| 189 | + foreach ( $fields as $k => $f ) { |
|
| 190 | + $f = (array) $f; |
|
| 191 | + $opts = (array) $f['field_options']; |
|
| 192 | + $f = array_merge($opts, $f); |
|
| 193 | + if ( ! isset( $f['post_field'] ) ) { |
|
| 194 | + $f['post_field'] = ''; |
|
| 195 | + } |
|
| 196 | + $values['fields'][] = $f; |
|
| 197 | + unset($k, $f); |
|
| 198 | + } |
|
| 199 | + |
|
| 200 | + return $form; |
|
| 201 | + } |
|
| 202 | 202 | |
| 203 | 203 | public static function update_settings( $form_id ) { |
| 204 | - global $wpdb; |
|
| 204 | + global $wpdb; |
|
| 205 | 205 | |
| 206 | - $registered_actions = self::$registered_actions->actions; |
|
| 206 | + $registered_actions = self::$registered_actions->actions; |
|
| 207 | 207 | |
| 208 | 208 | $old_actions = FrmDb::get_col( $wpdb->posts, array( 'post_type' => self::$action_post_type, 'menu_order' => $form_id ), 'ID' ); |
| 209 | - $new_actions = array(); |
|
| 209 | + $new_actions = array(); |
|
| 210 | 210 | |
| 211 | - foreach ( $registered_actions as $registered_action ) { |
|
| 212 | - $action_ids = $registered_action->update_callback($form_id); |
|
| 213 | - if ( ! empty( $action_ids ) ) { |
|
| 214 | - $new_actions[] = $action_ids; |
|
| 215 | - } |
|
| 216 | - } |
|
| 211 | + foreach ( $registered_actions as $registered_action ) { |
|
| 212 | + $action_ids = $registered_action->update_callback($form_id); |
|
| 213 | + if ( ! empty( $action_ids ) ) { |
|
| 214 | + $new_actions[] = $action_ids; |
|
| 215 | + } |
|
| 216 | + } |
|
| 217 | 217 | |
| 218 | - //Only use array_merge if there are new actions |
|
| 219 | - if ( ! empty( $new_actions ) ) { |
|
| 220 | - $new_actions = call_user_func_array( 'array_merge', $new_actions ); |
|
| 221 | - } |
|
| 222 | - $old_actions = array_diff( $old_actions, $new_actions ); |
|
| 218 | + //Only use array_merge if there are new actions |
|
| 219 | + if ( ! empty( $new_actions ) ) { |
|
| 220 | + $new_actions = call_user_func_array( 'array_merge', $new_actions ); |
|
| 221 | + } |
|
| 222 | + $old_actions = array_diff( $old_actions, $new_actions ); |
|
| 223 | 223 | |
| 224 | 224 | self::delete_missing_actions( $old_actions ); |
| 225 | - } |
|
| 225 | + } |
|
| 226 | 226 | |
| 227 | 227 | public static function delete_missing_actions( $old_actions ) { |
| 228 | 228 | if ( ! empty( $old_actions ) ) { |
@@ -242,22 +242,22 @@ discard block |
||
| 242 | 242 | self::trigger_actions( $event, $form_id, $entry_id, 'all', $args ); |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | - /** |
|
| 246 | - * @param string $event |
|
| 247 | - */ |
|
| 245 | + /** |
|
| 246 | + * @param string $event |
|
| 247 | + */ |
|
| 248 | 248 | public static function trigger_actions( $event, $form, $entry, $type = 'all', $args = array() ) { |
| 249 | 249 | $form_actions = FrmFormAction::get_action_for_form( ( is_object( $form ) ? $form->id : $form ), $type ); |
| 250 | 250 | |
| 251 | 251 | if ( empty( $form_actions ) ) { |
| 252 | - return; |
|
| 253 | - } |
|
| 252 | + return; |
|
| 253 | + } |
|
| 254 | 254 | |
| 255 | 255 | FrmForm::maybe_get_form( $form ); |
| 256 | 256 | |
| 257 | - $link_settings = self::get_form_actions( $type ); |
|
| 258 | - if ( 'all' != $type ) { |
|
| 259 | - $link_settings = array( $type => $link_settings ); |
|
| 260 | - } |
|
| 257 | + $link_settings = self::get_form_actions( $type ); |
|
| 258 | + if ( 'all' != $type ) { |
|
| 259 | + $link_settings = array( $type => $link_settings ); |
|
| 260 | + } |
|
| 261 | 261 | |
| 262 | 262 | $stored_actions = array(); |
| 263 | 263 | $action_priority = array(); |
@@ -268,17 +268,17 @@ discard block |
||
| 268 | 268 | $this_event = $event; |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | - foreach ( $form_actions as $action ) { |
|
| 271 | + foreach ( $form_actions as $action ) { |
|
| 272 | 272 | |
| 273 | 273 | $skip_this_action = ( ! in_array( $this_event, $action->post_content['event'] ) ); |
| 274 | 274 | $skip_this_action = apply_filters( 'frm_skip_form_action', $skip_this_action, compact( 'action', 'entry', 'form', 'event' ) ); |
| 275 | 275 | if ( $skip_this_action ) { |
| 276 | - continue; |
|
| 277 | - } |
|
| 276 | + continue; |
|
| 277 | + } |
|
| 278 | 278 | |
| 279 | - if ( ! is_object( $entry ) ) { |
|
| 280 | - $entry = FrmEntry::getOne( $entry, true ); |
|
| 281 | - } |
|
| 279 | + if ( ! is_object( $entry ) ) { |
|
| 280 | + $entry = FrmEntry::getOne( $entry, true ); |
|
| 281 | + } |
|
| 282 | 282 | |
| 283 | 283 | if ( empty( $entry ) || ( $entry->is_draft && $event != 'draft' ) ) { |
| 284 | 284 | continue; |
@@ -292,64 +292,64 @@ discard block |
||
| 292 | 292 | if ( ! $trigger_children ) { |
| 293 | 293 | continue; |
| 294 | 294 | } |
| 295 | - } |
|
| 295 | + } |
|
| 296 | 296 | |
| 297 | - // check conditional logic |
|
| 297 | + // check conditional logic |
|
| 298 | 298 | $stop = FrmFormAction::action_conditions_met( $action, $entry ); |
| 299 | - if ( $stop ) { |
|
| 300 | - continue; |
|
| 301 | - } |
|
| 299 | + if ( $stop ) { |
|
| 300 | + continue; |
|
| 301 | + } |
|
| 302 | 302 | |
| 303 | - // store actions so they can be triggered with the correct priority |
|
| 304 | - $stored_actions[ $action->ID ] = $action; |
|
| 305 | - $action_priority[ $action->ID ] = $link_settings[ $action->post_excerpt ]->action_options['priority']; |
|
| 303 | + // store actions so they can be triggered with the correct priority |
|
| 304 | + $stored_actions[ $action->ID ] = $action; |
|
| 305 | + $action_priority[ $action->ID ] = $link_settings[ $action->post_excerpt ]->action_options['priority']; |
|
| 306 | 306 | |
| 307 | - unset($action); |
|
| 308 | - } |
|
| 307 | + unset($action); |
|
| 308 | + } |
|
| 309 | 309 | |
| 310 | - if ( ! empty( $stored_actions ) ) { |
|
| 311 | - asort($action_priority); |
|
| 310 | + if ( ! empty( $stored_actions ) ) { |
|
| 311 | + asort($action_priority); |
|
| 312 | 312 | |
| 313 | - // make sure hooks are loaded |
|
| 314 | - new FrmNotification(); |
|
| 313 | + // make sure hooks are loaded |
|
| 314 | + new FrmNotification(); |
|
| 315 | 315 | |
| 316 | - foreach ( $action_priority as $action_id => $priority ) { |
|
| 317 | - $action = $stored_actions[ $action_id ]; |
|
| 316 | + foreach ( $action_priority as $action_id => $priority ) { |
|
| 317 | + $action = $stored_actions[ $action_id ]; |
|
| 318 | 318 | do_action( 'frm_trigger_' . $action->post_excerpt . '_action', $action, $entry, $form, $event ); |
| 319 | 319 | do_action( 'frm_trigger_' . $action->post_excerpt . '_' . $event . '_action', $action, $entry, $form ); |
| 320 | 320 | |
| 321 | - // If post is created, get updated $entry object |
|
| 322 | - if ( $action->post_excerpt == 'wppost' && $event == 'create' ) { |
|
| 323 | - $entry = FrmEntry::getOne($entry->id, true); |
|
| 324 | - } |
|
| 325 | - } |
|
| 326 | - } |
|
| 327 | - } |
|
| 321 | + // If post is created, get updated $entry object |
|
| 322 | + if ( $action->post_excerpt == 'wppost' && $event == 'create' ) { |
|
| 323 | + $entry = FrmEntry::getOne($entry->id, true); |
|
| 324 | + } |
|
| 325 | + } |
|
| 326 | + } |
|
| 327 | + } |
|
| 328 | 328 | |
| 329 | 329 | public static function duplicate_form_actions( $form_id, $values, $args = array() ) { |
| 330 | - if ( ! isset($args['old_id']) || empty($args['old_id']) ) { |
|
| 331 | - // continue if we know which actions to copy |
|
| 332 | - return; |
|
| 333 | - } |
|
| 330 | + if ( ! isset($args['old_id']) || empty($args['old_id']) ) { |
|
| 331 | + // continue if we know which actions to copy |
|
| 332 | + return; |
|
| 333 | + } |
|
| 334 | 334 | |
| 335 | - $action_controls = self::get_form_actions( ); |
|
| 335 | + $action_controls = self::get_form_actions( ); |
|
| 336 | 336 | |
| 337 | - foreach ( $action_controls as $action_control ) { |
|
| 338 | - $action_control->duplicate_form_actions( $form_id, $args['old_id'] ); |
|
| 339 | - unset( $action_control ); |
|
| 340 | - } |
|
| 341 | - } |
|
| 337 | + foreach ( $action_controls as $action_control ) { |
|
| 338 | + $action_control->duplicate_form_actions( $form_id, $args['old_id'] ); |
|
| 339 | + unset( $action_control ); |
|
| 340 | + } |
|
| 341 | + } |
|
| 342 | 342 | |
| 343 | - public static function limit_by_type( $where ) { |
|
| 344 | - global $frm_vars, $wpdb; |
|
| 343 | + public static function limit_by_type( $where ) { |
|
| 344 | + global $frm_vars, $wpdb; |
|
| 345 | 345 | |
| 346 | - if ( ! isset( $frm_vars['action_type'] ) ) { |
|
| 347 | - return $where; |
|
| 348 | - } |
|
| 346 | + if ( ! isset( $frm_vars['action_type'] ) ) { |
|
| 347 | + return $where; |
|
| 348 | + } |
|
| 349 | 349 | |
| 350 | - $where .= $wpdb->prepare( ' AND post_excerpt = %s ', $frm_vars['action_type'] ); |
|
| 351 | - return $where; |
|
| 352 | - } |
|
| 350 | + $where .= $wpdb->prepare( ' AND post_excerpt = %s ', $frm_vars['action_type'] ); |
|
| 351 | + return $where; |
|
| 352 | + } |
|
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | foreach ( $keys as $key ) { |
| 377 | 377 | // don't register new action if old action with the same id is already registered |
| 378 | 378 | if ( ! isset( $this->actions[ $key ] ) ) { |
| 379 | - $this->actions[ $key ]->_register(); |
|
| 379 | + $this->actions[ $key ]->_register(); |
|
| 380 | 380 | } |
| 381 | 381 | } |
| 382 | 382 | } |
@@ -4,18 +4,18 @@ discard block |
||
| 4 | 4 | <meta charset="<?php bloginfo( 'charset' ); ?>" /> |
| 5 | 5 | <title><?php bloginfo('name'); ?></title> |
| 6 | 6 | <?php |
| 7 | - wp_admin_css( 'global' ); |
|
| 8 | - wp_admin_css(); |
|
| 9 | - wp_admin_css( 'colors' ); |
|
| 10 | - wp_admin_css( 'ie' ); |
|
| 7 | + wp_admin_css( 'global' ); |
|
| 8 | + wp_admin_css(); |
|
| 9 | + wp_admin_css( 'colors' ); |
|
| 10 | + wp_admin_css( 'ie' ); |
|
| 11 | 11 | if ( is_multisite() ) { |
| 12 | - wp_admin_css( 'ms' ); |
|
| 12 | + wp_admin_css( 'ms' ); |
|
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - do_action('admin_print_styles'); |
|
| 16 | - do_action('admin_print_scripts'); |
|
| 15 | + do_action('admin_print_styles'); |
|
| 16 | + do_action('admin_print_scripts'); |
|
| 17 | 17 | |
| 18 | - ?> |
|
| 18 | + ?> |
|
| 19 | 19 | </head> |
| 20 | 20 | <body class="wp-admin no-js wp-core-ui frm_field_opts_popup <?php echo esc_attr( apply_filters( 'admin_body_class', '' ) . ' ' . $admin_body_class ); ?>"> |
| 21 | 21 | <div class="frm_med_padding"> |
@@ -29,21 +29,21 @@ discard block |
||
| 29 | 29 | <?php |
| 30 | 30 | $other_array = array(); |
| 31 | 31 | foreach ( $field->options as $fkey => $fopt ) { |
| 32 | - //If it is an other option, don't include it |
|
| 33 | - if ( $fkey && strpos( $fkey, 'other') !== false ) { |
|
| 34 | - continue; |
|
| 35 | - } |
|
| 32 | + //If it is an other option, don't include it |
|
| 33 | + if ( $fkey && strpos( $fkey, 'other') !== false ) { |
|
| 34 | + continue; |
|
| 35 | + } |
|
| 36 | 36 | if ( is_array( $fopt ) ) { |
| 37 | - $label = (isset($fopt['label'])) ? $fopt['label'] : reset($fopt); |
|
| 38 | - $value = (isset($fopt['value'])) ? $fopt['value'] : $label; |
|
| 37 | + $label = (isset($fopt['label'])) ? $fopt['label'] : reset($fopt); |
|
| 38 | + $value = (isset($fopt['value'])) ? $fopt['value'] : $label; |
|
| 39 | 39 | if ( $label != $value && FrmField::is_option_true( $field, 'separate_value' ) ) { |
| 40 | - echo "$label|$value\n"; |
|
| 40 | + echo "$label|$value\n"; |
|
| 41 | 41 | } else { |
| 42 | 42 | echo $label . "\n"; |
| 43 | - } |
|
| 43 | + } |
|
| 44 | 44 | } else { |
| 45 | 45 | echo $fopt . "\n"; |
| 46 | - } |
|
| 46 | + } |
|
| 47 | 47 | } ?> |
| 48 | 48 | </textarea> |
| 49 | 49 | |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | <html <?php language_attributes(); ?>> |
| 3 | 3 | <head> |
| 4 | 4 | <meta charset="<?php bloginfo( 'charset' ); ?>" /> |
| 5 | - <title><?php bloginfo('name'); ?></title> |
|
| 5 | + <title><?php bloginfo( 'name' ); ?></title> |
|
| 6 | 6 | <?php |
| 7 | 7 | wp_admin_css( 'global' ); |
| 8 | 8 | wp_admin_css(); |
@@ -12,8 +12,8 @@ discard block |
||
| 12 | 12 | wp_admin_css( 'ms' ); |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - do_action('admin_print_styles'); |
|
| 16 | - do_action('admin_print_scripts'); |
|
| 15 | + do_action( 'admin_print_styles' ); |
|
| 16 | + do_action( 'admin_print_scripts' ); |
|
| 17 | 17 | |
| 18 | 18 | ?> |
| 19 | 19 | </head> |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | <p class="howto"><?php _e( 'Edit or add field options (one per line)', 'formidable' ) ?></p> |
| 23 | 23 | <ul class="frm_prepop"> |
| 24 | 24 | <?php foreach ( $prepop as $label => $pop ) { ?> |
| 25 | - <li><a href="javascript:void(0)" onclick='frmPrePop(<?php echo str_replace("'", '‘', json_encode($pop)) ?>); return false;'><?php echo esc_html( $label ) ?></a></li> |
|
| 25 | + <li><a href="javascript:void(0)" onclick='frmPrePop(<?php echo str_replace( "'", '‘', json_encode( $pop ) ) ?>); return false;'><?php echo esc_html( $label ) ?></a></li> |
|
| 26 | 26 | <?php } ?> |
| 27 | 27 | </ul> |
| 28 | 28 | <textarea name="frm_bulk_options" id="frm_bulk_options"> |
@@ -30,12 +30,12 @@ discard block |
||
| 30 | 30 | $other_array = array(); |
| 31 | 31 | foreach ( $field->options as $fkey => $fopt ) { |
| 32 | 32 | //If it is an other option, don't include it |
| 33 | - if ( $fkey && strpos( $fkey, 'other') !== false ) { |
|
| 33 | + if ( $fkey && strpos( $fkey, 'other' ) !== false ) { |
|
| 34 | 34 | continue; |
| 35 | 35 | } |
| 36 | 36 | if ( is_array( $fopt ) ) { |
| 37 | - $label = (isset($fopt['label'])) ? $fopt['label'] : reset($fopt); |
|
| 38 | - $value = (isset($fopt['value'])) ? $fopt['value'] : $label; |
|
| 37 | + $label = ( isset( $fopt['label'] ) ) ? $fopt['label'] : reset( $fopt ); |
|
| 38 | + $value = ( isset( $fopt['value'] ) ) ? $fopt['value'] : $label; |
|
| 39 | 39 | if ( $label != $value && FrmField::is_option_true( $field, 'separate_value' ) ) { |
| 40 | 40 | echo "$label|$value\n"; |
| 41 | 41 | } else { |
@@ -42,51 +42,51 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | if ( $f->type == 'data' ) { |
| 44 | 44 | //get all fields from linked form |
| 45 | - if ( isset($f->field_options['form_select']) && is_numeric($f->field_options['form_select']) ) { |
|
| 45 | + if ( isset($f->field_options['form_select']) && is_numeric($f->field_options['form_select']) ) { |
|
| 46 | 46 | $linked_form = FrmDb::get_var( $wpdb->prefix . 'frm_fields', array( 'id' => $f->field_options['form_select'] ), 'form_id' ); |
| 47 | - if ( ! in_array( $linked_form, $linked_forms ) ) { |
|
| 48 | - $linked_forms[] = $linked_form; |
|
| 47 | + if ( ! in_array( $linked_form, $linked_forms ) ) { |
|
| 48 | + $linked_forms[] = $linked_form; |
|
| 49 | 49 | $linked_fields = FrmField::getAll( array( 'fi.type not' => FrmField::no_save_fields(), 'fi.form_id' => $linked_form ) ); |
| 50 | - $ldfe = ''; |
|
| 50 | + $ldfe = ''; |
|
| 51 | 51 | if ( $linked_fields ) { |
| 52 | 52 | foreach ( $linked_fields as $linked_field ) { |
| 53 | - FrmAppHelper::insert_opt_html( array( 'id' => $f->id . ' show=' . $linked_field->id, 'key' => $f->field_key . ' show=' . $linked_field->field_key, 'name' => $linked_field->name, 'type' => $linked_field->type ) ); |
|
| 54 | - |
|
| 55 | - $ldfe = $linked_field->id; |
|
| 56 | - unset($linked_field); |
|
| 57 | - } |
|
| 58 | - } |
|
| 59 | - } |
|
| 60 | - } |
|
| 61 | - $dfe = $f->id; |
|
| 62 | - } |
|
| 63 | - unset($f); |
|
| 64 | - } |
|
| 65 | - } ?> |
|
| 53 | + FrmAppHelper::insert_opt_html( array( 'id' => $f->id . ' show=' . $linked_field->id, 'key' => $f->field_key . ' show=' . $linked_field->field_key, 'name' => $linked_field->name, 'type' => $linked_field->type ) ); |
|
| 54 | + |
|
| 55 | + $ldfe = $linked_field->id; |
|
| 56 | + unset($linked_field); |
|
| 57 | + } |
|
| 58 | + } |
|
| 59 | + } |
|
| 60 | + } |
|
| 61 | + $dfe = $f->id; |
|
| 62 | + } |
|
| 63 | + unset($f); |
|
| 64 | + } |
|
| 65 | + } ?> |
|
| 66 | 66 | </ul> |
| 67 | 67 | |
| 68 | 68 | <?php _e( 'Helpers', 'formidable' ) ?>: |
| 69 | 69 | <ul class="frm_code_list"> |
| 70 | 70 | <?php |
| 71 | - $col = 'one'; |
|
| 71 | + $col = 'one'; |
|
| 72 | 72 | foreach ( $entry_shortcodes as $skey => $sname ) { |
| 73 | 73 | if ( empty( $skey ) ) { |
| 74 | - $col = 'one'; |
|
| 75 | - echo '<li class="clear frm_block"></li>'; |
|
| 76 | - continue; |
|
| 77 | - } |
|
| 78 | - ?> |
|
| 74 | + $col = 'one'; |
|
| 75 | + echo '<li class="clear frm_block"></li>'; |
|
| 76 | + continue; |
|
| 77 | + } |
|
| 78 | + ?> |
|
| 79 | 79 | <li class="frm_col_<?php echo esc_attr( $col ) ?>"> |
| 80 | 80 | <a href="javascript:void(0)" class="frmbutton button <?php |
| 81 | 81 | echo ( in_array( $skey, array( 'siteurl', 'sitename', 'entry_count' ) ) ) ? 'show_before_content show_after_content' : ''; |
| 82 | - echo ( strpos( $skey, 'default-' ) === 0 ) ? 'hide_frm_not_email_subject' : ''; |
|
| 83 | - ?> frm_insert_code" data-code="<?php echo esc_attr( $skey ) ?>"><?php echo esc_html( $sname ) ?></a> |
|
| 82 | + echo ( strpos( $skey, 'default-' ) === 0 ) ? 'hide_frm_not_email_subject' : ''; |
|
| 83 | + ?> frm_insert_code" data-code="<?php echo esc_attr( $skey ) ?>"><?php echo esc_html( $sname ) ?></a> |
|
| 84 | 84 | </li> |
| 85 | 85 | <?php |
| 86 | - $col = ( $col == 'one' ) ? 'two' : 'one'; |
|
| 87 | - unset($skey, $sname); |
|
| 88 | - } |
|
| 89 | - ?> |
|
| 86 | + $col = ( $col == 'one' ) ? 'two' : 'one'; |
|
| 87 | + unset($skey, $sname); |
|
| 88 | + } |
|
| 89 | + ?> |
|
| 90 | 90 | </ul> |
| 91 | 91 | </div> |
| 92 | 92 | |
@@ -99,11 +99,11 @@ discard block |
||
| 99 | 99 | <ul class="alignleft"><li><?php _e( 'Fields from your form', 'formidable' ) ?>:</li></ul> |
| 100 | 100 | <ul class="frm_code_list frm_full_width"> |
| 101 | 101 | <?php if ( ! empty( $fields ) ) { |
| 102 | - foreach ( $fields as $f ) { |
|
| 102 | + foreach ( $fields as $f ) { |
|
| 103 | 103 | if ( FrmField::is_no_save_field( $f->type ) || ( $f->type == 'data' && ( ! isset( $f->field_options['data_type'] ) || $f->field_options['data_type'] == 'data' || $f->field_options['data_type'] == '' ) ) ) { |
| 104 | - continue; |
|
| 105 | - } |
|
| 106 | - ?> |
|
| 104 | + continue; |
|
| 105 | + } |
|
| 106 | + ?> |
|
| 107 | 107 | <li> |
| 108 | 108 | <a href="javascript:void(0)" class="frmids alignright frm_insert_code" data-code="if <?php echo esc_attr( $f->id ) ?>]<?php esc_attr_e( 'Conditional text here', 'formidable' ) ?>[/if <?php echo esc_attr( $f->id ) ?>">[if <?php echo (int) $f->id ?>]</a> |
| 109 | 109 | <a href="javascript:void(0)" class="frmkeys alignright frm_insert_code" data-code="if <?php echo esc_attr( $f->field_key ) ?>]something[/if <?php echo esc_attr( $f->field_key ) ?>">[if <?php echo FrmAppHelper::truncate($f->field_key, 10) ?>]</a> |
@@ -111,30 +111,30 @@ discard block |
||
| 111 | 111 | </li> |
| 112 | 112 | <?php |
| 113 | 113 | |
| 114 | - if ( $f->type == 'user_id' ) { |
|
| 115 | - $uid = $f; |
|
| 116 | - } else if ( $f->type == 'file' ) { |
|
| 117 | - $file = $f; |
|
| 118 | - } |
|
| 119 | - unset($f); |
|
| 120 | - } |
|
| 121 | - } ?> |
|
| 114 | + if ( $f->type == 'user_id' ) { |
|
| 115 | + $uid = $f; |
|
| 116 | + } else if ( $f->type == 'file' ) { |
|
| 117 | + $file = $f; |
|
| 118 | + } |
|
| 119 | + unset($f); |
|
| 120 | + } |
|
| 121 | + } ?> |
|
| 122 | 122 | </ul> |
| 123 | 123 | |
| 124 | 124 | <p class="howto"><?php _e( 'Click a button below to insert sample logic into your view', 'formidable' ) ?></p> |
| 125 | 125 | <ul class="frm_code_list"> |
| 126 | 126 | <?php |
| 127 | - $col = 'one'; |
|
| 127 | + $col = 'one'; |
|
| 128 | 128 | foreach ( $cond_shortcodes as $skey => $sname ) { |
| 129 | - ?> |
|
| 129 | + ?> |
|
| 130 | 130 | <li class="frm_col_<?php echo esc_attr( $col ) ?>"> |
| 131 | 131 | <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="if x <?php echo esc_attr($skey) ?>][/if x"><?php echo esc_html( $sname ) ?></a> |
| 132 | 132 | </li> |
| 133 | 133 | <?php |
| 134 | - $col = ( $col == 'one' ) ? 'two' : 'one'; |
|
| 135 | - unset($skey, $sname); |
|
| 136 | - } |
|
| 137 | - ?> |
|
| 134 | + $col = ( $col == 'one' ) ? 'two' : 'one'; |
|
| 135 | + unset($skey, $sname); |
|
| 136 | + } |
|
| 137 | + ?> |
|
| 138 | 138 | </ul> |
| 139 | 139 | </div> |
| 140 | 140 | <?php } ?> |
@@ -142,19 +142,19 @@ discard block |
||
| 142 | 142 | <div id="frm-adv-info-tab" class="tabs-panel"> |
| 143 | 143 | <ul class="frm_code_list"> |
| 144 | 144 | <?php |
| 145 | - $col = 'one'; |
|
| 145 | + $col = 'one'; |
|
| 146 | 146 | foreach ( $adv_shortcodes as $skey => $sname ) { |
| 147 | - ?> |
|
| 147 | + ?> |
|
| 148 | 148 | <li class="frm_col_<?php echo esc_attr( $col ) ?>"> |
| 149 | 149 | <a href="javascript:void(0)" class="frmbutton button frm_insert_code <?php echo is_array( $sname ) ? 'frm_help' : ''; ?>" data-code="x <?php echo esc_attr( $skey ) ?>" <?php echo is_array( $sname ) ? 'title="' . esc_attr( $sname['title'] ) . '"' : ''; ?>> |
| 150 | 150 | <?php echo is_array( $sname ) ? $sname['label'] : $sname; ?> |
| 151 | 151 | </a> |
| 152 | 152 | </li> |
| 153 | 153 | <?php |
| 154 | - $col = ($col == 'one') ? 'two' : 'one'; |
|
| 155 | - unset($skey, $sname); |
|
| 156 | - } |
|
| 157 | - ?> |
|
| 154 | + $col = ($col == 'one') ? 'two' : 'one'; |
|
| 155 | + unset($skey, $sname); |
|
| 156 | + } |
|
| 157 | + ?> |
|
| 158 | 158 | <?php if ( isset($file) ) { ?> |
| 159 | 159 | <li class="frm_col_<?php echo esc_attr( $col ) ?>"> |
| 160 | 160 | <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr($file->id) ?> show_image=1"><?php _e( 'Show image', 'formidable' ) ?></a> |
@@ -171,8 +171,8 @@ discard block |
||
| 171 | 171 | <div class="clear"></div> |
| 172 | 172 | <?php |
| 173 | 173 | |
| 174 | - if ( isset($uid) && ! empty($user_fields) ) { |
|
| 175 | - $col = 'one'; ?> |
|
| 174 | + if ( isset($uid) && ! empty($user_fields) ) { |
|
| 175 | + $col = 'one'; ?> |
|
| 176 | 176 | <p class="howto"><?php _e( 'Insert user information', 'formidable' ) ?></p> |
| 177 | 177 | <ul class="frm_code_list"> |
| 178 | 178 | <?php foreach ( $user_fields as $uk => $uf ) { ?> |
@@ -180,14 +180,14 @@ discard block |
||
| 180 | 180 | <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $uid->id . ' show="' . $uk . '"' ) ?>"><?php echo esc_html( $uf ) ?></a> |
| 181 | 181 | </li> |
| 182 | 182 | <?php |
| 183 | - $col = ($col == 'one') ? 'two' : 'one'; |
|
| 184 | - unset($uf, $uk); |
|
| 185 | - } |
|
| 186 | - unset($uid); ?> |
|
| 183 | + $col = ($col == 'one') ? 'two' : 'one'; |
|
| 184 | + unset($uf, $uk); |
|
| 185 | + } |
|
| 186 | + unset($uid); ?> |
|
| 187 | 187 | </ul> |
| 188 | 188 | <?php } |
| 189 | 189 | |
| 190 | - if ( isset($repeat_field) ) { ?> |
|
| 190 | + if ( isset($repeat_field) ) { ?> |
|
| 191 | 191 | <div class="clear"></div> |
| 192 | 192 | <p class="howto"><?php _e( 'Repeating field options', 'formidable' ) ?></p> |
| 193 | 193 | <ul class="frm_code_list"> |
@@ -196,9 +196,9 @@ discard block |
||
| 196 | 196 | </li> |
| 197 | 197 | </ul> |
| 198 | 198 | <?php |
| 199 | - } |
|
| 199 | + } |
|
| 200 | 200 | |
| 201 | - if ( isset($dfe) ) { ?> |
|
| 201 | + if ( isset($dfe) ) { ?> |
|
| 202 | 202 | |
| 203 | 203 | <div class="clear"></div> |
| 204 | 204 | <p class="howto"><?php _e( 'Dynamic field options', 'formidable' ) ?></p> |
@@ -217,8 +217,8 @@ discard block |
||
| 217 | 217 | </div> |
| 218 | 218 | |
| 219 | 219 | <?php |
| 220 | - if ( $settings_tab ) { |
|
| 220 | + if ( $settings_tab ) { |
|
| 221 | 221 | include( FrmAppHelper::plugin_path() . '/classes/views/frm-forms/mb_html_tab.php' ); |
| 222 | - } |
|
| 223 | - ?> |
|
| 222 | + } |
|
| 223 | + ?> |
|
| 224 | 224 | </div> |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | if ( $f->type == 'data' ) { |
| 44 | 44 | //get all fields from linked form |
| 45 | - if ( isset($f->field_options['form_select']) && is_numeric($f->field_options['form_select']) ) { |
|
| 45 | + if ( isset( $f->field_options['form_select'] ) && is_numeric( $f->field_options['form_select'] ) ) { |
|
| 46 | 46 | $linked_form = FrmDb::get_var( $wpdb->prefix . 'frm_fields', array( 'id' => $f->field_options['form_select'] ), 'form_id' ); |
| 47 | 47 | if ( ! in_array( $linked_form, $linked_forms ) ) { |
| 48 | 48 | $linked_forms[] = $linked_form; |
@@ -53,14 +53,14 @@ discard block |
||
| 53 | 53 | FrmAppHelper::insert_opt_html( array( 'id' => $f->id . ' show=' . $linked_field->id, 'key' => $f->field_key . ' show=' . $linked_field->field_key, 'name' => $linked_field->name, 'type' => $linked_field->type ) ); |
| 54 | 54 | |
| 55 | 55 | $ldfe = $linked_field->id; |
| 56 | - unset($linked_field); |
|
| 56 | + unset( $linked_field ); |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | $dfe = $f->id; |
| 62 | 62 | } |
| 63 | - unset($f); |
|
| 63 | + unset( $f ); |
|
| 64 | 64 | } |
| 65 | 65 | } ?> |
| 66 | 66 | </ul> |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | </li> |
| 85 | 85 | <?php |
| 86 | 86 | $col = ( $col == 'one' ) ? 'two' : 'one'; |
| 87 | - unset($skey, $sname); |
|
| 87 | + unset( $skey, $sname ); |
|
| 88 | 88 | } |
| 89 | 89 | ?> |
| 90 | 90 | </ul> |
@@ -106,8 +106,8 @@ discard block |
||
| 106 | 106 | ?> |
| 107 | 107 | <li> |
| 108 | 108 | <a href="javascript:void(0)" class="frmids alignright frm_insert_code" data-code="if <?php echo esc_attr( $f->id ) ?>]<?php esc_attr_e( 'Conditional text here', 'formidable' ) ?>[/if <?php echo esc_attr( $f->id ) ?>">[if <?php echo (int) $f->id ?>]</a> |
| 109 | - <a href="javascript:void(0)" class="frmkeys alignright frm_insert_code" data-code="if <?php echo esc_attr( $f->field_key ) ?>]something[/if <?php echo esc_attr( $f->field_key ) ?>">[if <?php echo FrmAppHelper::truncate($f->field_key, 10) ?>]</a> |
|
| 110 | - <a href="javascript:void(0)" class="frm_insert_code" data-code="<?php echo esc_attr($f->id) ?>"><?php echo FrmAppHelper::truncate($f->name, 60) ?></a> |
|
| 109 | + <a href="javascript:void(0)" class="frmkeys alignright frm_insert_code" data-code="if <?php echo esc_attr( $f->field_key ) ?>]something[/if <?php echo esc_attr( $f->field_key ) ?>">[if <?php echo FrmAppHelper::truncate( $f->field_key, 10 ) ?>]</a> |
|
| 110 | + <a href="javascript:void(0)" class="frm_insert_code" data-code="<?php echo esc_attr( $f->id ) ?>"><?php echo FrmAppHelper::truncate( $f->name, 60 ) ?></a> |
|
| 111 | 111 | </li> |
| 112 | 112 | <?php |
| 113 | 113 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | } else if ( $f->type == 'file' ) { |
| 117 | 117 | $file = $f; |
| 118 | 118 | } |
| 119 | - unset($f); |
|
| 119 | + unset( $f ); |
|
| 120 | 120 | } |
| 121 | 121 | } ?> |
| 122 | 122 | </ul> |
@@ -128,11 +128,11 @@ discard block |
||
| 128 | 128 | foreach ( $cond_shortcodes as $skey => $sname ) { |
| 129 | 129 | ?> |
| 130 | 130 | <li class="frm_col_<?php echo esc_attr( $col ) ?>"> |
| 131 | - <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="if x <?php echo esc_attr($skey) ?>][/if x"><?php echo esc_html( $sname ) ?></a> |
|
| 131 | + <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="if x <?php echo esc_attr( $skey ) ?>][/if x"><?php echo esc_html( $sname ) ?></a> |
|
| 132 | 132 | </li> |
| 133 | 133 | <?php |
| 134 | 134 | $col = ( $col == 'one' ) ? 'two' : 'one'; |
| 135 | - unset($skey, $sname); |
|
| 135 | + unset( $skey, $sname ); |
|
| 136 | 136 | } |
| 137 | 137 | ?> |
| 138 | 138 | </ul> |
@@ -151,19 +151,19 @@ discard block |
||
| 151 | 151 | </a> |
| 152 | 152 | </li> |
| 153 | 153 | <?php |
| 154 | - $col = ($col == 'one') ? 'two' : 'one'; |
|
| 155 | - unset($skey, $sname); |
|
| 154 | + $col = ( $col == 'one' ) ? 'two' : 'one'; |
|
| 155 | + unset( $skey, $sname ); |
|
| 156 | 156 | } |
| 157 | 157 | ?> |
| 158 | - <?php if ( isset($file) ) { ?> |
|
| 158 | + <?php if ( isset( $file ) ) { ?> |
|
| 159 | 159 | <li class="frm_col_<?php echo esc_attr( $col ) ?>"> |
| 160 | - <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr($file->id) ?> show_image=1"><?php _e( 'Show image', 'formidable' ) ?></a> |
|
| 160 | + <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $file->id ) ?> show_image=1"><?php _e( 'Show image', 'formidable' ) ?></a> |
|
| 161 | 161 | </li> |
| 162 | 162 | <li class="frm_col_<?php echo esc_attr( $col = ( $col == 'one' ? 'two' : 'one' ) ) ?>"> |
| 163 | - <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr($file->id) ?> show=id"><?php _e( 'Image ID', 'formidable' ) ?></a> |
|
| 163 | + <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $file->id ) ?> show=id"><?php _e( 'Image ID', 'formidable' ) ?></a> |
|
| 164 | 164 | </li> |
| 165 | 165 | <li class="frm_col_<?php echo esc_attr( $col = ( $col == 'one' ? 'two' : 'one' ) ) ?>"> |
| 166 | - <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr($file->id) ?> show_filename=1"><?php _e( 'Image Name', 'formidable' ) ?></a> |
|
| 166 | + <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $file->id ) ?> show_filename=1"><?php _e( 'Image Name', 'formidable' ) ?></a> |
|
| 167 | 167 | </li> |
| 168 | 168 | <?php } ?> |
| 169 | 169 | </ul> |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | <div class="clear"></div> |
| 172 | 172 | <?php |
| 173 | 173 | |
| 174 | - if ( isset($uid) && ! empty($user_fields) ) { |
|
| 174 | + if ( isset( $uid ) && ! empty( $user_fields ) ) { |
|
| 175 | 175 | $col = 'one'; ?> |
| 176 | 176 | <p class="howto"><?php _e( 'Insert user information', 'formidable' ) ?></p> |
| 177 | 177 | <ul class="frm_code_list"> |
@@ -180,14 +180,14 @@ discard block |
||
| 180 | 180 | <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $uid->id . ' show="' . $uk . '"' ) ?>"><?php echo esc_html( $uf ) ?></a> |
| 181 | 181 | </li> |
| 182 | 182 | <?php |
| 183 | - $col = ($col == 'one') ? 'two' : 'one'; |
|
| 184 | - unset($uf, $uk); |
|
| 183 | + $col = ( $col == 'one' ) ? 'two' : 'one'; |
|
| 184 | + unset( $uf, $uk ); |
|
| 185 | 185 | } |
| 186 | - unset($uid); ?> |
|
| 186 | + unset( $uid ); ?> |
|
| 187 | 187 | </ul> |
| 188 | 188 | <?php } |
| 189 | 189 | |
| 190 | - if ( isset($repeat_field) ) { ?> |
|
| 190 | + if ( isset( $repeat_field ) ) { ?> |
|
| 191 | 191 | <div class="clear"></div> |
| 192 | 192 | <p class="howto"><?php _e( 'Repeating field options', 'formidable' ) ?></p> |
| 193 | 193 | <ul class="frm_code_list"> |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | <?php |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | - if ( isset($dfe) ) { ?> |
|
| 201 | + if ( isset( $dfe ) ) { ?> |
|
| 202 | 202 | |
| 203 | 203 | <div class="clear"></div> |
| 204 | 204 | <p class="howto"><?php _e( 'Dynamic field options', 'formidable' ) ?></p> |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | <li class="frm_col_one"> |
| 207 | 207 | <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $dfe . ' show="created-at"' ) ?>"><?php _e( 'Creation Date', 'formidable' ) ?></a> |
| 208 | 208 | </li> |
| 209 | - <?php if ( isset($ldfe) ) { ?> |
|
| 209 | + <?php if ( isset( $ldfe ) ) { ?> |
|
| 210 | 210 | <li class="frm_col_two"> |
| 211 | 211 | <a href="javascript:void(0)" class="frmbutton button frm_insert_code" data-code="<?php echo esc_attr( $dfe . ' show="' . $ldfe . '"' ) ?>"><?php _e( 'Field From Entry', 'formidable' ) ?></a> |
| 212 | 212 | </li> |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | <div class="submitbox"> |
| 6 | 6 | <div id="minor-publishing" class="frm_remove_border"> |
| 7 | 7 | <div class="misc-pub-section"> |
| 8 | - <?php do_action('frm_show_entry_publish_box', $entry); ?> |
|
| 8 | + <?php do_action( 'frm_show_entry_publish_box', $entry ); ?> |
|
| 9 | 9 | <div class="clear"></div> |
| 10 | 10 | </div> |
| 11 | 11 | <div id="misc-publishing-actions"> |
@@ -17,12 +17,12 @@ discard block |
||
| 17 | 17 | </div> |
| 18 | 18 | </div> |
| 19 | 19 | <div id="major-publishing-actions"> |
| 20 | - <?php if ( current_user_can('frm_delete_entries') ) { ?> |
|
| 20 | + <?php if ( current_user_can( 'frm_delete_entries' ) ) { ?> |
|
| 21 | 21 | <div id="delete-action"> |
| 22 | 22 | <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-entries&frm_action=destroy&id=' . $id . '&form=' . $entry->form_id ) ) ?>" class="submitdelete deletion" onclick="return confirm('<?php esc_attr_e( 'Are you sure you want to delete that entry?', 'formidable' ) ?>');" title="<?php esc_attr_e( 'Delete' ) ?>"> |
| 23 | 23 | <?php _e( 'Delete' ) ?> |
| 24 | 24 | </a> |
| 25 | - <?php if ( ! empty($entry->post_id) ) { ?> |
|
| 25 | + <?php if ( ! empty( $entry->post_id ) ) { ?> |
|
| 26 | 26 | <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-entries&frm_action=destroy&id=' . $id . '&form=' . $entry->form_id . '&keep_post=1' ) ) ?>" class="submitdelete deletion frm_delete_wo_post" onclick="return confirm('<?php esc_attr_e( 'Are you sure you want to delete this entry?', 'formidable' ) ?>);" title="<?php esc_attr_e( 'Delete entry but leave the post', 'formidable' ) ?>"> |
| 27 | 27 | <?php _e( 'Delete without Post', 'formidable' ) ?> |
| 28 | 28 | </a> |
@@ -30,13 +30,13 @@ discard block |
||
| 30 | 30 | </div> |
| 31 | 31 | <?php } ?> |
| 32 | 32 | |
| 33 | - <?php do_action('frm_entry_major_pub', $entry); ?> |
|
| 33 | + <?php do_action( 'frm_entry_major_pub', $entry ); ?> |
|
| 34 | 34 | <div class="clear"></div> |
| 35 | 35 | </div> |
| 36 | 36 | </div> |
| 37 | 37 | </div> |
| 38 | 38 | </div> |
| 39 | -<?php do_action('frm_show_entry_sidebar', $entry); |
|
| 40 | -FrmEntriesController::entry_sidebar($entry); |
|
| 39 | +<?php do_action( 'frm_show_entry_sidebar', $entry ); |
|
| 40 | +FrmEntriesController::entry_sidebar( $entry ); |
|
| 41 | 41 | ?> |
| 42 | 42 | </div> |
@@ -10,16 +10,16 @@ discard block |
||
| 10 | 10 | <div class="postbox "> |
| 11 | 11 | <h3 class="hndle"><span><?php _e( 'Import', 'formidable' ) ?></span></h3> |
| 12 | 12 | <div class="inside"> |
| 13 | - <p class="howto"><?php echo apply_filters('frm_upload_instructions1', __( 'Upload your Formidable XML file to import forms into this site. If your imported form key and creation date match a form on your site, that form will be updated.', 'formidable' )) ?></p> |
|
| 13 | + <p class="howto"><?php echo apply_filters( 'frm_upload_instructions1', __( 'Upload your Formidable XML file to import forms into this site. If your imported form key and creation date match a form on your site, that form will be updated.', 'formidable' ) ) ?></p> |
|
| 14 | 14 | <br/> |
| 15 | 15 | <form enctype="multipart/form-data" method="post"> |
| 16 | 16 | <input type="hidden" name="frm_action" value="import_xml" /> |
| 17 | - <?php wp_nonce_field('import-xml-nonce', 'import-xml'); ?> |
|
| 18 | - <p><label><?php echo apply_filters('frm_upload_instructions2', __( 'Choose a Formidable XML file', 'formidable' )) ?> (<?php printf(__( 'Maximum size: %s', 'formidable' ), ini_get('upload_max_filesize')) ?>)</label> |
|
| 17 | + <?php wp_nonce_field( 'import-xml-nonce', 'import-xml' ); ?> |
|
| 18 | + <p><label><?php echo apply_filters( 'frm_upload_instructions2', __( 'Choose a Formidable XML file', 'formidable' ) ) ?> (<?php printf( __( 'Maximum size: %s', 'formidable' ), ini_get( 'upload_max_filesize' ) ) ?>)</label> |
|
| 19 | 19 | <input type="file" name="frm_import_file" size="25" /> |
| 20 | 20 | </p> |
| 21 | 21 | |
| 22 | - <?php do_action('frm_csv_opts', $forms) ?> |
|
| 22 | + <?php do_action( 'frm_csv_opts', $forms ) ?> |
|
| 23 | 23 | |
| 24 | 24 | <p class="submit"> |
| 25 | 25 | <input type="submit" value="<?php esc_attr_e( 'Upload file and import', 'formidable' ) ?>" class="button-primary" /> |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | <div class="inside with_frm_style"> |
| 36 | 36 | <form method="post" action="<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>" id="frm_export_xml"> |
| 37 | 37 | <input type="hidden" name="action" value="frm_export_xml" /> |
| 38 | - <?php wp_nonce_field('export-xml-nonce', 'export-xml'); ?> |
|
| 38 | + <?php wp_nonce_field( 'export-xml-nonce', 'export-xml' ); ?> |
|
| 39 | 39 | |
| 40 | 40 | <table class="form-table"> |
| 41 | 41 | <tr class="form-field"> |
@@ -91,9 +91,9 @@ |
||
| 91 | 91 | } else if ( $form->parent_form_id ) { |
| 92 | 92 | echo ' ' . __( '(child)', 'formidable' ); |
| 93 | 93 | } |
| 94 | - ?></option> |
|
| 94 | + ?></option> |
|
| 95 | 95 | <?php |
| 96 | - } ?> |
|
| 96 | + } ?> |
|
| 97 | 97 | </select> |
| 98 | 98 | <p class="howto"><?php _e( 'Hold down the CTRL/Command button to select multiple forms', 'formidable' ); ?></p> |
| 99 | 99 | </td> |
@@ -7,15 +7,15 @@ |
||
| 7 | 7 | <?php |
| 8 | 8 | foreach ( $type as $tb_type ) { |
| 9 | 9 | |
| 10 | - if ( ! isset( $tables[ $tb_type ] ) ) { |
|
| 10 | + if ( ! isset( $tables[ $tb_type ] ) ) { |
|
| 11 | 11 | do_action( 'frm_xml_import_' . $tb_type, $args ); |
| 12 | - continue; |
|
| 13 | - } |
|
| 12 | + continue; |
|
| 13 | + } |
|
| 14 | 14 | |
| 15 | - //no records |
|
| 16 | - if ( ! isset( $records[ $tb_type ] ) ) { |
|
| 17 | - continue; |
|
| 18 | - } |
|
| 15 | + //no records |
|
| 16 | + if ( ! isset( $records[ $tb_type ] ) ) { |
|
| 17 | + continue; |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | 20 | $item_ids = $records[ $tb_type ]; |
| 21 | 21 | if ( in_array( $tb_type, array( 'styles', 'actions' ) ) ) { |
@@ -7,17 +7,17 @@ discard block |
||
| 7 | 7 | <?php |
| 8 | 8 | foreach ( $type as $tb_type ) { |
| 9 | 9 | |
| 10 | - if ( ! isset( $tables[ $tb_type ] ) ) { |
|
| 10 | + if ( ! isset( $tables[$tb_type] ) ) { |
|
| 11 | 11 | do_action( 'frm_xml_import_' . $tb_type, $args ); |
| 12 | 12 | continue; |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | //no records |
| 16 | - if ( ! isset( $records[ $tb_type ] ) ) { |
|
| 16 | + if ( ! isset( $records[$tb_type] ) ) { |
|
| 17 | 17 | continue; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - $item_ids = $records[ $tb_type ]; |
|
| 20 | + $item_ids = $records[$tb_type]; |
|
| 21 | 21 | if ( in_array( $tb_type, array( 'styles', 'actions' ) ) ) { |
| 22 | 22 | include( dirname( __FILE__ ) . '/posts_xml.php' ); |
| 23 | 23 | } else if ( file_exists( dirname( __FILE__ ) . '/' . $tb_type . '_xml.php' ) ) { |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | include( FrmProAppHelper::plugin_path() . '/classes/views/xml/' . $tb_type . '_xml.php' ); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - unset( $item_ids, $records[ $tb_type ], $tb_type ); |
|
| 29 | + unset( $item_ids, $records[$tb_type], $tb_type ); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | ?> |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | <a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-styles&frm_action=destroy&id=' . $style->ID ) ); ?>" id="frm_delete_style" class="submitdelete deletion" onclick="return confirm('<?php esc_attr_e( 'Are you sure you want to delete that style?', 'formidable' ) ?>')"><?php _e( 'Delete Style', 'formidable' ) ?></a> |
| 65 | 65 | <?php } ?> |
| 66 | 66 | <?php |
| 67 | - if ( $style->ID ) { |
|
| 67 | + if ( $style->ID ) { |
|
| 68 | 68 | echo '<span class="howto"><span>.frm_style_' . esc_attr( $style->post_name ) . '</span></span>'; |
| 69 | 69 | } ?> |
| 70 | 70 | <div class="publishing-action"> |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | <form id="frm_styling_form" action="" name="frm_styling_form" method="post"> |
| 10 | 10 | <input type="hidden" name="ID" value="<?php echo esc_attr( $style->ID ) ?>" /> |
| 11 | 11 | <input type="hidden" name="frm_action" value="save" /> |
| 12 | - <textarea name="<?php echo esc_attr( $frm_style->get_field_name('custom_css') ) ?>" class="frm_hidden"><?php echo FrmAppHelper::esc_textarea( $style->post_content['custom_css'] ) ?></textarea> |
|
| 12 | + <textarea name="<?php echo esc_attr( $frm_style->get_field_name( 'custom_css' ) ) ?>" class="frm_hidden"><?php echo FrmAppHelper::esc_textarea( $style->post_content['custom_css'] ) ?></textarea> |
|
| 13 | 13 | <?php wp_nonce_field( 'frm_style_nonce', 'frm_style' ); ?> |
| 14 | 14 | <?php FrmTipsHelper::pro_tip( 'get_styling_tip', 'p' ); ?> |
| 15 | 15 | <div id="nav-menus-frame"> |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | <div class="styling_settings"> |
| 20 | 20 | <input type="hidden" name="style_name" value="frm_style_<?php echo esc_attr( $style->post_name ) ?>" /> |
| 21 | - <?php FrmStylesController::do_accordion_sections( FrmStylesController::$screen, 'side', compact('style', 'frm_style') ); ?> |
|
| 21 | + <?php FrmStylesController::do_accordion_sections( FrmStylesController::$screen, 'side', compact( 'style', 'frm_style' ) ); ?> |
|
| 22 | 22 | </div> |
| 23 | 23 | |
| 24 | 24 | </div><!-- /#menu-settings-column --> |
@@ -31,17 +31,17 @@ discard block |
||
| 31 | 31 | <div class="major-publishing-actions"> |
| 32 | 32 | <label class="menu-name-label howto open-label" for="menu-name"> |
| 33 | 33 | <span><?php _e( 'Style Name', 'formidable' ) ?></span> |
| 34 | - <input id="menu-name" name="<?php echo esc_attr( $frm_style->get_field_name('post_title', '') ); ?>" type="text" class="menu-name regular-text menu-item-textbox" title="<?php esc_attr_e( 'Enter style name here', 'formidable' ) ?>" value="<?php echo esc_attr( $style->post_title ) ?>" /> |
|
| 34 | + <input id="menu-name" name="<?php echo esc_attr( $frm_style->get_field_name( 'post_title', '' ) ); ?>" type="text" class="menu-name regular-text menu-item-textbox" title="<?php esc_attr_e( 'Enter style name here', 'formidable' ) ?>" value="<?php echo esc_attr( $style->post_title ) ?>" /> |
|
| 35 | 35 | </label> |
| 36 | 36 | |
| 37 | - <input name="prev_menu_order" type="hidden" value="<?php echo esc_attr($style->menu_order) ?>" /> |
|
| 37 | + <input name="prev_menu_order" type="hidden" value="<?php echo esc_attr( $style->menu_order ) ?>" /> |
|
| 38 | 38 | <label class="menu-name-label howto open-label default-style-box" for="menu_order"> |
| 39 | 39 | <span> |
| 40 | 40 | <?php if ( $style->menu_order ) { ?> |
| 41 | - <input name="<?php echo esc_attr( $frm_style->get_field_name('menu_order', '') ); ?>" type="hidden" value="1" /> |
|
| 42 | - <input id="menu_order" disabled="disabled" type="checkbox" value="1" <?php checked($style->menu_order, 1) ?> /> |
|
| 41 | + <input name="<?php echo esc_attr( $frm_style->get_field_name( 'menu_order', '' ) ); ?>" type="hidden" value="1" /> |
|
| 42 | + <input id="menu_order" disabled="disabled" type="checkbox" value="1" <?php checked( $style->menu_order, 1 ) ?> /> |
|
| 43 | 43 | <?php } else { ?> |
| 44 | - <input id="menu_order" name="<?php echo esc_attr( $frm_style->get_field_name('menu_order', '') ); ?>" type="checkbox" value="1" <?php checked($style->menu_order, 1) ?> /> |
|
| 44 | + <input id="menu_order" name="<?php echo esc_attr( $frm_style->get_field_name( 'menu_order', '' ) ); ?>" type="checkbox" value="1" <?php checked( $style->menu_order, 1 ) ?> /> |
|
| 45 | 45 | <?php } ?> |
| 46 | 46 | <?php _e( 'Make default style', 'formidable' ) ?></span> |
| 47 | 47 | </label> |