layout-onboard.php
111 lines
| 1 | <!-- onboard_steps nav begins --> |
| 2 | <?php |
| 3 | |
| 4 | $settings_sections = [ |
| 5 | 'dashboard' => [ |
| 6 | 'title' => esc_html__('Dashboard', 'wp-social'), |
| 7 | 'sub-title' => esc_html__('General info', 'wp-social'), |
| 8 | 'icon' => 'icon icon-home', |
| 9 | // 'view_path' => 'some path to the view file' |
| 10 | ], |
| 11 | 'widgets' => [ |
| 12 | 'title' => esc_html__('Widgets', 'wp-social'), |
| 13 | 'sub-title' => esc_html__('Enable disable widgets', 'wp-social'), |
| 14 | 'icon' => 'icon icon-magic-wand', |
| 15 | ], |
| 16 | 'modules' => [ |
| 17 | 'title' => esc_html__('Modules', 'wp-social'), |
| 18 | 'sub-title' => esc_html__('Enable disable modules', 'wp-social'), |
| 19 | 'icon' => 'icon icon-settings-2', |
| 20 | ], |
| 21 | 'usersettings' => [ |
| 22 | 'title' => esc_html__('User Settings', 'wp-social'), |
| 23 | 'sub-title' => esc_html__('Settings for fb, mailchimp etc', 'wp-social'), |
| 24 | 'icon' => 'icon icon-settings1', |
| 25 | ], |
| 26 | ]; |
| 27 | |
| 28 | $settings_sections = apply_filters('metform/admin/settings_sections/list', $settings_sections); |
| 29 | |
| 30 | |
| 31 | $onboard_steps = [ |
| 32 | 'step-01' => [ |
| 33 | 'title' => esc_html__('Configuration', 'wp-social'), |
| 34 | 'sub-title' => esc_html__('Configuration info', 'wp-social'), |
| 35 | 'icon' => esc_attr('xs-onboard-wpsocial'), |
| 36 | ], |
| 37 | 'step-02' => [ |
| 38 | 'title' => esc_html__('Sign Up', 'wp-social'), |
| 39 | 'sub-title' => esc_html__('Sign Up info', 'wp-social'), |
| 40 | 'icon' => esc_attr('xs-onboard-user') |
| 41 | ], |
| 42 | 'step-03' => [ |
| 43 | 'title' => esc_html__('Website Powerup', 'wp-social'), |
| 44 | 'sub-title' => esc_html__('Website Powerup info', 'wp-social'), |
| 45 | 'icon' => esc_attr('xs-onboard-layout') |
| 46 | ], |
| 47 | 'step-04' => [ |
| 48 | 'title' => esc_html__('Tutorial', 'wp-social'), |
| 49 | 'sub-title' => esc_html__('Tutorial info', 'wp-social'), |
| 50 | 'icon' => esc_attr('xs-onboard-youtube') |
| 51 | ], |
| 52 | 'step-05' => [ |
| 53 | 'title' => esc_html__('Surprise', 'wp-social'), |
| 54 | 'sub-title' => esc_html__('Surprise info', 'wp-social'), |
| 55 | 'icon' => esc_attr('xs-onboard-gift') |
| 56 | ], |
| 57 | 'step-06' => [ |
| 58 | 'title' => esc_html__('Finalizing', 'wp-social'), |
| 59 | 'sub-title' => esc_html__('Finalizing info', 'wp-social'), |
| 60 | 'icon' => esc_attr('xs-onboard-smile') |
| 61 | ] |
| 62 | ]; |
| 63 | |
| 64 | if(\Wp_Social\Plugin::instance()->package_type() != 'free'){ |
| 65 | unset($onboard_steps['step-05']); |
| 66 | }else { |
| 67 | unset($onboard_steps['step-01']); |
| 68 | } |
| 69 | |
| 70 | $onboard_steps = apply_filters('elementskit/admin/onboard_steps/list', $onboard_steps); |
| 71 | |
| 72 | echo wp_kses('<ul class="wslu-onboard-nav"><div class="wslu-onboard-progressbar"></div>', \WP_Social\Helper\Helper::get_kses_array()); |
| 73 | $count = 1; |
| 74 | foreach ( $onboard_steps as $step_key => $step ): |
| 75 | $icon = ! empty( $step['icon'] ) ? $step['icon'] : ''; |
| 76 | $title = ! empty( $step['title'] ) ? $step['title'] : ''; |
| 77 | ?> |
| 78 | <li data-step_key="<?php echo esc_attr( $step_key ); ?>" |
| 79 | class="wslu-onboard-nav-item" <?php echo $count === 1 ? 'active' : ''; |
| 80 | echo esc_attr($count === count( $onboard_steps ) ? 'last' : ''); ?>"> |
| 81 | |
| 82 | <?php if ( ! empty( $icon ) ) : ?> |
| 83 | <i class="wslu-onboard-nav-icon <?php echo esc_attr( $icon ); ?>"></i> |
| 84 | <?php endif; ?> |
| 85 | |
| 86 | <?php if ( ! empty( $title ) ) : ?> |
| 87 | <span class="wslu-onboard-nav-text"><?php echo esc_html( $title ); ?></span> |
| 88 | <?php endif; ?> |
| 89 | </li> |
| 90 | <?php $count ++; endforeach; |
| 91 | echo wp_kses('</ul>', \WP_Social\Helper\Helper::get_kses_array()); |
| 92 | ?> |
| 93 | <!-- onboard_steps nav ends --> |
| 94 | |
| 95 | <!-- onboard_steps content begins --> |
| 96 | <?php foreach ( $onboard_steps as $step_key => $step ): ?> |
| 97 | |
| 98 | <!-- includes view file for this step --> |
| 99 | <?php |
| 100 | $path = isset( $step['view_path'] ) |
| 101 | ? $step['view_path'] |
| 102 | : self::get_dir() . 'views/onboard-steps/' . $step_key . '.php'; |
| 103 | |
| 104 | if ( file_exists( $path ) ) { |
| 105 | echo wp_kses('<div class="wslu-onboard-step-wrapper wslu-onboard-' . esc_attr( $step_key ) . '">', \WP_Social\Helper\Helper::get_kses_array()); |
| 106 | include( $path ); |
| 107 | echo wp_kses('</div>', \WP_Social\Helper\Helper::get_kses_array()); |
| 108 | } ?> |
| 109 | |
| 110 | <?php endforeach; ?> |
| 111 | <!-- onboard_steps content ends --> |