@@ -187,8 +187,8 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | foreach ( $settings as $setting => $default ) { |
| 190 | - if ( isset( $params[ 'frm_' . $setting ] ) ) { |
|
| 191 | - $this->{$setting} = $params[ 'frm_' . $setting ]; |
|
| 190 | + if ( isset( $params['frm_' . $setting] ) ) { |
|
| 191 | + $this->{$setting} = $params['frm_' . $setting]; |
|
| 192 | 192 | } elseif ( ! isset( $this->{$setting} ) ) { |
| 193 | 193 | $this->{$setting} = $default; |
| 194 | 194 | } |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | |
| 357 | 357 | $checkboxes = array( 'mu_menu', 're_multi', 'use_html', 'jquery_css', 'accordion_js', 'fade_form', 'no_ips', 'custom_header_ip', 'tracking', 'admin_bar', 'summary_emails' ); |
| 358 | 358 | foreach ( $checkboxes as $set ) { |
| 359 | - $this->$set = isset( $params[ 'frm_' . $set ] ) ? absint( $params[ 'frm_' . $set ] ) : 0; |
|
| 359 | + $this->$set = isset( $params['frm_' . $set] ) ? absint( $params['frm_' . $set] ) : 0; |
|
| 360 | 360 | } |
| 361 | 361 | } |
| 362 | 362 | |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | $frm_roles = FrmAppHelper::frm_capabilities(); |
| 370 | 370 | $roles = get_editable_roles(); |
| 371 | 371 | foreach ( $frm_roles as $frm_role => $frm_role_description ) { |
| 372 | - $this->$frm_role = (array) ( isset( $params[ $frm_role ] ) ? $params[ $frm_role ] : 'administrator' ); |
|
| 372 | + $this->$frm_role = (array) ( isset( $params[$frm_role] ) ? $params[$frm_role] : 'administrator' ); |
|
| 373 | 373 | |
| 374 | 374 | // Make sure administrators always have permissions |
| 375 | 375 | if ( ! in_array( 'administrator', $this->$frm_role ) ) { |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * @param array $stats Statistics section data. |
| 123 | 123 | */ |
| 124 | 124 | protected function add_payments_data( &$stats ) { |
| 125 | - $payment_data = FrmEmailSummaryHelper::get_payments_data( $this->from_date, $this->to_date ); |
|
| 125 | + $payment_data = FrmEmailSummaryHelper::get_payments_data( $this->from_date, $this->to_date ); |
|
| 126 | 126 | $stats['payments_count'] = array( |
| 127 | 127 | 'label' => __( 'Payments collected', 'formidable' ), |
| 128 | 128 | 'count' => $payment_data['count'], |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | // Build total for each currency. |
| 133 | 133 | foreach ( $payment_data['total'] as $currency => $amount ) { |
| 134 | - $stats[ 'payments_total_' . $currency ] = array( |
|
| 134 | + $stats['payments_total_' . $currency] = array( |
|
| 135 | 135 | // translators: currency name. |
| 136 | 136 | 'label' => sprintf( __( 'Total %s', 'formidable' ), strtoupper( $currency ) ), |
| 137 | 137 | 'count' => $amount, |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | if ( $this->has_comparison ) { |
| 144 | - $prev_payment_data = FrmEmailSummaryHelper::get_payments_data( $this->prev_from_date, $this->prev_to_date ); |
|
| 144 | + $prev_payment_data = FrmEmailSummaryHelper::get_payments_data( $this->prev_from_date, $this->prev_to_date ); |
|
| 145 | 145 | |
| 146 | 146 | if ( ! $payment_data['count'] && ! $prev_payment_data['count'] ) { |
| 147 | 147 | // Maybe this site doesn't collect payment, hide these sections. |
@@ -153,23 +153,23 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | // Compare total for each currency. |
| 155 | 155 | foreach ( $payment_data['total'] as $currency => $amount ) { |
| 156 | - if ( ! isset( $prev_payment_data['total'][ $currency ] ) ) { |
|
| 157 | - $stats[ 'payments_total_' . $currency ]['compare'] = 1; |
|
| 156 | + if ( ! isset( $prev_payment_data['total'][$currency] ) ) { |
|
| 157 | + $stats['payments_total_' . $currency]['compare'] = 1; |
|
| 158 | 158 | continue; |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - $stats[ 'payments_total_' . $currency ]['compare'] = $this->get_compare_diff( $amount, $prev_payment_data['total'][ $currency ] ); |
|
| 162 | - unset( $prev_payment_data['total'][ $currency ] ); |
|
| 161 | + $stats['payments_total_' . $currency]['compare'] = $this->get_compare_diff( $amount, $prev_payment_data['total'][$currency] ); |
|
| 162 | + unset( $prev_payment_data['total'][$currency] ); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | // If prev month has more currencies. |
| 166 | 166 | foreach ( $prev_payment_data['total'] as $currency => $amount ) { |
| 167 | - $stats[ 'payments_total_' . $currency ] = array( |
|
| 167 | + $stats['payments_total_' . $currency] = array( |
|
| 168 | 168 | // translators: currency name. |
| 169 | 169 | 'label' => sprintf( __( 'Total %s', 'formidable' ), strtoupper( $currency ) ), |
| 170 | 170 | 'count' => 0, |
| 171 | 171 | 'display' => $this->get_formatted_price( 0, $currency ), |
| 172 | - 'compare' => -1, |
|
| 172 | + 'compare' => - 1, |
|
| 173 | 173 | ); |
| 174 | 174 | } |
| 175 | 175 | } |