Completed
Push — develop ( fc0354...e2ac27 )
by Zack
11:27 queued 07:24
created
includes/fields/class-gravityview-field-html.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,18 +7,18 @@
 block discarded – undo
7 7
 
8 8
 	var $name = 'html';
9 9
 
10
-	var $search_operators = array( 'contains', 'is', 'isnot', 'starts_with', 'ends_with' );
10
+	var $search_operators = array('contains', 'is', 'isnot', 'starts_with', 'ends_with');
11 11
 
12 12
 	var $label = 'HTML';
13 13
 
14 14
 	public function __construct() {
15
-		$this->label = esc_attr__( 'HTML', 'gravityview' );
15
+		$this->label = esc_attr__('HTML', '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
-		unset ( $field_options['search_filter'], $field_options['show_as_link'] );
21
+		unset ($field_options['search_filter'], $field_options['show_as_link']);
22 22
 
23 23
 		return $field_options;
24 24
 	}
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-multiselect.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,14 +4,14 @@
 block discarded – undo
4 4
 
5 5
 	var $name = 'multiselect';
6 6
 
7
-	var $search_operators = array( 'is', 'in', 'not in', 'isnot', 'contains');
7
+	var $search_operators = array('is', 'in', 'not in', 'isnot', 'contains');
8 8
 
9 9
 	var $_gf_field_class_name = 'GF_Field_MultiSelect';
10 10
 
11 11
 	var $label = 'Multi Select';
12 12
 
13 13
 	public function __construct() {
14
-		$this->label = esc_attr__( 'Multi Select', 'gravityview' );
14
+		$this->label = esc_attr__('Multi Select', 'gravityview');
15 15
 		parent::__construct();
16 16
 	}
17 17
 }
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-name.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 	var $group = 'advanced';
12 12
 
13 13
 	public function __construct() {
14
-		$this->label = esc_attr__( 'Name', 'gravityview' );
14
+		$this->label = esc_attr__('Name', 'gravityview');
15 15
 		parent::__construct();
16 16
 	}
17 17
 }
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-number.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,27 +9,27 @@
 block discarded – undo
9 9
 
10 10
 	var $name = 'number';
11 11
 
12
-	var $search_operators = array( 'is', 'isnot', 'greater_than', 'less_than' );
12
+	var $search_operators = array('is', 'isnot', 'greater_than', 'less_than');
13 13
 
14 14
 	var $label = 'Number';
15 15
 
16 16
 	public function __construct() {
17
-		$this->label = esc_attr__( 'Number', 'gravityview' );
17
+		$this->label = esc_attr__('Number', 'gravityview');
18 18
 		parent::__construct();
19 19
 	}
20 20
 
