| @@ -87,8 +87,9 @@ | ||
| 87 | 87 | * @return void |
| 88 | 88 | */ |
| 89 | 89 | public function __construct( $data ) { |
| 90 | 90 | $sections = array( 'counters', 'license', 'get_free_templates', 'payments', 'entries', 'inbox', 'video', 'payments' ); |
| 91 | + | |
| 91 | 92 | foreach ( $sections as $section ) { |
| 92 | 93 | if ( isset( $data[ $section ] ) ) { |
| 93 | 94 | $this->view[ $section ] = $data[ $section ]; |
| 94 | 95 | } |
| @@ -152,8 +153,9 @@ | ||
| 152 | 153 | * @return void |
| 153 | 154 | */ |
| 154 | 155 | public function get_license_management() { |
| 155 | 156 | $template = $this->view['license']; |
| 157 | + | |
| 156 | 158 | if ( is_callable( 'FrmProDashboardHelper::load_license_management' ) ) { |
| 157 | 159 | FrmProDashboardHelper::load_license_management( $template ); |
| 158 | 160 | return; |
| 159 | 161 | } |
| @@ -182,14 +184,15 @@ | ||
| 182 | 184 | * |
| 183 | 185 | * @return void |
| 184 | 186 | */ |
| 185 | 187 | public static function show_connect_links( $buttons = array(), $button_classes = '' ) { |
| 186 | - if ( empty( $buttons ) ) { | |
| 188 | + if ( ! $buttons ) { | |
| 187 | 189 | $buttons = self::get_license_buttons(); |
| 188 | 190 | } |
| 189 | 191 | |
| 190 | - foreach ( $buttons as $i => $button ) { | |
| 192 | + foreach ( $buttons as $button ) { | |
| 191 | 193 | $add_classes = ! empty( $button['classes'] ) ? ' ' . $button['classes'] : ' frm-button-secondary'; |
| 194 | + // phpcs:disable Generic.WhiteSpace.ScopeIndent | |
| 192 | 195 | ?> |
| 193 | 196 | <a href="<?php echo esc_url( $button['link'] ); ?>" target="_blank" |
| 194 | 197 | class="<?php echo esc_attr( $button_classes . $add_classes ); ?>" |
| 195 | 198 | > |
| @@ -195,8 +198,9 @@ | ||
| 195 | 198 | > |
| 196 | 199 | <?php echo esc_html( $button['label'] ); ?> |
| 197 | 200 | </a> |
| 198 | 201 | <?php |
| 202 | + // phpcs:enable Generic.WhiteSpace.ScopeIndent | |
| 199 | 203 | } |
| 200 | 204 | } |
| 201 | 205 | |
| 202 | 206 | /** |
| @@ -207,8 +211,9 @@ | ||
| 207 | 211 | * @return array |
| 208 | 212 | */ |
| 209 | 213 | public static function get_license_buttons() { |
| 210 | 214 | $cta_text = FrmSalesApi::get_best_sale_value( 'dashboard_license_cta_text' ); |
| 215 | + | |
| 211 | 216 | if ( ! $cta_text ) { |
| 212 | 217 | $cta_text = __( 'Get Formidable PRO', 'formidable' ); |
| 213 | 218 | } |
| 214 | 219 | |
| @@ -213,10 +218,10 @@ | ||
| 213 | 218 | } |
| 214 | 219 | |
| 215 | 220 | $upgrade_link = FrmSalesApi::get_best_sale_value( 'dashboard_license_cta_link' ); |
| 216 | 221 | $utm = array( |
| 217 | - 'medium' => 'settings-license', | |
| 218 | - 'content' => 'dashboard-license-box', | |
| 222 | + 'campaign' => 'settings-license', | |
| 223 | + 'content' => 'dashboard-license-box', | |
| 219 | 224 | ); |
| 220 | 225 | |
| 221 | 226 | if ( $upgrade_link ) { |
| 222 | 227 | $upgrade_link = FrmAppHelper::maybe_add_missing_utm( $upgrade_link, $utm ); |
| @@ -243,10 +248,9 @@ | ||
| 243 | 248 | * |
| 244 | 249 | * @return void |
| 245 | 250 | */ |
| 246 | 251 | public function get_inbox() { |
| 247 | - $template = $this->view['inbox']; | |
| 248 | - | |
| 252 | + $template = $this->view['inbox']; | |
| 249 | 253 | $subscribe_inbox_classnames = 'frm-inbox-subscribe frmcenter'; |
| 250 | 254 | $subscribe_inbox_classnames .= ! empty( $template['unread'] ) ? ' frm_hidden' : ''; |
| 251 | 255 | $subscribe_inbox_classnames .= true === FrmDashboardController::email_is_subscribed( $template['user']->user_email ) ? ' frm-inbox-hide-form' : ''; |
| 252 | 256 | |
| @@ -296,11 +300,13 @@ | ||
| 296 | 300 | * @return void |
| 297 | 301 | */ |
| 298 | 302 | public function get_youtube_video( $classes ) { |
| 299 | 303 | $template = $this->view['video']; |
| 304 | + | |
| 300 | 305 | if ( null === $template['id'] ) { |
| 301 | 306 | return; |
| 302 | 307 | } |
| 308 | + | |
| 303 | 309 | include FrmAppHelper::plugin_path() . '/classes/views/dashboard/templates/youtube-video.php'; |
| 304 | 310 | } |
| 305 | 311 | |
| 306 | 312 | /** |
| @@ -358,8 +364,10 @@ | ||
| 358 | 364 | } |
| 359 | 365 | |
| 360 | 366 | /** |
| 361 | 367 | * Dashboard - load the entries list template. |
| 368 | + * | |
| 369 | + * @param array $template | |
| 362 | 370 | * |
| 363 | 371 | * @return void |
| 364 | 372 | */ |
| 365 | 373 | private static function load_entries_list_template( $template ) { |