Completed
Branch master (3ac4b1)
by Zack
04:30
created
includes/wordpress-widgets/register-wordpress-widgets.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,14 +21,14 @@
 block discarded – undo
21 21
 function gravityview_register_widgets() {
22 22
 
23 23
 	/** @define "GRAVITYVIEW_DIR" "../../" */
24
-	require_once( GRAVITYVIEW_DIR . 'includes/wordpress-widgets/class-gravityview-recent-entries-widget.php' );
24
+	require_once(GRAVITYVIEW_DIR.'includes/wordpress-widgets/class-gravityview-recent-entries-widget.php');
25 25
 
26
-	register_widget( 'GravityView_Recent_Entries_Widget' );
26
+	register_widget('GravityView_Recent_Entries_Widget');
27 27
 
28
-	require_once( GRAVITYVIEW_DIR . 'includes/wordpress-widgets/class-gravityview-search-wp-widget.php' );
28
+	require_once(GRAVITYVIEW_DIR.'includes/wordpress-widgets/class-gravityview-search-wp-widget.php');
29 29
 
30
-	register_widget( 'GravityView_Search_WP_Widget' );
30
+	register_widget('GravityView_Search_WP_Widget');
31 31
 
32 32
 }
33 33
 
34
-add_action( 'widgets_init', 'gravityview_register_widgets' );
35 34
\ No newline at end of file
35
+add_action('widgets_init', 'gravityview_register_widgets');
36 36
\ No newline at end of file
Please login to merge, or discard this patch.
templates/fields/address.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 	if( !isset( $field_settings['show_map_link'] ) || !empty( $field_settings['show_map_link'] ) ){
26 26
 
27 27
 		// Add the map link as another line
28
-	    $value_with_newline .= "\n" . gravityview_get_map_link( $value_with_newline );
28
+		$value_with_newline .= "\n" . gravityview_get_map_link( $value_with_newline );
29 29
 
30 30
 	}
31 31
 
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,31 +9,31 @@
 block discarded – undo
9 9
 
10 10
 $gravityview_view = GravityView_View::getInstance();
11 11
 
12
-extract( $gravityview_view->getCurrentField() );
12
+extract($gravityview_view->getCurrentField());
13 13
 
14 14
 // If it's the full address
