class-page-wizard-complete.php
5 months ago
class-page-wizard-incompatible.php
5 months ago
class-page-wizard-intro.php
5 months ago
class-page-wizard-main.php
5 months ago
class-page-wizard-stages.php
5 months ago
class-page-wizard-complete.php
101 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SuperbAddons\Admin\Pages\Wizard; |
| 4 | |
| 5 | use SuperbAddons\Admin\Controllers\Wizard\WizardController; |
| 6 | use SuperbAddons\Components\Admin\NewsletterForm; |
| 7 | use SuperbAddons\Data\Utils\Wizard\WizardActionParameter; |
| 8 | |
| 9 | defined('ABSPATH') || exit(); |
| 10 | |
| 11 | class PageWizardCompletePage |
| 12 | { |
| 13 | public function __construct() |
| 14 | { |
| 15 | $completedType = WizardController::GetCompletedWizardType(); |
| 16 | if (!$completedType) { |
| 17 | new PageWizardIntroPage(); |
| 18 | return; |
| 19 | } |
| 20 | |
| 21 | if ($completedType == WizardActionParameter::THEME_DESIGNER) { |
| 22 | if (!WizardController::ThemeHasCompletedWizard()) { |
| 23 | new PageWizardIntroPage(); |
| 24 | return; |
| 25 | } |
| 26 | $this->RenderCompletionPage( |
| 27 | __("You're All Set!", "superb-blocks"), |
| 28 | __("Congratulations! Your new website design is ready. Now that you’ve customized the look and feel, here are some options for what you can do next:", "superb-blocks") |
| 29 | ); |
| 30 | return; |
| 31 | } |
| 32 | |
| 33 | if ($completedType == WizardActionParameter::ADD_NEW_PAGES) { |
| 34 | $this->RenderCompletionPage( |
| 35 | __("Your New Pages Have Been Added!", "superb-blocks"), |
| 36 | __("Now that your new pages have been added, here are a few things you can do to make the most out of your new pages:", "superb-blocks") |
| 37 | ); |
| 38 | return; |
| 39 | } |
| 40 | |
| 41 | if ($completedType == WizardActionParameter::WOOCOMMERCE_HEADER) { |
| 42 | $this->RenderCompletionPage( |
| 43 | __("You're All Set!", "superb-blocks"), |
| 44 | __("Now that your WooCommerce header has been added, here are some options for what you can do next:", "superb-blocks") |
| 45 | ); |
| 46 | return; |
| 47 | } |
| 48 | |
| 49 | if ($completedType == WizardActionParameter::HEADER_FOOTER) { |
| 50 | $this->RenderCompletionPage( |
| 51 | __("You're All Set!", "superb-blocks"), |
| 52 | __("Now that your header and footer have been added, here are some options for what you can do next:", "superb-blocks") |
| 53 | ); |
| 54 | return; |
| 55 | } |
| 56 | |
| 57 | if ($completedType == WizardActionParameter::RESTORE) { |
| 58 | $this->RenderCompletionPage( |
| 59 | __("Your Templates Have Been Restored!", "superb-blocks"), |
| 60 | __("Your templates have been restored to the restoration points you've selected. Here are some options for what you can do next:", "superb-blocks") |
| 61 | ); |
| 62 | return; |
| 63 | } |
| 64 | |
| 65 | new PageWizardIntroPage(); |
| 66 | } |
| 67 | |
| 68 | private function RenderCompletionPage($title, $description, $cta = true) |
| 69 | { |
| 70 | ?> |
| 71 | <div class="superbaddons-wizard-wrapper-small"> |
| 72 | <div class="superbaddons-admindashboard-content-box-large"> |
| 73 | <div class="superbaddons-wizard-heading"> |
| 74 | <img src="<?php echo esc_url(SUPERBADDONS_ASSETS_PATH . '/img/superbthemes-wizard-checkmark.svg'); ?>" width="60" height="60"> |
| 75 | <h1><?php echo esc_html($title); ?> </h1> |
| 76 | </div> |
| 77 | <p class="superbaddons-element-text-sm superbaddons-wizard-tagline"><?php echo esc_html($description); ?></p> |
| 78 | <?php if ($cta) : ?> |
| 79 | <?php $this->RenderSuggestionsAndCTA(); ?> |
| 80 | <?php endif; ?> |
| 81 | </div> |
| 82 | </div> |
| 83 | <?php |
| 84 | } |
| 85 | |
| 86 | private function RenderSuggestionsAndCTA() |
| 87 | { |
| 88 | ?> |
| 89 | <div class="superbaddons-wizard-completed-cta-buttons-wrapper"> |
| 90 | <a target="_blank" href="<?php echo esc_url(home_url()); ?>" class="superbthemes-module-cta superbthemes-module-cta-green"><?php echo esc_html__("View Site", "superb-blocks"); ?></a> |
| 91 | <a target="_blank" href="<?php echo esc_url(admin_url('site-editor.php?path=/wp_template')); ?>" class="superbthemes-module-cta"><?php echo esc_html__("Edit Templates", "superb-blocks"); ?></a> |
| 92 | <a target="_blank" href="<?php echo esc_url(admin_url('edit.php?post_type=page')); ?>" class="superbthemes-module-cta"><?php echo esc_html__("Edit Pages", "superb-blocks"); ?></a> |
| 93 | </div> |
| 94 | <div class="superbaddons-wizard-completed-newsletter-wrapper"> |
| 95 | <?php new NewsletterForm(); ?> |
| 96 | </div> |
| 97 | |
| 98 | <?php |
| 99 | } |
| 100 | } |
| 101 |