@@ -255,7 +255,6 @@ |
||
| 255 | 255 | * Get the default date format for a field based on the field ID and the time format setting |
| 256 | 256 | * |
| 257 | 257 | * @since 1.14 |
| 258 | - |
|
| 259 | 258 | * @param string $time_format The time format ("12" or "24"). Default: "12" {@since 1.14} |
| 260 | 259 | * @param int $field_id The ID of the field. Used to figure out full time/hours/minutes/am/pm {@since 1.14} |
| 261 | 260 | * |
@@ -40,11 +40,11 @@ |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | $field_options['link_phone'] = array( |
| 43 | - 'type' => 'checkbox', |
|
| 44 | - 'label' => __( 'Make Phone Number Clickable', 'gravityview' ), |
|
| 45 | - 'desc' => __( 'Allow dialing a number by clicking it?', 'gravityview'), |
|
| 46 | - 'value' => true, |
|
| 47 | - ); |
|
| 43 | + 'type' => 'checkbox', |
|
| 44 | + 'label' => __( 'Make Phone Number Clickable', 'gravityview' ), |
|
| 45 | + 'desc' => __( 'Allow dialing a number by clicking it?', 'gravityview'), |
|
| 46 | + 'value' => true, |
|
| 47 | + ); |
|
| 48 | 48 | |
| 49 | 49 | return $field_options; |
| 50 | 50 | } |
@@ -10,160 +10,160 @@ discard block |
||
| 10 | 10 | * |
| 11 | 11 | * @var string |
| 12 | 12 | */ |
| 13 | - protected $name; |
|
| 13 | + protected $name; |
|
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * Field settings |
| 17 | 17 | * |
| 18 | 18 | * @var array |
| 19 | 19 | */ |
| 20 | - protected $field; |
|
| 20 | + protected $field; |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * Field current value |
| 24 | 24 | * |
| 25 | 25 | * @var mixed |
| 26 | 26 | */ |
| 27 | - protected $value; |
|
| 28 | - |
|
| 29 | - function __construct( $name = '', $field = array(), $curr_value = NULL ) { |
|
| 30 | - |
|
| 31 | - $this->name = $name; |
|
| 32 | - |
|
| 33 | - $defaults = self::get_field_defaults(); |
|
| 34 | - |
|
| 35 | - // Backward compatibility |
|
| 36 | - if( !empty( $field['choices'] ) ) { |
|
| 37 | - $field['options'] = $field['choices']; |
|
| 38 | - unset( $field['choices'] ); |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - $this->field = wp_parse_args( $field, $defaults ); |
|
| 42 | - |
|
| 43 | - $this->value = is_null( $curr_value ) ? $this->field['value'] : $curr_value; |
|
| 44 | - |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - /** |
|
| 48 | - * Returns the default details for a field option |
|
| 49 | - * |
|
| 50 | - * - default // default option value, in case nothing is defined (@deprecated) |
|
| 51 | - * - desc // option description |
|
| 52 | - * - value // the option default value |
|
| 53 | - * - label // the option label |
|
| 54 | - * - left_label // In case of checkboxes, left label will appear on the left of the checkbox |
|
| 55 | - * - id // the field id |
|
| 56 | - * - type // the option type ( text, checkbox, select, ... ) |
|
| 57 | - * - options // when type is select, define the select options ('choices' is @deprecated) |
|
| 58 | - * - merge_tags // if the option supports merge tags feature |
|
| 59 | - * - class // (new) define extra classes for the field |
|
| 60 | - * - tooltip // |
|
| 61 | - * |
|
| 62 | - * @return array |
|
| 63 | - */ |
|
| 64 | - public static function get_field_defaults() { |
|
| 65 | - return array( |
|
| 66 | - 'desc' => '', |
|
| 67 | - 'value' => NULL, |
|
| 68 | - 'label' => '', |
|
| 69 | - 'left_label' => NULL, |
|
| 70 | - 'id' => NULL, |
|
| 71 | - 'type' => 'text', |
|
| 72 | - 'options' => NULL, |
|
| 73 | - 'merge_tags' => true, |
|
| 74 | - 'class' => '', |
|
| 75 | - 'tooltip' => NULL, |
|
| 76 | - 'requires' => NULL |
|
| 77 | - ); |
|
| 78 | - } |
|
| 79 | - |
|
| 80 | - |
|
| 81 | - function get_tooltip() { |
|
| 82 | - if( !function_exists('gform_tooltip') ) { |
|
| 83 | - return NULL; |
|
| 84 | - } |
|
| 85 | - |
|
| 86 | - return !empty( $this->field['tooltip'] ) ? ' '.gform_tooltip( $this->field['tooltip'] , false, true ) : NULL; |
|
| 87 | - } |
|
| 88 | - |
|
| 89 | - /** |
|
| 90 | - * Build input id based on the name |
|
| 91 | - * @return string |
|
| 92 | - */ |
|
| 93 | - function get_field_id() { |
|
| 94 | - if( isset( $this->field['id'] ) ) { |
|
| 95 | - return esc_attr( $this->field['id'] ); |
|
| 96 | - } |
|
| 97 | - return esc_attr( sanitize_html_class( $this->name ) ); |
|
| 98 | - } |
|
| 99 | - |
|
| 100 | - /** |
|
| 101 | - * Retrieve field label |
|
| 102 | - * @return string |
|
| 103 | - */ |
|
| 104 | - function get_field_label() { |
|
| 105 | - return esc_html( trim( $this->field['label'] ) ); |
|
| 106 | - } |
|
| 27 | + protected $value; |
|
| 28 | + |
|
| 29 | + function __construct( $name = '', $field = array(), $curr_value = NULL ) { |
|
| 30 | + |
|
| 31 | + $this->name = $name; |
|
| 32 | + |
|
| 33 | + $defaults = self::get_field_defaults(); |
|
| 34 | + |
|
| 35 | + // Backward compatibility |
|
| 36 | + if( !empty( $field['choices'] ) ) { |
|
| 37 | + $field['options'] = $field['choices']; |
|
| 38 | + unset( $field['choices'] ); |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + $this->field = wp_parse_args( $field, $defaults ); |
|
| 42 | + |
|
| 43 | + $this->value = is_null( $curr_value ) ? $this->field['value'] : $curr_value; |
|
| 44 | + |
|
| 45 | + } |
|
| 46 | + |
|
| 47 | + /** |
|
| 48 | + * Returns the default details for a field option |
|
| 49 | + * |
|
| 50 | + * - default // default option value, in case nothing is defined (@deprecated) |
|
| 51 | + * - desc // option description |
|
| 52 | + * - value // the option default value |
|
| 53 | + * - label // the option label |
|
| 54 | + * - left_label // In case of checkboxes, left label will appear on the left of the checkbox |
|
| 55 | + * - id // the field id |
|
| 56 | + * - type // the option type ( text, checkbox, select, ... ) |
|
| 57 | + * - options // when type is select, define the select options ('choices' is @deprecated) |
|
| 58 | + * - merge_tags // if the option supports merge tags feature |
|
| 59 | + * - class // (new) define extra classes for the field |
|
| 60 | + * - tooltip // |
|
| 61 | + * |
|
| 62 | + * @return array |
|
| 63 | + */ |
|
| 64 | + public static function get_field_defaults() { |
|
| 65 | + return array( |
|
| 66 | + 'desc' => '', |
|
| 67 | + 'value' => NULL, |
|
| 68 | + 'label' => '', |
|
| 69 | + 'left_label' => NULL, |
|
| 70 | + 'id' => NULL, |
|
| 71 | + 'type' => 'text', |
|
| 72 | + 'options' => NULL, |
|
| 73 | + 'merge_tags' => true, |
|
| 74 | + 'class' => '', |
|
| 75 | + 'tooltip' => NULL, |
|
| 76 | + 'requires' => NULL |
|
| 77 | + ); |
|
| 78 | + } |
|
| 79 | + |
|
| 80 | + |
|
| 81 | + function get_tooltip() { |
|
| 82 | + if( !function_exists('gform_tooltip') ) { |
|
| 83 | + return NULL; |
|
| 84 | + } |
|
| 85 | + |
|
| 86 | + return !empty( $this->field['tooltip'] ) ? ' '.gform_tooltip( $this->field['tooltip'] , false, true ) : NULL; |
|
| 87 | + } |
|
| 88 | + |
|
| 89 | + /** |
|
| 90 | + * Build input id based on the name |
|
| 91 | + * @return string |
|
| 92 | + */ |
|
| 93 | + function get_field_id() { |
|
| 94 | + if( isset( $this->field['id'] ) ) { |
|
| 95 | + return esc_attr( $this->field['id'] ); |
|
| 96 | + } |
|
| 97 | + return esc_attr( sanitize_html_class( $this->name ) ); |
|
| 98 | + } |
|
| 99 | + |
|
| 100 | + /** |
|
| 101 | + * Retrieve field label |
|
| 102 | + * @return string |
|
| 103 | + */ |
|
| 104 | + function get_field_label() { |
|
| 105 | + return esc_html( trim( $this->field['label'] ) ); |
|
| 106 | + } |
|
| 107 | 107 | |
| 108 | 108 | /** |
| 109 | 109 | * Retrieve field left label |
| 110 | - * |
|
| 111 | - * @since 1.7 |
|
| 112 | - * |
|
| 110 | + * |
|
| 111 | + * @since 1.7 |
|
| 112 | + * |
|
| 113 | 113 | * @return string |
| 114 | 114 | */ |
| 115 | 115 | function get_field_left_label() { |
| 116 | 116 | return ! empty( $this->field['left_label'] ) ? esc_html( trim( $this->field['left_label'] ) ) : NULL; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - /** |
|
| 120 | - * Retrieve field label class |
|
| 121 | - * @return string |
|
| 122 | - */ |
|
| 123 | - function get_label_class() { |
|
| 124 | - return 'gv-label-'. sanitize_html_class( $this->field['type'] ); |
|
| 125 | - } |
|
| 126 | - |
|
| 127 | - |
|
| 128 | - /** |
|
| 129 | - * Retrieve field description |
|
| 130 | - * @return string |
|
| 131 | - */ |
|
| 132 | - function get_field_desc() { |
|
| 133 | - return !empty( $this->field['desc'] ) ? '<span class="howto">'. $this->field['desc'] .'</span>' : ''; |
|
| 134 | - } |
|
| 135 | - |
|
| 136 | - |
|
| 137 | - /** |
|
| 138 | - * Verify if field should have merge tags |
|
| 139 | - * @return boolean |
|
| 140 | - */ |
|
| 141 | - function show_merge_tags() { |
|
| 142 | - // Show the merge tags if the field is a list view |
|
| 143 | - $is_list = preg_match( '/_list-/ism', $this->name ); |
|
| 144 | - // Or is a single entry view |
|
| 145 | - $is_single = preg_match( '/single_/ism', $this->name ); |
|
| 146 | - |
|
| 147 | - return ( $is_single || $is_list ); |
|
| 148 | - } |
|
| 149 | - |
|
| 150 | - |
|
| 151 | - |
|
| 152 | - /** |
|
| 153 | - * important! Override this class |
|
| 154 | - * outputs the field option html |
|
| 155 | - */ |
|
| 156 | - function render_option() { |
|
| 157 | - // to replace on each field |
|
| 158 | - } |
|
| 159 | - |
|
| 160 | - /** |
|
| 161 | - * important! Override this class if needed |
|
| 162 | - * outputs the field setting html |
|
| 163 | - */ |
|
| 164 | - function render_setting( $override_input = NULL ) { |
|
| 165 | - |
|
| 166 | - if( !empty( $this->field['full_width'] ) ) { ?> |
|
| 119 | + /** |
|
| 120 | + * Retrieve field label class |
|
| 121 | + * @return string |
|
| 122 | + */ |
|
| 123 | + function get_label_class() { |
|
| 124 | + return 'gv-label-'. sanitize_html_class( $this->field['type'] ); |
|
| 125 | + } |
|
| 126 | + |
|
| 127 | + |
|
| 128 | + /** |
|
| 129 | + * Retrieve field description |
|
| 130 | + * @return string |
|
| 131 | + */ |
|
| 132 | + function get_field_desc() { |
|
| 133 | + return !empty( $this->field['desc'] ) ? '<span class="howto">'. $this->field['desc'] .'</span>' : ''; |
|
| 134 | + } |
|
| 135 | + |
|
| 136 | + |
|
| 137 | + /** |
|
| 138 | + * Verify if field should have merge tags |
|
| 139 | + * @return boolean |
|
| 140 | + */ |
|
| 141 | + function show_merge_tags() { |
|
| 142 | + // Show the merge tags if the field is a list view |
|
| 143 | + $is_list = preg_match( '/_list-/ism', $this->name ); |
|
| 144 | + // Or is a single entry view |
|
| 145 | + $is_single = preg_match( '/single_/ism', $this->name ); |
|
| 146 | + |
|
| 147 | + return ( $is_single || $is_list ); |
|
| 148 | + } |
|
| 149 | + |
|
| 150 | + |
|
| 151 | + |
|
| 152 | + /** |
|
| 153 | + * important! Override this class |
|
| 154 | + * outputs the field option html |
|
| 155 | + */ |
|
| 156 | + function render_option() { |
|
| 157 | + // to replace on each field |
|
| 158 | + } |
|
| 159 | + |
|
| 160 | + /** |
|
| 161 | + * important! Override this class if needed |
|
| 162 | + * outputs the field setting html |
|
| 163 | + */ |
|
| 164 | + function render_setting( $override_input = NULL ) { |
|
| 165 | + |
|
| 166 | + if( !empty( $this->field['full_width'] ) ) { ?> |
|
| 167 | 167 | <th scope="row" colspan="2"> |
| 168 | 168 | <div> |
| 169 | 169 | <label for="<?php echo $this->get_field_id(); ?>"> |
@@ -183,14 +183,14 @@ discard block |
||
| 183 | 183 | </td> |
| 184 | 184 | <?php } |
| 185 | 185 | |
| 186 | - } |
|
| 186 | + } |
|
| 187 | 187 | |
| 188 | - /** |
|
| 189 | - * important! Override this class |
|
| 190 | - * outputs the input html part |
|
| 191 | - */ |
|
| 192 | - function render_input( $override_input ) { |
|
| 193 | - echo ''; |
|
| 194 | - } |
|
| 188 | + /** |
|
| 189 | + * important! Override this class |
|
| 190 | + * outputs the input html part |
|
| 191 | + */ |
|
| 192 | + function render_input( $override_input ) { |
|
| 193 | + echo ''; |
|
| 194 | + } |
|
| 195 | 195 | |
| 196 | 196 | } |
@@ -40,7 +40,6 @@ |
||
| 40 | 40 | * Get the default date format for a field based on the field ID and the time format setting |
| 41 | 41 | * |
| 42 | 42 | * @since 1.16.4 |
| 43 | - |
|
| 44 | 43 | * @param string $date_format The Gravity Forms date format for the field. Default: "mdy" |
| 45 | 44 | * @param int $field_id The ID of the field. Used to figure out full date/day/month/year |
| 46 | 45 | * |
@@ -10,14 +10,14 @@ discard block |
||
| 10 | 10 | * Describes log levels. |
| 11 | 11 | */ |
| 12 | 12 | class LogLevel { |
| 13 | - const EMERGENCY = 'emergency'; |
|
| 14 | - const ALERT = 'alert'; |
|
| 15 | - const CRITICAL = 'critical'; |
|
| 16 | - const ERROR = 'error'; |
|
| 17 | - const WARNING = 'warning'; |
|
| 18 | - const NOTICE = 'notice'; |
|
| 19 | - const INFO = 'info'; |
|
| 20 | - const DEBUG = 'debug'; |
|
| 13 | + const EMERGENCY = 'emergency'; |
|
| 14 | + const ALERT = 'alert'; |
|
| 15 | + const CRITICAL = 'critical'; |
|
| 16 | + const ERROR = 'error'; |
|
| 17 | + const WARNING = 'warning'; |
|
| 18 | + const NOTICE = 'notice'; |
|
| 19 | + const INFO = 'info'; |
|
| 20 | + const DEBUG = 'debug'; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -28,127 +28,127 @@ discard block |
||
| 28 | 28 | * @see https://github.com/php-fig/log/blob/master/Psr/Log/AbstractLogger.php |
| 29 | 29 | */ |
| 30 | 30 | abstract class Logger /** @todo extends Psr\Log\AbstractLogger */ { |
| 31 | - /** |
|
| 32 | - * System is unusable. |
|
| 33 | - * |
|
| 34 | - * @param string $message |
|
| 35 | - * @param array $context |
|
| 36 | - * |
|
| 37 | - * @return void |
|
| 38 | - */ |
|
| 39 | - public function emergency($message, array $context = array()) |
|
| 40 | - { |
|
| 41 | - $this->log(LogLevel::EMERGENCY, $message, $context); |
|
| 42 | - } |
|
| 31 | + /** |
|
| 32 | + * System is unusable. |
|
| 33 | + * |
|
| 34 | + * @param string $message |
|
| 35 | + * @param array $context |
|
| 36 | + * |
|
| 37 | + * @return void |
|
| 38 | + */ |
|
| 39 | + public function emergency($message, array $context = array()) |
|
| 40 | + { |
|
| 41 | + $this->log(LogLevel::EMERGENCY, $message, $context); |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * Action must be taken immediately. |
|
| 46 | - * |
|
| 47 | - * Example: Entire website down, database unavailable, etc. This should |
|
| 48 | - * trigger the SMS alerts and wake you up. |
|
| 49 | - * |
|
| 50 | - * @param string $message |
|
| 51 | - * @param array $context |
|
| 52 | - * |
|
| 53 | - * @return void |
|
| 54 | - */ |
|
| 55 | - public function alert($message, array $context = array()) |
|
| 56 | - { |
|
| 57 | - $this->log(LogLevel::ALERT, $message, $context); |
|
| 58 | - } |
|
| 44 | + /** |
|
| 45 | + * Action must be taken immediately. |
|
| 46 | + * |
|
| 47 | + * Example: Entire website down, database unavailable, etc. This should |
|
| 48 | + * trigger the SMS alerts and wake you up. |
|
| 49 | + * |
|
| 50 | + * @param string $message |
|
| 51 | + * @param array $context |
|
| 52 | + * |
|
| 53 | + * @return void |
|
| 54 | + */ |
|
| 55 | + public function alert($message, array $context = array()) |
|
| 56 | + { |
|
| 57 | + $this->log(LogLevel::ALERT, $message, $context); |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * Critical conditions. |
|
| 62 | - * |
|
| 63 | - * Example: Application component unavailable, unexpected exception. |
|
| 64 | - * |
|
| 65 | - * @param string $message |
|
| 66 | - * @param array $context |
|
| 67 | - * |
|
| 68 | - * @return void |
|
| 69 | - */ |
|
| 70 | - public function critical($message, array $context = array()) |
|
| 71 | - { |
|
| 72 | - $this->log(LogLevel::CRITICAL, $message, $context); |
|
| 73 | - } |
|
| 60 | + /** |
|
| 61 | + * Critical conditions. |
|
| 62 | + * |
|
| 63 | + * Example: Application component unavailable, unexpected exception. |
|
| 64 | + * |
|
| 65 | + * @param string $message |
|
| 66 | + * @param array $context |
|
| 67 | + * |
|
| 68 | + * @return void |
|
| 69 | + */ |
|
| 70 | + public function critical($message, array $context = array()) |
|
| 71 | + { |
|
| 72 | + $this->log(LogLevel::CRITICAL, $message, $context); |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | - /** |
|
| 76 | - * Runtime errors that do not require immediate action but should typically |
|
| 77 | - * be logged and monitored. |
|
| 78 | - * |
|
| 79 | - * @param string $message |
|
| 80 | - * @param array $context |
|
| 81 | - * |
|
| 82 | - * @return void |
|
| 83 | - */ |
|
| 84 | - public function error($message, array $context = array()) |
|
| 85 | - { |
|
| 86 | - $this->log(LogLevel::ERROR, $message, $context); |
|
| 87 | - } |
|
| 75 | + /** |
|
| 76 | + * Runtime errors that do not require immediate action but should typically |
|
| 77 | + * be logged and monitored. |
|
| 78 | + * |
|
| 79 | + * @param string $message |
|
| 80 | + * @param array $context |
|
| 81 | + * |
|
| 82 | + * @return void |
|
| 83 | + */ |
|
| 84 | + public function error($message, array $context = array()) |
|
| 85 | + { |
|
| 86 | + $this->log(LogLevel::ERROR, $message, $context); |
|
| 87 | + } |
|
| 88 | 88 | |
| 89 | - /** |
|
| 90 | - * Exceptional occurrences that are not errors. |
|
| 91 | - * |
|
| 92 | - * Example: Use of deprecated APIs, poor use of an API, undesirable things |
|
| 93 | - * that are not necessarily wrong. |
|
| 94 | - * |
|
| 95 | - * @param string $message |
|
| 96 | - * @param array $context |
|
| 97 | - * |
|
| 98 | - * @return void |
|
| 99 | - */ |
|
| 100 | - public function warning($message, array $context = array()) |
|
| 101 | - { |
|
| 102 | - $this->log(LogLevel::WARNING, $message, $context); |
|
| 103 | - } |
|
| 89 | + /** |
|
| 90 | + * Exceptional occurrences that are not errors. |
|
| 91 | + * |
|
| 92 | + * Example: Use of deprecated APIs, poor use of an API, undesirable things |
|
| 93 | + * that are not necessarily wrong. |
|
| 94 | + * |
|
| 95 | + * @param string $message |
|
| 96 | + * @param array $context |
|
| 97 | + * |
|
| 98 | + * @return void |
|
| 99 | + */ |
|
| 100 | + public function warning($message, array $context = array()) |
|
| 101 | + { |
|
| 102 | + $this->log(LogLevel::WARNING, $message, $context); |
|
| 103 | + } |
|
| 104 | 104 | |
| 105 | - /** |
|
| 106 | - * Normal but significant events. |
|
| 107 | - * |
|
| 108 | - * @param string $message |
|
| 109 | - * @param array $context |
|
| 110 | - * |
|
| 111 | - * @return void |
|
| 112 | - */ |
|
| 113 | - public function notice($message, array $context = array()) |
|
| 114 | - { |
|
| 115 | - $this->log(LogLevel::NOTICE, $message, $context); |
|
| 116 | - } |
|
| 105 | + /** |
|
| 106 | + * Normal but significant events. |
|
| 107 | + * |
|
| 108 | + * @param string $message |
|
| 109 | + * @param array $context |
|
| 110 | + * |
|
| 111 | + * @return void |
|
| 112 | + */ |
|
| 113 | + public function notice($message, array $context = array()) |
|
| 114 | + { |
|
| 115 | + $this->log(LogLevel::NOTICE, $message, $context); |
|
| 116 | + } |
|
| 117 | 117 | |
| 118 | - /** |
|
| 119 | - * Interesting events. |
|
| 120 | - * |
|
| 121 | - * Example: User logs in, SQL logs. |
|
| 122 | - * |
|
| 123 | - * @param string $message |
|
| 124 | - * @param array $context |
|
| 125 | - * |
|
| 126 | - * @return void |
|
| 127 | - */ |
|
| 128 | - public function info($message, array $context = array()) |
|
| 129 | - { |
|
| 130 | - $this->log(LogLevel::INFO, $message, $context); |
|
| 131 | - } |
|
| 118 | + /** |
|
| 119 | + * Interesting events. |
|
| 120 | + * |
|
| 121 | + * Example: User logs in, SQL logs. |
|
| 122 | + * |
|
| 123 | + * @param string $message |
|
| 124 | + * @param array $context |
|
| 125 | + * |
|
| 126 | + * @return void |
|
| 127 | + */ |
|
| 128 | + public function info($message, array $context = array()) |
|
| 129 | + { |
|
| 130 | + $this->log(LogLevel::INFO, $message, $context); |
|
| 131 | + } |
|
| 132 | 132 | |
| 133 | - /** |
|
| 134 | - * Detailed debug information. |
|
| 135 | - * |
|
| 136 | - * @param string $message |
|
| 137 | - * @param array $context |
|
| 138 | - * |
|
| 139 | - * @return void |
|
| 140 | - */ |
|
| 141 | - public function debug($message, array $context = array()) |
|
| 142 | - { |
|
| 143 | - $this->log(LogLevel::DEBUG, $message, $context); |
|
| 144 | - } |
|
| 133 | + /** |
|
| 134 | + * Detailed debug information. |
|
| 135 | + * |
|
| 136 | + * @param string $message |
|
| 137 | + * @param array $context |
|
| 138 | + * |
|
| 139 | + * @return void |
|
| 140 | + */ |
|
| 141 | + public function debug($message, array $context = array()) |
|
| 142 | + { |
|
| 143 | + $this->log(LogLevel::DEBUG, $message, $context); |
|
| 144 | + } |
|
| 145 | 145 | |
| 146 | 146 | /** |
| 147 | 147 | * Bake the context into { } placeholders in the message. |
| 148 | - * @param string $message |
|
| 149 | - * @param array $context |
|
| 150 | - * |
|
| 151 | - * @return string The baked message; |
|
| 148 | + * @param string $message |
|
| 149 | + * @param array $context |
|
| 150 | + * |
|
| 151 | + * @return string The baked message; |
|
| 152 | 152 | */ |
| 153 | 153 | protected function interpolate( $message, $context ) { |
| 154 | 154 | foreach ( $context as $key => $val ) { |
@@ -50,7 +50,6 @@ |
||
| 50 | 50 | * Register this shortcode class with the WordPress Shortcode API. |
| 51 | 51 | * |
| 52 | 52 | * @internal |
| 53 | - |
|
| 54 | 53 | * @return \GV\Shortcode|null The only internally registered instance of this shortcode, or null on error. |
| 55 | 54 | */ |
| 56 | 55 | public static function add() { |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | protected $script_handles = array( |
| 25 | 25 | 'rcp-admin-scripts', |
| 26 | - 'bbq', |
|
| 26 | + 'bbq', |
|
| 27 | 27 | ); |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -12,10 +12,10 @@ discard block |
||
| 12 | 12 | add_action( 'gravityview_log_debug', array( $this, 'log_debug'), 10, 2 ); |
| 13 | 13 | |
| 14 | 14 | // Enable debug with Gravity Forms Logging Add-on |
| 15 | - add_filter( 'gform_logging_supported', array( $this, 'enable_gform_logging' ) ); |
|
| 15 | + add_filter( 'gform_logging_supported', array( $this, 'enable_gform_logging' ) ); |
|
| 16 | 16 | |
| 17 | - // Load Debug Bar integration |
|
| 18 | - add_filter( 'debug_bar_panels', array( $this, 'add_debug_bar' ) ); |
|
| 17 | + // Load Debug Bar integration |
|
| 18 | + add_filter( 'debug_bar_panels', array( $this, 'add_debug_bar' ) ); |
|
| 19 | 19 | |
| 20 | 20 | } |
| 21 | 21 | |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | * @param array $supported_plugins List of plugins |
| 45 | 45 | */ |
| 46 | 46 | public function enable_gform_logging( $supported_plugins ) { |
| 47 | - $supported_plugins['gravityview'] = 'GravityView'; |
|
| 48 | - return $supported_plugins; |
|
| 47 | + $supported_plugins['gravityview'] = 'GravityView'; |
|
| 48 | + return $supported_plugins; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | if ( class_exists("GFLogging") ) { |
| 98 | 98 | GFLogging::include_logger(); |
| 99 | - GFLogging::log_message( 'gravityview', $function( $message, true ) . $function($data, true), KLogger::DEBUG ); |
|
| 100 | - } |
|
| 99 | + GFLogging::log_message( 'gravityview', $function( $message, true ) . $function($data, true), KLogger::DEBUG ); |
|
| 100 | + } |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | static function log_error( $message = '', $data = null ) { |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | if ( class_exists("GFLogging") ) { |
| 118 | - GFLogging::include_logger(); |
|
| 119 | - GFLogging::log_message( 'gravityview', $function ( $message, true ) . $function ( $error, true), KLogger::ERROR ); |
|
| 118 | + GFLogging::include_logger(); |
|
| 119 | + GFLogging::log_message( 'gravityview', $function ( $message, true ) . $function ( $error, true), KLogger::ERROR ); |
|
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | |
@@ -141,7 +141,7 @@ |
||
| 141 | 141 | global $wpdb; |
| 142 | 142 | |
| 143 | 143 | if ( version_compare( GravityView_GFFormsModel::get_database_version(), '2.3-dev-1', '>=' ) |
| 144 | - && method_exists( 'GFFormsModel', 'get_entry_notes_table_name' ) ) { |
|
| 144 | + && method_exists( 'GFFormsModel', 'get_entry_notes_table_name' ) ) { |
|
| 145 | 145 | $notes_table = GFFormsModel::get_entry_notes_table_name(); |
| 146 | 146 | } else { |
| 147 | 147 | $notes_table = GFFormsModel::get_lead_notes_table_name(); |