15
-if( floor( $field_id ) === floatval( $field_id ) ) {
15
+if (floor($field_id) === floatval($field_id)) {
16 16
 
17 17
 	// @todo Implement the `gform_disable_address_map_link` filter (boolean) added in GF 1.9 to enable/disable map link
18 18
 	// Use Gravity Forms' method to get the full address.
19 19
 	// Pass the `text` parameter so the map link isn't added like when passing `html`
20
-	$value_with_newline = GFCommon::get_lead_field_display( $field, $value, "", false, 'text' );
20
+	$value_with_newline = GFCommon::get_lead_field_display($field, $value, "", false, 'text');
21 21
 
22
-	if( empty( $value_with_newline ) ) { return; }
22
+	if (empty($value_with_newline)) { return; }
23 23
 
24 24
 	// Add map link if it's not set (default, back compat) or if it's set to yes
25
-	if( !isset( $field_settings['show_map_link'] ) || !empty( $field_settings['show_map_link'] ) ){
25
+	if (!isset($field_settings['show_map_link']) || !empty($field_settings['show_map_link'])) {
26 26
 
27 27
 		// Add the map link as another line
28
-	    $value_with_newline .= "\n" . gravityview_get_map_link( $value_with_newline );
28
+	    $value_with_newline .= "\n".gravityview_get_map_link($value_with_newline);
29 29
 
30 30
 	}
31 31
 
32 32
 	// Full address without the "Map It" link
33
-	echo str_replace("\n", '<br />', $value_with_newline );
33
+	echo str_replace("\n", '<br />', $value_with_newline);
34 34
 
35 35
 } else {
36 36
 
37
-	echo gravityview_get_field_value( $entry, $field_id, $display_value );
37
+	echo gravityview_get_field_value($entry, $field_id, $display_value);
38 38
 
39 39
 }
Please login to merge, or discard this patch.
templates/fields/calculation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,6 +8,6 @@
 block discarded – undo
8 8
 
9 9
 $gravityview_view = GravityView_View::getInstance();
10 10
 
11
-extract( $gravityview_view->getCurrentField() );
11
+extract($gravityview_view->getCurrentField());
12 12
 
13
-echo gravityview_get_field_value( $entry, $field_id, $display_value );
13
+echo gravityview_get_field_value($entry, $field_id, $display_value);
Please login to merge, or discard this patch.
templates/fields/checkbox.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
 
10 10
 $gravityview_view = GravityView_View::getInstance();
11 11
 
12
-extract( $gravityview_view->getCurrentField() );
12
+extract($gravityview_view->getCurrentField());
13 13
 
14
-if( in_array( $field['type'], array( 'radio', 'checkbox' ) ) && !empty( $entry[ $field_id ] ) ) {
14
+if (in_array($field['type'], array('radio', 'checkbox')) && !empty($entry[$field_id])) {
15 15
 
16 16
 	/**
17 17
 	 * @filter `gravityview_field_tick` Change the output for a checkbox "check" symbol. Default is dashicons-yes icon
@@ -20,10 +20,10 @@  discard block
 block discarded – undo
20 20
 	 * @param array $entry Gravity Forms entry array
21 21
 	 * @param array $field GravityView field array
22 22
 	 */
23
-	$output = apply_filters( 'gravityview_field_tick', '<span class="dashicons dashicons-yes"></span>', $entry, $field);
23
+	$output = apply_filters('gravityview_field_tick', '<span class="dashicons dashicons-yes"></span>', $entry, $field);
24 24
 
25 25
 } else {
26
-	$output = gravityview_get_field_value( $entry, $field_id, $display_value );
26
+	$output = gravityview_get_field_value($entry, $field_id, $display_value);
27 27
 }
28 28
 
29 29
 echo $output;
Please login to merge, or discard this patch.
templates/fields/created_by.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@  discard block
 block discarded – undo
8 8
 
9 9
 $gravityview_view = GravityView_View::getInstance();
10 10
 
11
-extract( $gravityview_view->getCurrentField() );
11
+extract($gravityview_view->getCurrentField());
12 12
 
13 13
 // There was no logged in user.
14
-if( empty( $value ) ) {
14
+if (empty($value)) {
15 15
 	return;
16 16
 }
17 17
 
@@ -19,6 +19,6 @@  discard block
 block discarded – undo
19 19
 $User = get_userdata($value);
20 20
 
21 21
 // Display the user data, based on the settings `id`, `username`, or `display_name`
22
-$name_display = empty( $field_settings['name_display'] ) ? 'display_name' : $field_settings['name_display'];
22
+$name_display = empty($field_settings['name_display']) ? 'display_name' : $field_settings['name_display'];
23 23
 
24 24
 echo $User->{$name_display};
Please login to merge, or discard this patch.
templates/fields/custom.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
 
10 10
 $gravityview_view = GravityView_View::getInstance();
11 11
 
12
-extract( $gravityview_view->getCurrentField() );
12
+extract($gravityview_view->getCurrentField());
13 13
 
14 14
 // Make sure the class is loaded in DataTables
15
-if( !class_exists( 'GFFormDisplay' ) ) {
16
-	include_once( GFCommon::get_base_path() . '/form_display.php' );
15
+if (!class_exists('GFFormDisplay')) {
16
+	include_once(GFCommon::get_base_path().'/form_display.php');
17 17
 }
18 18
 
19 19
 // Tell the renderer not to wrap this field in an anchor tag.
@@ -24,22 +24,22 @@  discard block
 block discarded – undo
24 24
  * @since 1.6.2
25 25
  * @param string $content HTML content of field
26 26
  */
27
-$field_settings['content'] = apply_filters( 'gravityview/fields/custom/content_before', $field_settings['content'] );
27
+$field_settings['content'] = apply_filters('gravityview/fields/custom/content_before', $field_settings['content']);
28 28
 
29
-$field_settings['content'] = trim( rtrim( $field_settings['content'] ) );
29
+$field_settings['content'] = trim(rtrim($field_settings['content']));
30 30
 
31 31
 // No custom content
32
-if( empty( $field_settings['content'] ) ) {
32
+if (empty($field_settings['content'])) {
33 33
 	return;
34 34
 }
35 35
 
36 36
 // Replace the variables
37
-$content = GravityView_API::replace_variables( $field_settings['content'], $form, $entry );
37
+$content = GravityView_API::replace_variables($field_settings['content'], $form, $entry);
38 38
 
39 39
 // Add paragraphs?
40
-if( !empty( $field_settings['wpautop'] ) ) {
40
+if (!empty($field_settings['wpautop'])) {
41 41
 
42
-	$content = wpautop( $content );
42
+	$content = wpautop($content);
43 43
 
44 44
 }
45 45
 
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
  * @since 1.6.2
49 49
  * @param string $content HTML content of field
50 50
  */
51
-$content = apply_filters( 'gravityview/fields/custom/content_after', $content );
51
+$content = apply_filters('gravityview/fields/custom/content_after', $content);
52 52
 
53 53
 // Enqueue scripts needed for Gravity Form display, if form shortcode exists.
54 54
 // Also runs `do_shortcode()`
55
-echo GFCommon::gform_do_shortcode( $content );
55
+echo GFCommon::gform_do_shortcode($content);
Please login to merge, or discard this patch.
templates/fields/date.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,30 +8,30 @@  discard block
 block discarded – undo
8 8
 
9 9
 $gravityview_view = GravityView_View::getInstance();
10 10
 
11
-extract( $gravityview_view->getCurrentField() );
11
+extract($gravityview_view->getCurrentField());
12 12
 
13 13
 /**
14 14
  * Unix Epoch probably isn't what you're looking for.
15 15
  * @since 1.7
16 16
  */
17
-if( $value === '1970-01-01' ) {
17
+if ($value === '1970-01-01') {
18 18
 
19 19
 	/**
20 20
 	 * Return false to show value. Use `__return_false` callback.
21 21
 	 */
22
-	$hide_epoch = apply_filters( 'gravityview/fields/date/hide_epoch', true );
22
+	$hide_epoch = apply_filters('gravityview/fields/date/hide_epoch', true);
23 23
 
24
-	if( $hide_epoch ) {
24
+	if ($hide_epoch) {
25 25
 		return;
26 26
 	}
27 27
 }
28 28
 
29
-if( !empty( $field_settings ) && !empty( $field_settings['date_display'] ) && !empty( $value )) {
29
+if (!empty($field_settings) && !empty($field_settings['date_display']) && !empty($value)) {
30 30
 
31 31
 	// If there is a custom PHP date format passed via the date_display setting,
32 32
 	// use PHP's date format
33 33
 	$format = $field_settings['date_display'];
34
-	$output = date_i18n( $format, strtotime( $value ) );
34
+	$output = date_i18n($format, strtotime($value));
35 35
 
36 36
 } else {
37 37
 
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
 	 * @see https://codex.wordpress.org/Formatting_Date_and_Time
41 41
 	 * @param null|string Date Format (default: $field->dateFormat)
42 42
 	 */
43
-	$format = apply_filters( 'gravityview_date_format', rgar($field, "dateFormat") );
44
-	$output = GFCommon::date_display( $value, $format );
43
+	$format = apply_filters('gravityview_date_format', rgar($field, "dateFormat"));
44
+	$output = GFCommon::date_display($value, $format);
45 45
 
46 46
 }
47 47
 
Please login to merge, or discard this patch.
templates/fields/date_created.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 $gravityview_view = GravityView_View::getInstance();
10 10
 
11
-extract( $gravityview_view->getCurrentField() );
11
+extract($gravityview_view->getCurrentField());
12 12
 
13 13
 /**
14 14
  * @filter `gravityview_date_created_adjust_timezone` Whether to adjust the timezone for entries. \n
@@ -17,19 +17,19 @@  discard block
 block discarded – undo
17 17
  * @param[out,in] boolean $adjust_tz  Use timezone-adjusted datetime? If true, adjusts date based on blog's timezone setting. If false, uses UTC setting. Default: true
18 18
  * @param[in] string $context Where the filter is being called from. `display` in this case.
19 19
  */
20
-$adjust_tz = apply_filters( 'gravityview_date_created_adjust_timezone', true, 'display' );
20
+$adjust_tz = apply_filters('gravityview_date_created_adjust_timezone', true, 'display');
21 21
 
22 22
 /**
23 23
  * date_created is stored in UTC format. Fetch in the current blog's timezone if $adjust_tz is true
24 24
  */
25
-$tz_value = $adjust_tz ? get_date_from_gmt( $value ) : $value;
25
+$tz_value = $adjust_tz ? get_date_from_gmt($value) : $value;
26 26
 
27
-if( !empty( $field_settings ) && !empty( $field_settings['date_display'] ) && !empty( $tz_value )) {
27
+if (!empty($field_settings) && !empty($field_settings['date_display']) && !empty($tz_value)) {
28 28
 
29 29
 	// If there is a custom PHP date format passed via the date_display setting,
30 30
 	// use PHP's date format
31 31
 	$format = $field_settings['date_display'];
32
-	$output = date_i18n( $format, strtotime( $tz_value ) );
32
+	$output = date_i18n($format, strtotime($tz_value));
33 33
 
34 34
 } else {
35 35
 
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
 	 * @see https://codex.wordpress.org/Formatting_Date_and_Time
39 39
 	 * @param null|string Date Format (default: $field->dateFormat)
40 40
 	 */
41
-	$format = apply_filters( 'gravityview_date_format', rgar($field, "dateFormat") );
42
-	$output = GFCommon::date_display( $tz_value, $format );
41
+	$format = apply_filters('gravityview_date_format', rgar($field, "dateFormat"));
42
+	$output = GFCommon::date_display($tz_value, $format);
43 43
 
44 44
 }
45 45
 
Please login to merge, or discard this patch.
templates/fields/email.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -8,17 +8,17 @@  discard block
 block discarded – undo
8 8
 
9 9
 $gravityview_view = GravityView_View::getInstance();
10 10
 
11
-extract( $gravityview_view->getCurrentField() );
11
+extract($gravityview_view->getCurrentField());
12 12
 
13 13
 // If there's no email, don't bother continuing.
14
-if( empty( $value ) ) {
14
+if (empty($value)) {
15 15
 	return;
16 16
 }
17 17
 
18 18
 // Default: plain email, no link
19 19
 $output = $value;
20 20
 
21
-if( !isset( $field_settings['emailmailto'] ) || !empty( $field_settings['emailmailto'] ) ) {
21
+if (!isset($field_settings['emailmailto']) || !empty($field_settings['emailmailto'])) {
22 22
 
23 23
 	$params = array();
24 24
 
@@ -26,28 +26,28 @@  discard block
 block discarded – undo
26 26
 	$link = 'mailto:'.$value;
27 27
 
28 28
 	// Is the subject set?
29
-	if( !empty( $field_settings['emailsubject'] ) ) {
29
+	if (!empty($field_settings['emailsubject'])) {
30 30
 
31
-		$subject = GravityView_API::replace_variables( $field_settings['emailsubject'], $form, $entry );
31
+		$subject = GravityView_API::replace_variables($field_settings['emailsubject'], $form, $entry);
32 32
 
33
-		$params[] = 'subject='.str_replace('+', '%20', urlencode( $subject ) );
33
+		$params[] = 'subject='.str_replace('+', '%20', urlencode($subject));
34 34
 	}
35 35
 
36 36
 	// Is the body set?
37
-	if( !empty( $field_settings['emailbody'] ) ) {
37
+	if (!empty($field_settings['emailbody'])) {
38 38
 
39
-		$body = GravityView_API::replace_variables( $field_settings['emailbody'], $form, $entry );
39
+		$body = GravityView_API::replace_variables($field_settings['emailbody'], $form, $entry);
40 40
 
41
-		$params[] = 'body='.str_replace('+', '%20', urlencode( $body ) );
41
+		$params[] = 'body='.str_replace('+', '%20', urlencode($body));
42 42
 	}
43 43
 
44 44
 	// If the subject and body have been set, use them
45
-	if( !empty( $params) ) {
46
-		$link .= '?'.implode( '&', $params );
45
+	if (!empty($params)) {
46
+		$link .= '?'.implode('&', $params);
47 47
 	}
48 48
 
49 49
 	// Generate the link HTML
50
-	$output = gravityview_get_link( $link, $value );
50
+	$output = gravityview_get_link($link, $value);
51 51
 
52 52
 }
53 53
 
@@ -56,12 +56,12 @@  discard block
 block discarded – undo
56 56
  * @since 1.1.6
57 57
  * @var boolean
58 58
  */
59
-$prevent_encrypt = apply_filters( 'gravityview_email_prevent_encrypt', false );
59
+$prevent_encrypt = apply_filters('gravityview_email_prevent_encrypt', false);
60 60
 
61 61
 // If encrypting the link
62
-if( !empty( $field_settings['emailencrypt'] ) && !$prevent_encrypt ) {
62
+if (!empty($field_settings['emailencrypt']) && !$prevent_encrypt) {
63 63
 
64
-	$output = GVCommon::js_encrypt( $output );
64
+	$output = GVCommon::js_encrypt($output);
65 65
 
66 66
 }
67 67
 
Please login to merge, or discard this patch.