21
-	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
21
+	function field_options($field_options, $template_id, $field_id, $context, $input_type) {
22 22
 
23 23
 		$field_options['number_format'] = array(
24 24
 			'type' => 'checkbox',
25
-			'label' => __( 'Format number?', 'gravityview' ),
25
+			'label' => __('Format number?', 'gravityview'),
26 26
 			'desc' => __('Display numbers with thousands separators.', 'gravityview'),
27 27
 			'value' => false,
28 28
 		);
29 29
 
30 30
 		$field_options['decimals'] = array(
31 31
 			'type' => 'number',
32
-			'label' => __( 'Decimals', 'gravityview' ),
32
+			'label' => __('Decimals', 'gravityview'),
33 33
 			'desc' => __('Precision of the number of decimal places. Leave blank to use existing precision.', 'gravityview'),
34 34
 			'value' => '',
35 35
 			'merge_tags' => false,
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-other-entries.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	var $group = 'gravityview';
15 15
 
16 16
 	public function __construct() {
17
-		$this->label = esc_attr__( 'Other Entries', 'gravityview' );
17
+		$this->label = esc_attr__('Other Entries', 'gravityview');
18 18
 		$this->description = __('Display other entries created by the entry creator.', 'gravityview');
19 19
 		parent::__construct();
20 20
 	}
@@ -23,27 +23,27 @@  discard block
 block discarded – undo
23 23
 	 * @inheritDoc
24 24
 	 * @since 1.7.2
25 25
 	 */
26
-	function field_options( $field_options, $template_id, $field_id, $context, $input_type ) {
26
+	function field_options($field_options, $template_id, $field_id, $context, $input_type) {
27 27
 
28
-		if( 'edit' === $context ) {
28
+		if ('edit' === $context) {
29 29
 			return $field_options;
30 30
 		}
31 31
 
32 32
 		// No "Link to single entry"; all the items will be links to entries!
33
-		unset( $field_options['show_as_link'] );
33
+		unset($field_options['show_as_link']);
34 34
 
35 35
 		$new_options = array();
36 36
 
37 37
 		$new_options['link_format'] = array(
38 38
 			'type'  => 'text',
39
-			'label' => __( 'Entry link text (required)', 'gravityview' ),
39
+			'label' => __('Entry link text (required)', 'gravityview'),
40 40
 			'value' => __('Entry #{entry_id}', 'gravityview'),
41 41
 			'merge_tags' => 'force',
42 42
 		);
43 43
 
44 44
 		$new_options['after_link'] = array(
45 45
 			'type'  => 'textarea',
46
-			'label' => __( 'Text or HTML to display after the link (optional)', 'gravityview' ),
46
+			'label' => __('Text or HTML to display after the link (optional)', 'gravityview'),
47 47
 			'desc'  => __('This content will be displayed below each entry link.', 'gravityview'),
48 48
 			'value' => '',
49 49
 			'merge_tags' => 'force',
@@ -52,24 +52,24 @@  discard block
 block discarded – undo
52 52
 
53 53
 		$new_options['page_size'] = array(
54 54
 			'type'  => 'number',
55
-			'label' => __( 'Entries to Display', 'gravityview' ),
56
-			'desc'  => __( 'What is the maximum number of entries that should be shown?', 'gravityview' ),
55
+			'label' => __('Entries to Display', 'gravityview'),
56
+			'desc'  => __('What is the maximum number of entries that should be shown?', 'gravityview'),
57 57
 			'value' => '10',
58 58
 			'merge_tags' => false,
59 59
 		);
60 60
 
61 61
 		$new_options['no_entries_hide'] = array(
62 62
 			'type'  => 'checkbox',
63
-			'label' => __( 'Hide if no entries', 'gravityview' ),
64
-			'desc'  => __( 'Don\'t display this field if the entry creator has no other entries', 'gravityview' ),
63
+			'label' => __('Hide if no entries', 'gravityview'),
64
+			'desc'  => __('Don\'t display this field if the entry creator has no other entries', 'gravityview'),
65 65
 			'value' => false,
66 66
 		);
67 67
 
68 68
 		$new_options['no_entries_text'] = array(
69 69
 			'type'  => 'text',
70
-			'label' => __( 'No Entries Text', 'gravityview' ),
71
-			'desc'  => __( 'The text that is shown if the entry creator has no other entries (and "Hide if no entries" is disabled).', 'gravityview' ),
72
-			'value' => __( 'This user has no other entries.', 'gravityview' ),
70
+			'label' => __('No Entries Text', 'gravityview'),
71
+			'desc'  => __('The text that is shown if the entry creator has no other entries (and "Hide if no entries" is disabled).', 'gravityview'),
72
+			'value' => __('This user has no other entries.', 'gravityview'),
73 73
 		);
74 74
 
75 75
 		return $new_options + $field_options;
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-page.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 	var $label = 'Page';
12 12
 
13 13
 	public function __construct() {
14
-		$this->label = esc_attr__( 'Page', 'gravityview' );
14
+		$this->label = esc_attr__('Page', 'gravityview');
15 15
 		parent::__construct();
16 16
 	}
17 17
 }
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-password.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 	var $label = 'Password';
12 12
 
13 13
 	public function __construct() {
14
-		$this->label = esc_attr__( 'Password', 'gravityview' );
14
+		$this->label = esc_attr__('Password', 'gravityview');
15 15
 		parent::__construct();
16 16
 	}
17 17
 }
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-phone.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 	var $label = 'Phone';
14 14
 
15 15
 	public function __construct() {
16
-		$this->label = esc_attr__( 'Phone', 'gravityview' );
16
+		$this->label = esc_attr__('Phone', 'gravityview');
17 17
 		parent::__construct();
18 18
 	}
19 19
 }
Please login to merge, or discard this patch.