Completed
Pull Request — master (#605)
by Zack
05:45
created
includes/fields/class-gravityview-field-entry-link.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 
8 8
 	var $name = 'entry_link';
9 9
 
10
-	var $contexts = array( 'multiple' );
10
+	var $contexts = array('multiple');
11 11
 
12 12
 	/**
13 13
 	 * @var bool
@@ -22,24 +22,24 @@  discard block
 block discarded – undo
22 22
 	var $is_searchable = false;
23 23
 
24 24
 	public function __construct() {
25
-		$this->label = esc_attr__( 'Link to Entry', 'gravityview' );
25
+		$this->label = esc_attr__('Link to Entry', 'gravityview');
26 26
 		$this->description = __('A dedicated link to the single entry with customizable text.', 'gravityview');
27 27
 		parent::__construct();
28 28
 	}
29 29
 
30
-	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
30
+	function field_options($field_options, $template_id, $field_id, $context, $input_type) {
31 31
 
32 32
 		// Always a link!
33
-		unset( $field_options['show_as_link'], $field_options['search_filter'] );
33
+		unset($field_options['show_as_link'], $field_options['search_filter']);
34 34
 
35
-		if( 'edit' === $context ) {
35
+		if ('edit' === $context) {
36 36
 			return $field_options;
37 37
 		}
38 38
 
39 39
 		$add_options = array();
40 40
 		$add_options['entry_link_text'] = array(
41 41
 			'type' => 'text',
42
-			'label' => __( 'Link Text:', 'gravityview' ),
42
+			'label' => __('Link Text:', 'gravityview'),
43 43
 			'desc' => NULL,
44 44
 			'value' => __('View Details', 'gravityview'),
45 45
 			'merge_tags' => true,
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-gquiz_score.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,20 +10,20 @@
 block discarded – undo
10 10
 	var $label = 'Quiz Score';
11 11
 
12 12
 	public function __construct() {
13
-		$this->label = esc_attr__( 'Quiz Score', 'gravityview' );
13
+		$this->label = esc_attr__('Quiz Score', 'gravityview');
14 14
 		parent::__construct();
15 15
 	}
16 16
 
17
-	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
17
+	function field_options($field_options, $template_id, $field_id, $context, $input_type) {
18 18
 
19
-		if( 'edit' === $context ) {
19
+		if ('edit' === $context) {
20 20
 			return $field_options;
21 21
 		}
22 22
 
23 23
 		$new_fields = array(
24 24
 			'quiz_use_max_score' => array(
25 25
 				'type' => 'checkbox',
26
-				'label' => __( 'Show Max Score?', 'gravityview' ),
26
+				'label' => __('Show Max Score?', 'gravityview'),
27 27
 				'desc' => __('Display score as the a fraction: "[score]/[max score]". If unchecked, will display score.', 'gravityview'),
28 28
 				'value' => true,
29 29
 				'merge_tags' => false,
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-list.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 	var $name = 'list';
11 11
 
12
-	var $search_operators = array( 'contains' );
12
+	var $search_operators = array('contains');
13 13
 
14 14
 	/**
15 15
 	 * @var bool
@@ -25,11 +25,11 @@  discard block
 block discarded – undo
25 25
 
26 26
 	function __construct() {
27 27
 
28
-		$this->label = esc_attr__( 'List', 'gravityview' );
28
+		$this->label = esc_attr__('List', 'gravityview');
29 29
 
30 30
 		parent::__construct();
31 31
 
32
-		add_filter( 'gravityview/template/field_label', array( $this, '_filter_field_label' ), 10, 4 );
32
+		add_filter('gravityview/template/field_label', array($this, '_filter_field_label'), 10, 4);
33 33
 	}
34 34
 
35 35
 	/**
@@ -46,24 +46,24 @@  discard block
 block discarded – undo
46 46
 	 *
47 47
 	 * @return array|string|null Returns null if the $field_value passed wasn't an array or serialized array
48 48
 	 */
49
-	public static function column_value( GF_Field_List $field, $field_value, $column_id = 0, $format = 'html' ) {
49
+	public static function column_value(GF_Field_List $field, $field_value, $column_id = 0, $format = 'html') {
50 50
 
51
-		$list_rows = maybe_unserialize( $field_value );
51
+		$list_rows = maybe_unserialize($field_value);
52 52
 
53
-		if( ! is_array( $list_rows ) ) {
54
-			do_action( 'gravityview_log_error', __METHOD__ . ' - $field_value did not unserialize', $field_value );
53
+		if (!is_array($list_rows)) {
54
+			do_action('gravityview_log_error', __METHOD__.' - $field_value did not unserialize', $field_value);
55 55
 			return null;
56 56
 		}
57 57
 
58 58
 		$column_values = array();
59 59
 
60 60
 		// Each list row
61
-		foreach ( $list_rows as $list_row ) {
61
+		foreach ($list_rows as $list_row) {
62 62
 			$current_column = 0;
63
-			foreach ( $list_row as $column_key => $column_value ) {
63
+			foreach ($list_row as $column_key => $column_value) {
64 64
 
65 65
 				// If the label of the column matches $column_id, or the numeric key value matches, add the value
66
-				if( (string)$column_key === (string)$column_id || ( is_numeric( $column_id ) && (int)$column_id === $current_column ) ) {
66
+				if ((string)$column_key === (string)$column_id || (is_numeric($column_id) && (int)$column_id === $current_column)) {
67 67
 					$column_values[] = $column_value;
68 68
 				}
69 69
 				$current_column++;
@@ -71,12 +71,12 @@  discard block
 block discarded – undo
71 71
 		}
72 72
 
73 73
 		// Return the array of values
74
-		if( 'raw' === $format ) {
74
+		if ('raw' === $format) {
75 75
 			return $column_values;
76 76
 		}
77 77
 		// Return the Gravity Forms Field output
78 78
 		else {
79
-			return $field->get_value_entry_detail( serialize( $column_values ), '', false, $format );
79
+			return $field->get_value_entry_detail(serialize($column_values), '', false, $format);
80 80
 		}
81 81
 	}
82 82
 
@@ -92,30 +92,30 @@  discard block
 block discarded – undo
92 92
 	 *
93 93
 	 * @return string Existing label if the field isn't
94 94
 	 */
95
-	public function _filter_field_label( $label, $field, $form, $entry ) {
95
+	public function _filter_field_label($label, $field, $form, $entry) {
96 96
 
97
-		$field_object = RGFormsModel::get_field( $form, $field['id'] );
97
+		$field_object = RGFormsModel::get_field($form, $field['id']);
98 98
 
99 99
 		// Not a list field
100
-		if( ! $field_object || 'list' !== $field_object->type ) {
100
+		if (!$field_object || 'list' !== $field_object->type) {
101 101
 			return $label;
102 102
 		}
103 103
 
104 104
 		// Custom label is defined, so use it
105
-		if( ! empty( $field['custom_label'] ) ) {
105
+		if (!empty($field['custom_label'])) {
106 106
 			return $label;
107 107
 		}
108 108
 
109
-		$field_id_array = explode( '.', $field['id'] );
109
+		$field_id_array = explode('.', $field['id']);
110 110
 
111 111
 		// Parent field, not column field
112
-		if( ! isset( $field_id_array[1] ) ) {
112
+		if (!isset($field_id_array[1])) {
113 113
 			return $label;
114 114
 		}
115 115
 
116
-		$column_id = intval( $field_id_array[1] );
116
+		$column_id = intval($field_id_array[1]);
117 117
 
118
-		return self::get_column_label( $field_object, $column_id, $label );
118
+		return self::get_column_label($field_object, $column_id, $label);
119 119
 	}
120 120
 
121 121
 	/**
@@ -129,17 +129,17 @@  discard block
 block discarded – undo
129 129
 	 *
130 130
 	 * @return string
131 131
 	 */
132
-	public static function get_column_label( GF_Field_List $field, $column_id, $backup_label = '' ) {
132
+	public static function get_column_label(GF_Field_List $field, $column_id, $backup_label = '') {
133 133
 
134 134
 		// Doesn't have columns enabled
135
-		if( ! isset( $field->choices ) || ! $field->enableColumns ) {
135
+		if (!isset($field->choices) || !$field->enableColumns) {
136 136
 			return $backup_label;
137 137
 		}
138 138
 
139 139
 		// Get the list of columns, with numeric index keys
140
-		$columns = wp_list_pluck( $field->choices, 'text' );
140
+		$columns = wp_list_pluck($field->choices, 'text');
141 141
 
142
-		return isset( $columns[ $column_id ] ) ? $columns[ $column_id ] : $backup_label;
142
+		return isset($columns[$column_id]) ? $columns[$column_id] : $backup_label;
143 143
 	}
144 144
 
145 145
 }
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-post-id.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,19 +11,19 @@
 block discarded – undo
11 11
 
12 12
 	var $label = 'Post ID';
13 13
 
14
-	var $search_operators = array( 'is', 'isnot', 'greater_than', 'less_than' );
14
+	var $search_operators = array('is', 'isnot', 'greater_than', 'less_than');
15 15
 
16 16
 	/**
17 17
 	 * GravityView_Field_Post_ID constructor.
18 18
 	 */
19 19
 	public function __construct() {
20
-		$this->label = __( 'Post ID', 'gravityview' );
20
+		$this->label = __('Post ID', 'gravityview');
21 21
 		parent::__construct();
22 22
 	}
23 23
 
24
-	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
24
+	function field_options($field_options, $template_id, $field_id, $context, $input_type) {
25 25
 
26
-		$this->add_field_support('link_to_post', $field_options );
26
+		$this->add_field_support('link_to_post', $field_options);
27 27
 
28 28
 		return $field_options;
29 29
 	}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-source-url.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,35 +7,35 @@
 block discarded – undo
7 7
 
8 8
 	var $name = 'source_url';
9 9
 
10
-	var $search_operators = array( 'is', 'isnot', 'contains', 'starts_with', 'ends_with' );
10
+	var $search_operators = array('is', 'isnot', 'contains', 'starts_with', 'ends_with');
11 11
 
12 12
 	var $label = 'Source URL';
13 13
 
14 14
 	public function __construct() {
15
-		$this->label = esc_attr__( 'Source URL', 'gravityview' );
15
+		$this->label = esc_attr__('Source URL', 'gravityview');
16 16
 		parent::__construct();
17 17
 	}
18 18
 
19
-	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
19
+	function field_options($field_options, $template_id, $field_id, $context, $input_type) {
20 20
 
21 21
 		// Don't link to entry; doesn't make sense.
22
-		unset( $field_options['show_as_link'] );
22
+		unset($field_options['show_as_link']);
23 23
 
24
-		if( 'edit' === $context ) {
24
+		if ('edit' === $context) {
25 25
 			return $field_options;
26 26
 		}
27 27
 
28 28
 		$add_options = array();
29 29
 		$add_options['link_to_source'] = array(
30 30
 			'type' => 'checkbox',
31
-			'label' => __( 'Link to URL:', 'gravityview' ),
31
+			'label' => __('Link to URL:', 'gravityview'),
32 32
 			'desc' => __('Display as a link to the Source URL', 'gravityview'),
33 33
 			'value' => false,
34 34
 			'merge_tags' => false,
35 35
 		);
36 36
 		$add_options['source_link_text'] = array(
37 37
 			'type' => 'text',
38
-			'label' => __( 'Link Text:', 'gravityview' ),
38
+			'label' => __('Link Text:', 'gravityview'),
39 39
 			'desc' => __('Customize the link text. If empty, the link text will be the the URL.', 'gravityview'),
40 40
 			'value' => NULL,
41 41
 			'merge_tags' => true,
Please login to merge, or discard this patch.
includes/admin/metaboxes/views/data-source.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package GravityView
4
- * @subpackage Gravityview/admin/metaboxes/views
5
- * @since 1.8
6
- * @global WP_Post $post
7
- */
3
+	 * @package GravityView
4
+	 * @subpackage Gravityview/admin/metaboxes/views
5
+	 * @since 1.8
6
+	 * @global WP_Post $post
7
+	 */
8 8
 
9 9
 
10 10
 // Use nonce for verification
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-textarea.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@  discard block
 block discarded – undo
7 7
 
8 8
 	var $name = 'textarea';
9 9
 
10
-	var $search_operators = array( 'is', 'isnot', 'contains', 'starts_with', 'ends_with' );
10
+	var $search_operators = array('is', 'isnot', 'contains', 'starts_with', 'ends_with');
11 11
 
12 12
 	var $_gf_field_class_name = 'GF_Field_Textarea';
13 13
 
14 14
 	var $group = 'standard';
15 15
 
16
-	function field_options( $field_options, $template_id = '', $field_id = '', $context = '', $input_type = '' ) {
16
+	function field_options($field_options, $template_id = '', $field_id = '', $context = '', $input_type = '') {
17 17
 
18
-		if( 'edit' === $context ) {
18
+		if ('edit' === $context) {
19 19
 			return $field_options;
20 20
 		}
21 21
 
@@ -23,16 +23,16 @@  discard block
 block discarded – undo
23 23
 			'type' => 'number',
24 24
 			'merge_tags' => false,
25 25
 			'value' => null,
26
-			'label' => __( 'Maximum words shown', 'gravityview' ),
27
-			'tooltip' => __( 'Enter the number of words to be shown. If specified it truncates the text. Leave it blank if you want to show the full text.', 'gravityview' ),
26
+			'label' => __('Maximum words shown', 'gravityview'),
27
+			'tooltip' => __('Enter the number of words to be shown. If specified it truncates the text. Leave it blank if you want to show the full text.', 'gravityview'),
28 28
 		);
29 29
 
30 30
         $field_options['make_clickable'] = array(
31 31
             'type' => 'checkbox',
32 32
             'merge_tags' => false,
33 33
             'value' => 0,
34
-            'label' => __( 'Convert text URLs to HTML links', 'gravityview' ),
35
-            'tooltip' => __( 'Converts URI, www, FTP, and email addresses in HTML links', 'gravityview' ),
34
+            'label' => __('Convert text URLs to HTML links', 'gravityview'),
35
+            'tooltip' => __('Converts URI, www, FTP, and email addresses in HTML links', 'gravityview'),
36 36
         );
37 37
 
38 38
 		return $field_options;
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-post-title.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,21 +7,21 @@
 block discarded – undo
7 7
 
8 8
 	var $name = 'post_title';
9 9
 
10
-	var $search_operators = array( 'is', 'isnot', 'contains', 'starts_with', 'ends_with' );
10
+	var $search_operators = array('is', 'isnot', 'contains', 'starts_with', 'ends_with');
11 11
 
12 12
 	var $_gf_field_class_name = 'GF_Field_Post_Title';
13 13
 
14 14
 	var $group = 'post';
15 15
 
16
-	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
16
+	function field_options($field_options, $template_id, $field_id, $context, $input_type) {
17 17
 
18
-		if( 'edit' === $context ) {
18
+		if ('edit' === $context) {
19 19
 			return $field_options;
20 20
 		}
21 21
 
22
-		$this->add_field_support('link_to_post', $field_options );
22
+		$this->add_field_support('link_to_post', $field_options);
23 23
 
24
-		$this->add_field_support('dynamic_data', $field_options );
24
+		$this->add_field_support('dynamic_data', $field_options);
25 25
 
26 26
 		return $field_options;
27 27
 	}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-website.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -7,18 +7,18 @@  discard block
 block discarded – undo
7 7
 
8 8
 	var $name = 'website';
9 9
 
10
-	var $search_operators = array( 'is', 'isnot', 'contains', 'starts_with', 'ends_with' );
10
+	var $search_operators = array('is', 'isnot', 'contains', 'starts_with', 'ends_with');
11 11
 
12 12
 	var $_gf_field_class_name = 'GF_Field_Website';
13 13
 
14 14
 	var $group = 'advanced';
15 15
 
16
-	function field_options( $field_options, $template_id = '', $field_id = '', $context = '', $input_type = '' ) {
16
+	function field_options($field_options, $template_id = '', $field_id = '', $context = '', $input_type = '') {
17 17
 
18 18
 		// It makes no sense to use this as the link.
19
-		unset( $field_options['show_as_link'] );
19
+		unset($field_options['show_as_link']);
20 20
 
21
-		if( 'edit' === $context ) {
21
+		if ('edit' === $context) {
22 22
 			return $field_options;
23 23
 		}
24 24
 
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
 		 */
28 28
 		$field_options['anchor_text'] = array(
29 29
 			'type' => 'text',
30
-			'label' => __( 'Link Text:', 'gravityview' ),
31
-			'desc' => __( 'Define custom link text. Leave blank to display the URL', 'gravityview' ),
30
+			'label' => __('Link Text:', 'gravityview'),
31
+			'desc' => __('Define custom link text. Leave blank to display the URL', 'gravityview'),
32 32
 			'value' => '',
33 33
 			'merge_tags' => 'force',
34 34
 		);
@@ -36,15 +36,15 @@  discard block
 block discarded – undo
36 36
 		$field_options['truncatelink'] = array(
37 37
 			'type' => 'checkbox',
38 38
 			'value' => true,
39
-			'label' => __( 'Shorten Link Display', 'gravityview' ),
40
-			'tooltip' => __( 'Only show the domain for a URL instead of the whole link.', 'gravityview' ),
41
-			'desc' => __( 'Don&rsquo;t show the full URL, only show the domain.', 'gravityview' )
39
+			'label' => __('Shorten Link Display', 'gravityview'),
40
+			'tooltip' => __('Only show the domain for a URL instead of the whole link.', 'gravityview'),
41
+			'desc' => __('Don&rsquo;t show the full URL, only show the domain.', 'gravityview')
42 42
 		);
43 43
 
44 44
 		$field_options['open_same_window'] = array(
45 45
 			'type' => 'checkbox',
46 46
 			'value' => false,
47
-			'label' => __( 'Open link in the same window?', 'gravityview' ),
47
+			'label' => __('Open link in the same window?', 'gravityview'),
48 48
 		);
49 49
 
50 50
 		return $field_options;
Please login to merge, or discard this patch.