Completed
Branch master (3ac4b1)
by Zack
04:30
created
templates/fields/fileupload.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -8,18 +8,18 @@  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
 $output = '';
14 14
 
15
-if( !empty( $value ) ){
15
+if (!empty($value)) {
16 16
 
17
-	$gv_class = gv_class( $field, $gravityview_view->getForm(), $entry );
17
+	$gv_class = gv_class($field, $gravityview_view->getForm(), $entry);
18 18
 
19
-	$output_arr = gravityview_get_files_array( $value, $gv_class );
19
+	$output_arr = gravityview_get_files_array($value, $gv_class);
20 20
 
21 21
 	// If the output array is just one item, let's not show a list.
22
-	if( sizeof( $output_arr ) === 1 ) {
22
+	if (sizeof($output_arr) === 1) {
23 23
 
24 24
 		$output = $output_arr[0]['content'];
25 25
 
@@ -29,17 +29,17 @@  discard block
 block discarded – undo
29 29
 	else {
30 30
 
31 31
 		// For each file, show as a list
32
-		foreach ( $output_arr as $key => $item) {
32
+		foreach ($output_arr as $key => $item) {
33 33
 
34 34
 			// Fix empty lists
35
-			if( empty( $item['content'] ) ) { continue; }
35
+			if (empty($item['content'])) { continue; }
36 36
 
37
-			$output .= '<li>' . $item['content'] . '</li>';
37
+			$output .= '<li>'.$item['content'].'</li>';
38 38
 		}
39 39
 
40
-		if( !empty( $output ) ) {
40
+		if (!empty($output)) {
41 41
 
42
-			$output = sprintf("<ul class='gv-field-file-uploads %s'>%s</ul>", $gv_class, $output );
42
+			$output = sprintf("<ul class='gv-field-file-uploads %s'>%s</ul>", $gv_class, $output);
43 43
 
44 44
 		}
45 45
 	}
Please login to merge, or discard this patch.
templates/fields/gquiz_grade.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,16 +11,16 @@
 block discarded – undo
11 11
 $field = $gravityview_view->getCurrentField();
12 12
 
13 13
 // If there's no grade, don't continue
14
-if( empty( $field['value'] ) ) {
14
+if (empty($field['value'])) {
15 15
 	return;
16 16
 }
17 17
 
18 18
 // Check if grading is enabled for the form. If not set, default to false.
19
-$grading_type_enabled = !empty( $field['form']['gravityformsquiz']['grading'] ) ? $field['form']['gravityformsquiz']['grading'] : 'none';
19
+$grading_type_enabled = !empty($field['form']['gravityformsquiz']['grading']) ? $field['form']['gravityformsquiz']['grading'] : 'none';
20 20
 
21
-if( 'letter' === $grading_type_enabled ) {
21
+if ('letter' === $grading_type_enabled) {
22 22
 	echo $field['value'];
23
-} elseif( GVCommon::has_cap( 'manage_options' ) ) {
24
-	$grade_type = __( 'Letter', 'gravityview' );
25
-	printf( esc_html_x( '%s grading is disabled for this form. %sChange the setting%s', '%s is the current Quiz field type ("Letter" or "Pass/Fail")', 'gravityview' ), $grade_type, '<a href="'. admin_url('admin.php?page=gf_edit_forms&amp;view=settings&amp;subview=gravityformsquiz&amp;id='.$gravityview_view->getFormId() ) . '">', '</a>' );
23
+} elseif (GVCommon::has_cap('manage_options')) {
24
+	$grade_type = __('Letter', 'gravityview');
25
+	printf(esc_html_x('%s grading is disabled for this form. %sChange the setting%s', '%s is the current Quiz field type ("Letter" or "Pass/Fail")', 'gravityview'), $grade_type, '<a href="'.admin_url('admin.php?page=gf_edit_forms&amp;view=settings&amp;subview=gravityformsquiz&amp;id='.$gravityview_view->getFormId()).'">', '</a>');
26 26
 }
Please login to merge, or discard this patch.
templates/fields/gquiz_is_pass.php 2 patches
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
- * Display Gravity Forms Quiz value Pass/Fail
4
- *
5
- * @package GravityView
6
- * @subpackage GravityView/templates/fields
7
- */
3
+	 * Display Gravity Forms Quiz value Pass/Fail
4
+	 *
5
+	 * @package GravityView
6
+	 * @subpackage GravityView/templates/fields
7
+	 */
8 8
 
9 9
 $gravityview_view = GravityView_View::getInstance();
10 10
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -11,19 +11,19 @@
 block discarded – undo
11 11
 $field = $gravityview_view->getCurrentField();
12 12
 
13 13
 // If there's no grade, don't continue
14
-if( empty( $field['value'] ) ) {
14
+if (empty($field['value'])) {
15 15
 	return;
16 16
 }
17 17
 
18 18
 // Check if grading is enabled for the form. If not set, default to false.
19
-$grading_type_enabled = !empty( $field['form']['gravityformsquiz']['grading'] ) ? $field['form']['gravityformsquiz']['grading'] : 'none';
19
+$grading_type_enabled = !empty($field['form']['gravityformsquiz']['grading']) ? $field['form']['gravityformsquiz']['grading'] : 'none';
20 20
 
21
-if( 'passfail' === $grading_type_enabled ) {
21
+if ('passfail' === $grading_type_enabled) {
22 22
 
23 23
 	// By default, the field value is "1" for Pass and "0" for Fail. We want the text.
24
-	echo GFCommon::replace_variables( '{quiz_passfail}', $gravityview_view->getForm(), $gravityview_view->getCurrentEntry() );
24
+	echo GFCommon::replace_variables('{quiz_passfail}', $gravityview_view->getForm(), $gravityview_view->getCurrentEntry());
25 25
 
26
-} elseif( GVCommon::has_cap( 'manage_options' ) ) {
27
-	$grade_type = __( 'Pass/Fail', 'gravityview' );
28
-	printf( esc_html_x( '%s grading is disabled for this form. %sChange the setting%s', '%s is the current Quiz field type ("Letter" or "Pass/Fail")', 'gravityview' ), $grade_type, '<a href="'. admin_url('admin.php?page=gf_edit_forms&amp;view=settings&amp;subview=gravityformsquiz&amp;id='.$gravityview_view->getFormId() ) . '">', '</a>' );
26
+} elseif (GVCommon::has_cap('manage_options')) {
27
+	$grade_type = __('Pass/Fail', 'gravityview');
28
+	printf(esc_html_x('%s grading is disabled for this form. %sChange the setting%s', '%s is the current Quiz field type ("Letter" or "Pass/Fail")', 'gravityview'), $grade_type, '<a href="'.admin_url('admin.php?page=gf_edit_forms&amp;view=settings&amp;subview=gravityformsquiz&amp;id='.$gravityview_view->getFormId()).'">', '</a>');
29 29
 }
Please login to merge, or discard this patch.
templates/fields/gquiz_percent.php 2 patches
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
- * Display Gravity Forms Quiz value Pass/Fail
4
- *
5
- * @package GravityView
6
- * @subpackage GravityView/templates/fields
7
- */
3
+	 * Display Gravity Forms Quiz value Pass/Fail
4
+	 *
5
+	 * @package GravityView
6
+	 * @subpackage GravityView/templates/fields
7
+	 */
8 8
 
9 9
 $field = GravityView_View::getInstance()->getCurrentField();
10 10
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 $field = GravityView_View::getInstance()->getCurrentField();
10 10
 
11 11
 // If there's no grade, don't continue
12
-if( empty( $field['value'] ) ) {
12
+if (empty($field['value'])) {
13 13
 	return;
14 14
 }
15 15
 
@@ -24,4 +24,4 @@  discard block
 block discarded – undo
24 24
  */
25 25
 $format = apply_filters('gravityview/field/quiz_percent/format', '%d%%');
26 26
 
27
-printf( $format, $field['value'] );
28 27
\ No newline at end of file
28
+printf($format, $field['value']);
29 29
\ No newline at end of file
Please login to merge, or discard this patch.
templates/fields/gquiz_score.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,15 +11,15 @@
 block discarded – undo
11 11
 $field = $gravityview_view->getCurrentField();
12 12
 
13 13
 // If there's no grade, don't continue
14
-if( empty( $field['value'] ) ) {
14
+if (empty($field['value'])) {
15 15
 	return;
16 16
 }
17 17
 
18
-if( class_exists('GFQuiz') && $gravityview_view->getCurrentFieldSetting('quiz_use_max_score') ) {
18
+if (class_exists('GFQuiz') && $gravityview_view->getCurrentFieldSetting('quiz_use_max_score')) {
19 19
 
20
-	$max_score = GFQuiz::get_instance()->get_max_score( $gravityview_view->getForm() );
20
+	$max_score = GFQuiz::get_instance()->get_max_score($gravityview_view->getForm());
21 21
 
22
-	printf( '%d/%d', $field['value'], $max_score );
22
+	printf('%d/%d', $field['value'], $max_score);
23 23
 
24 24
 } else {
25 25
 
Please login to merge, or discard this patch.
templates/fields/html.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@
 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
 // Tell the renderer not to wrap this field in an anchor tag.
14 14
 $gravityview_view->setCurrentFieldSetting('show_as_link', false);
15 15
 
16
-echo GravityView_API::replace_variables( $field['content'], $form, $entry );
16
+echo GravityView_API::replace_variables($field['content'], $form, $entry);
Please login to merge, or discard this patch.
templates/fields/is_fulfilled.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@
 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
-if( empty( $value ) ) {
13
+if (empty($value)) {
14 14
 	echo __('Not Fulfilled', 'gravityview');
15 15
 } else {
16 16
 	echo __('Fulfilled', 'gravityview');
Please login to merge, or discard this patch.
templates/fields/list.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Display the list field type
4
- *
5
- * @todo Confirm it works with http://gravitywiz.com/use-list-field-choices-gravity-forms/
6
- * @package GravityView
7
- * @subpackage GravityView/templates/fields
8
- * @global GF_Field_List $field
9
- * @global string $field_id ID of the field
10
- * @global string $value Gravity Forms serializes the list field values
11
- * @global string $display_value Field output HTML. For list fields with columns, it's a table. Otherwise, an unordered list
12
- */
3
+	 * Display the list field type
4
+	 *
5
+	 * @todo Confirm it works with http://gravitywiz.com/use-list-field-choices-gravity-forms/
6
+	 * @package GravityView
7
+	 * @subpackage GravityView/templates/fields
8
+	 * @global GF_Field_List $field
9
+	 * @global string $field_id ID of the field
10
+	 * @global string $value Gravity Forms serializes the list field values
11
+	 * @global string $display_value Field output HTML. For list fields with columns, it's a table. Otherwise, an unordered list
12
+	 */
13 13
 
14 14
 $gravityview_view = GravityView_View::getInstance();
15 15
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,20 +13,20 @@
 block discarded – undo
13 13
 
14 14
 $gravityview_view = GravityView_View::getInstance();
15 15
 
16
-extract( $gravityview_view->getCurrentField() );
16
+extract($gravityview_view->getCurrentField());
17 17
 
18
-$field_id_array = explode( '.', $field_id );
18
+$field_id_array = explode('.', $field_id);
19 19
 
20
-if( $field->enableColumns && isset( $field_id_array[1] ) ) {
20
+if ($field->enableColumns && isset($field_id_array[1])) {
21 21
 
22 22
 	/**
23 23
 	 * @filter `gravityview/fields/list/column-format` Format of single list column output of a List field with Multiple Columns enabled
24 24
 	 * @since 1.14
25 25
 	 * @param string $format `html` (for <ul> list), `text` (for CSV output)
26 26
 	 */
27
-	$format = apply_filters( 'gravityview/fields/list/column-format', 'html' );
27
+	$format = apply_filters('gravityview/fields/list/column-format', 'html');
28 28
 
29
-	echo GravityView_Field_List::column_value( $field, $value, intval( $field_id_array[1] ), $format );
29
+	echo GravityView_Field_List::column_value($field, $value, intval($field_id_array[1]), $format);
30 30
 
31 31
 } else {
32 32
 	echo $display_value;
Please login to merge, or discard this patch.
templates/fields/name.php 2 patches
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
- * Display the name field type
4
- *
5
- * @package GravityView
6
- * @subpackage GravityView/templates/fields
7
- */
3
+	 * Display the name field type
4
+	 *
5
+	 * @package GravityView
6
+	 * @subpackage GravityView/templates/fields
7
+	 */
8 8
 
9 9
 $gravityview_view = GravityView_View::getInstance();
10 10
 
Please login to merge, or discard this 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.