Completed
Pull Request — master (#2117)
by
unknown
37s
created
classes/helpers/FrmOnSubmitHelper.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -222,17 +222,17 @@  discard block
 block discarded – undo
222 222
 	public static function populate_on_submit_data( &$form_options, $action = null, $event = 'create' ) {
223 223
 		$opt = 'update' === $event ? 'edit_' : 'success_';
224 224
 		if ( ! $action || ! is_object( $action ) ) {
225
-			$form_options[ $opt . 'action' ] = self::get_default_action_type();
226
-			$form_options[ $opt . 'msg' ]    = self::get_default_msg();
225
+			$form_options[$opt . 'action'] = self::get_default_action_type();
226
+			$form_options[$opt . 'msg']    = self::get_default_msg();
227 227
 
228 228
 			return;
229 229
 		}
230 230
 
231
-		$form_options[ $opt . 'action' ] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message';
231
+		$form_options[$opt . 'action'] = isset( $action->post_content['success_action'] ) ? $action->post_content['success_action'] : 'message';
232 232
 
233
-		switch ( $form_options[ $opt . 'action' ] ) {
233
+		switch ( $form_options[$opt . 'action'] ) {
234 234
 			case 'redirect':
235
-				$form_options[ $opt . 'url' ]        = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : '';
235
+				$form_options[$opt . 'url']        = isset( $action->post_content['success_url'] ) ? $action->post_content['success_url'] : '';
236 236
 				$form_options['open_in_new_tab']     = ! empty( $action->post_content['open_in_new_tab'] );
237 237
 				$form_options['redirect_delay']      = ! empty( $action->post_content['redirect_delay'] );
238 238
 				$form_options['redirect_delay_time'] = $action->post_content['redirect_delay_time'];
@@ -240,11 +240,11 @@  discard block
 block discarded – undo
240 240
 				break;
241 241
 
242 242
 			case 'page':
243
-				$form_options[ $opt . 'page_id' ] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : '';
243
+				$form_options[$opt . 'page_id'] = isset( $action->post_content['success_page_id'] ) ? $action->post_content['success_page_id'] : '';
244 244
 				break;
245 245
 
246 246
 			default:
247
-				$form_options[ $opt . 'msg' ] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg();
247
+				$form_options[$opt . 'msg'] = ! empty( $action->post_content['success_msg'] ) ? $action->post_content['success_msg'] : self::get_default_msg();
248 248
 				$form_options['show_form']    = ! empty( $action->post_content['show_form'] );
249 249
 		}
250 250
 	}
@@ -333,20 +333,20 @@  discard block
 block discarded – undo
333 333
 	private static function get_on_submit_action_data_from_form_options( $form_options, $event = 'create' ) {
334 334
 		$opt  = 'update' === $event ? 'edit_' : 'success_';
335 335
 		$data = array(
336
-			'success_action' => isset( $form_options[ $opt . 'action' ] ) ? $form_options[ $opt . 'action' ] : self::get_default_action_type(),
336
+			'success_action' => isset( $form_options[$opt . 'action'] ) ? $form_options[$opt . 'action'] : self::get_default_action_type(),
337 337
 		);
338 338
 
339 339
 		switch ( $data['success_action'] ) {
340 340
 			case 'redirect':
341
-				$data['success_url'] = isset( $form_options[ $opt . 'url' ] ) ? $form_options[ $opt . 'url' ] : '';
341
+				$data['success_url'] = isset( $form_options[$opt . 'url'] ) ? $form_options[$opt . 'url'] : '';
342 342
 				break;
343 343
 
344 344
 			case 'page':
345
-				$data['success_page_id'] = isset( $form_options[ $opt . 'page_id' ] ) ? $form_options[ $opt . 'page_id' ] : '';
345
+				$data['success_page_id'] = isset( $form_options[$opt . 'page_id'] ) ? $form_options[$opt . 'page_id'] : '';
346 346
 				break;
347 347
 
348 348
 			default:
349
-				$data['success_msg'] = isset( $form_options[ $opt . 'msg' ] ) ? $form_options[ $opt . 'msg' ] : self::get_default_msg();
349
+				$data['success_msg'] = isset( $form_options[$opt . 'msg'] ) ? $form_options[$opt . 'msg'] : self::get_default_msg();
350 350
 				$data['show_form']   = ! empty( $form_options['show_form'] );
351 351
 		}
352 352
 
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 		$default_msg = self::get_default_msg();
396 396
 		if ( current_user_can( 'frm_edit_forms' ) ) {
397 397
 			$default_msg .= '<br />';
398
-			$default_msg .= '<span style="font-weight: 600; font-style: italic;">';;
398
+			$default_msg .= '<span style="font-weight: 600; font-style: italic;">'; ;
399 399
 			$default_msg .= __( 'This is the fallback message. No confirmation actions that match your conditional logic, or they are invalid.', 'formidable' );
400 400
 			$default_msg .= '</span>';
401 401
 		}
Please login to merge, or discard this patch.