| 1 |
<?php |
| 2 |
include plugin_dir_path( __FILE__ ) . 'inc/betterdocs-setup-wizard-helper.php'; |
| 3 |
include plugin_dir_path( __FILE__ ) . 'inc/class-betterdocs-setup-wizard.php'; |
| 4 |
// Getting Started |
| 5 |
BetterDocsSetupWizard::setSection(array( |
| 6 |
'id' => 'betterdocs_getting_started_settings', |
| 7 |
'title' => __( 'Getting Started', 'betterdocs' ), |
| 8 |
'fields' => array( |
| 9 |
array( |
| 10 |
'id' => 'getting_started', |
| 11 |
'title' => __( 'Getting Started', 'betterdocs' ), |
| 12 |
'sub_title' => __( 'Easily get started with this easy setup wizard and complete setting up your Knowledge Base.', 'betterdocs' ), |
| 13 |
'type' => 'welcome', |
| 14 |
'video_url' => 'https://www.youtube.com/embed/57BioKfROlo' |
| 15 |
), |
| 16 |
) |
| 17 |
)); |
| 18 |
|
| 19 |
$existing_plugins = BetterDocsSetupWizard::knowledge_base_plugins(); |
| 20 |
if($existing_plugins){ |
| 21 |
$variable = ""; |
| 22 |
// Migration |
| 23 |
// $existing_plugins_data = BetterDocsSetupWizard::existing_plugins_data('echo-knowledge-base'); |
| 24 |
// var_dump($existing_plugins_data); |
| 25 |
BetterDocsSetupWizard::setSection(array( |
| 26 |
'id' => 'betterdocs_migration_settings', |
| 27 |
'title' => __( 'Migration', 'betterdocs' ), |
| 28 |
'fields' => array( |
| 29 |
array( |
| 30 |
'id' => 'migration_step', |
| 31 |
'sub_title' => __( 'We detected another Knowledge Base Plugin installed in this site. For BetterDocs to work efficiently, we will migrate the data from the plugin listed below, and deactivate the plgugin, to avoid conflict.', 'betterdocs' ), |
| 32 |
'type' => 'migration', |
| 33 |
'options' => [ |
| 34 |
array( |
| 35 |
'id' => $existing_plugins[0][0], |
| 36 |
'title' => 'Migrate '.$existing_plugins[0][1], |
| 37 |
'type' => 'checkbox', |
| 38 |
'default' => 1, |
| 39 |
), |
| 40 |
] |
| 41 |
), |
| 42 |
) |
| 43 |
)); |
| 44 |
} |
| 45 |
|
| 46 |
// Setup Pages |
| 47 |
BetterDocsSetupWizard::setSection(array( |
| 48 |
'id' => 'betterdocs_setup_page_settings', |
| 49 |
'title' => __( 'Setup Pages', 'betterdocs' ), |
| 50 |
'fields' => array( |
| 51 |
array( |
| 52 |
'id' => 'builtin_doc_page', |
| 53 |
'title' => __( 'Enable Built-in Documentation Page', 'betterdocs' ), |
| 54 |
'type' => 'checkbox', |
| 55 |
), |
| 56 |
array( |
| 57 |
'id' => 'docs_slug', |
| 58 |
'title' => __( 'Page Slug', 'betterdocs' ), |
| 59 |
'type' => 'text', |
| 60 |
'placeholder' => 'Page Slug', |
| 61 |
'default' => 'docs' |
| 62 |
), |
| 63 |
array( |
| 64 |
'id' => 'enable_disable', |
| 65 |
'title' => __( 'Enable Instant Answer', 'betterdocs' ), |
| 66 |
'type' => 'checkbox_pro_feature', |
| 67 |
) |
| 68 |
) |
| 69 |
)); |
| 70 |
|
| 71 |
// Create Content |
| 72 |
BetterDocsSetupWizard::setSection(array( |
| 73 |
'id' => 'betterdocs_create_content_settings', |
| 74 |
'title' => __( 'Create Content', 'betterdocs' ), |
| 75 |
'fields' => array( |
| 76 |
array( |
| 77 |
'id' => 'content_step', |
| 78 |
'title' => __( 'Create Documentation Content', 'betterdocs' ), |
| 79 |
'sub_title' => __( 'Let\'s create some categories and articles. And then assign the articles to proper categories.', 'betterdocs' ), |
| 80 |
'type' => 'link', |
| 81 |
'image_url' => BETTERDOCS_ADMIN_URL . 'assets/img/betterdocs-setup-articles.png', |
| 82 |
'options' => [ |
| 83 |
array( |
| 84 |
'title' => esc_html__('Create Categories', 'betterdocs'), |
| 85 |
'url' => admin_url('edit-tags.php?taxonomy=doc_category&post_type=docs'), |
| 86 |
'feature_title' => esc_html__('Create Categories', 'betterdocs'), |
| 87 |
'feature_content' => sprintf( '%s %s > <strong>%s</strong>', __( 'You can create Categories from', 'betterdocs' ), '<strong>BetterDocs</strong>', __( 'Categories', 'betterdocs' ) ) |
| 88 |
), |
| 89 |
array( |
| 90 |
'title' => esc_html__('Create Docs', 'betterdocs'), |
| 91 |
'url' => admin_url('post-new.php?post_type=docs'), |
| 92 |
'feature_title' => esc_html__('Create Docs', 'betterdocs'), |
| 93 |
'feature_content' => sprintf( '%1$s %2$s %3$s', __( 'You can create Docs from ', 'betterdocs' ), '<strong>BetterDocs ></strong>', __('Add New', 'betterdocs') ) |
| 94 |
) |
| 95 |
] |
| 96 |
), |
| 97 |
) |
| 98 |
)); |
| 99 |
|
| 100 |
// Customize |
| 101 |
BetterDocsSetupWizard::setSection(array( |
| 102 |
'id' => 'betterdocs_customize_settings', |
| 103 |
'title' => __( 'Customize', 'betterdocs' ), |
| 104 |
'fields' => array( |
| 105 |
array( |
| 106 |
'id' => 'customize_step', |
| 107 |
'title' => __( 'Customize Everything', 'betterdocs' ), |
| 108 |
'sub_title' => __( 'Take control of your settings and customize your documentation page, articles and archive pages live, with the power of Customizer', 'betterdocs' ), |
| 109 |
'type' => 'link', |
| 110 |
'image_url' => BETTERDOCS_ADMIN_URL . 'assets/img/setup-betterdocs-customizer.png', |
| 111 |
'options' => [ |
| 112 |
array( |
| 113 |
'id' => 'bdgotocustomize', |
| 114 |
'title' => esc_html__('Go To Customizer', 'betterdocs'), |
| 115 |
'url' => betterdocs_setup_get_customizer_setting_url(), |
| 116 |
'feature_title' => esc_html__('Easy To Customize', 'betterdocs'), |
| 117 |
'feature_content' => esc_html__('Customize Docs page, Docs, Archive page Live', 'betterdocs'), |
| 118 |
), |
| 119 |
array( |
| 120 |
'title' => esc_html__('Go To Settings', 'betterdocs'), |
| 121 |
'url' => betterdocs_get_admin_settings_url(), |
| 122 |
'feature_title' => esc_html__('Extensive Options Panel', 'betterdocs'), |
| 123 |
'feature_content' => esc_html__('Take control of your pages with extensive settings options', 'betterdocs'), |
| 124 |
) |
| 125 |
] |
| 126 |
), |
| 127 |
) |
| 128 |
)); |
| 129 |
|
| 130 |
// Finalize |
| 131 |
BetterDocsSetupWizard::setSection(array( |
| 132 |
'id' => 'betterdocs_finalize_settings', |
| 133 |
'title' => __( 'Finalize', 'betterdocs' ), |
| 134 |
'fields' => array( |
| 135 |
array( |
| 136 |
'id' => 'finnilize_step', |
| 137 |
'title' => __( 'Great Job!', 'betterdocs' ), |
| 138 |
'sub_title' => __( 'Your documentation page is ready! Make sure to add more articles and assign them to proper categories and you are good to go.', 'betterdocs' ), |
| 139 |
'type' => 'final_step', |
| 140 |
'image_url' => BETTERDOCS_ADMIN_URL . 'assets/img/setup-finalize.svg', |
| 141 |
'options' => [ |
| 142 |
array( |
| 143 |
'id' => 'bdgotodocspage', |
| 144 |
'title' => esc_html__('Visit Your Documentation Page', 'betterdocs'), |
| 145 |
'url' => betterdocs_setup_docs_page_url() |
| 146 |
), |
| 147 |
] |
| 148 |
), |
| 149 |
) |
| 150 |
)); |