PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.8
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
← All changes | inc/admin/views/setup/steps/pages.php +77 -65 4.3.74.4.8 View file →
@@ -1,76 +1,88 @@
1 1 <?php
2 2 /**
3 - * Template for displaying setup form of static pages while setting up LP
3 + * Template for displaying system pages while setting up LearnPress.
4 4 *
5 5 * @author ThimPress
6 6 * @package LearnPress/Admin/Views
7 - * @version 3.0.1
7 + * @version 4.3.2
8 8 */
9 9
10 -defined( 'ABSPATH' ) or exit;
10 +defined( 'ABSPATH' ) || exit;
11 11
12 -$settings = LP_Settings::instance();
12 +$system_pages = array(
13 + 'courses' => array(
14 + 'title' => __( 'All Courses Page', 'learnpress' ),
15 + 'description' => __( 'Main directory displaying all available courses for students.', 'learnpress' ),
16 + ),
17 + 'instructors' => array(
18 + 'title' => __( 'All Instructors Page', 'learnpress' ),
19 + 'description' => __( 'Grid listing all registered teachers and instructors.', 'learnpress' ),
20 + ),
21 + 'single_instructor' => array(
22 + 'title' => __( 'Single Instructor Page', 'learnpress' ),
23 + 'description' => __( 'Public instructor profile and their authored courses.', 'learnpress' ),
24 + ),
25 + 'profile' => array(
26 + 'title' => __( 'Profile Page', 'learnpress' ),
27 + 'description' => __( 'Student dashboard for enrolled courses, certificates & progress.', 'learnpress' ),
28 + ),
29 + 'checkout' => array(
30 + 'title' => __( 'Checkout Page', 'learnpress' ),
31 + 'description' => __( 'Secure payment checkout and course registration page.', 'learnpress' ),
32 + ),
33 + 'become_a_teacher' => array(
34 + 'title' => __( 'Become an Instructor Page', 'learnpress' ),
35 + 'description' => __( 'Registration form for prospective instructors to apply.', 'learnpress' ),
36 + ),
37 + 'term_conditions' => array(
38 + 'title' => __( 'Terms and Conditions Page', 'learnpress' ),
39 + 'description' => __( 'Terms of service agreement required prior to course purchase.', 'learnpress' ),
40 + ),
41 +);
13 42 ?>
14 -<h2><?php _e( 'Static Pages', 'learnpress' ); ?></h2>
43 +<section class="lp-setup-system-pages">
44 + <header class="lp-setup-section-header">
45 + <h2><?php esc_html_e( 'Step 2: Setup System Pages', 'learnpress' ); ?></h2>
46 + <p>
47 + <?php esc_html_e( 'When LearnPress is installed, essential system pages are automatically created and assigned out-of-the-box so your online academy is ready to function right away. You can easily re-assign or customize any page below anytime.', 'learnpress' ); ?>
48 + </p>
49 + </header>
15 50
16 -<p><?php _e( 'The pages will display the content of LP\'s necessary pages, such as Courses, Checkout, and Profile.', 'learnpress' ); ?></p>
17 -<p><?php printf( __( 'If you are not sure, click <a href="%s" id="create-pages">here</a> to create pages automatically.', 'learnpress' ), wp_nonce_url( admin_url( 'index.php?page=lp-setup&step=pages&auto-create' ) ), 'setup-create-pages' ); ?></p>
51 + <div class="lp-setup-system-pages__list">
52 + <?php foreach ( $system_pages as $page_key => $page_data ) { ?>
53 + <?php
54 + $page_id = learn_press_get_page_id( $page_key );
55 + $is_ready = $page_id && 'publish' === get_post_status( $page_id );
56 + ?>
57 + <article class="lp-setup-page-card lp-setup-card">
58 + <div class="lp-setup-page-card__content">
59 + <h3><?php echo esc_html( $page_data['title'] ); ?></h3>
60 + <p><?php echo esc_html( $page_data['description'] ); ?></p>
61 + </div>
18 62
19 -<table class="form-field">
20 - <tr>
21 - <th>
22 - <?php _e( 'Page: Show a list of courses', 'learnpress' ); ?>
23 - </th>
24 - <td>
25 - <?php learn_press_pages_dropdown( 'settings[pages][courses_page_id]', $settings->get( 'courses_page_id' ) ); ?>
26 - </td>
27 - </tr>
28 - <tr>
29 - <th>
30 - <?php _e( 'Page: Show a list of instructors', 'learnpress' ); ?>
31 - </th>
32 - <td>
33 - <?php learn_press_pages_dropdown( 'settings[pages][instructors_page_id]', $settings->get( 'instructors_page_id' ) ); ?>
34 - </td>
35 - </tr>
36 - <tr>
37 - <th>
38 - <?php _e( 'Page: Single instructor', 'learnpress' ); ?>
39 - </th>
40 - <td>
41 - <?php learn_press_pages_dropdown( 'settings[pages][single_instructor_page_id]', $settings->get( 'single_instructor_page_id' ) ); ?>
42 - </td>
43 - </tr>
44 - <tr>
45 - <th>
46 - <?php _e( 'Page: Profile', 'learnpress' ); ?>
47 - </th>
48 - <td>
49 - <?php learn_press_pages_dropdown( 'settings[pages][profile_page_id]', $settings->get( 'profile_page_id' ) ); ?>
50 - </td>
51 - </tr>
52 - <tr>
53 - <th>
54 - <?php _e( 'Page: Checkout', 'learnpress' ); ?>
55 - </th>
56 - <td>
57 - <?php learn_press_pages_dropdown( 'settings[pages][checkout_page_id]', $settings->get( 'checkout_page_id' ) ); ?>
58 - </td>
59 - </tr>
60 - <tr>
61 - <th>
62 - <?php _e( 'Page: Become a Teacher', 'learnpress' ); ?>
63 - </th>
64 - <td>
65 - <?php learn_press_pages_dropdown( 'settings[pages][become_a_teacher_page_id]', $settings->get( 'become_a_teacher_page_id' ) ); ?>
66 - </td>
67 - </tr>
68 - <tr>
69 - <th>
70 - <?php _e( 'Page: Terms and Conditions', 'learnpress' ); ?>
71 - </th>
72 - <td>
73 - <?php learn_press_pages_dropdown( 'settings[pages][term_conditions_page_id]', $settings->get( 'term_conditions_page_id' ) ); ?>
74 - </td>
75 - </tr>
76 -</table>
63 + <div class="lp-setup-page-card__actions">
64 + <?php if ( $is_ready ) { ?>
65 + <span class="lp-setup-page-status lp-setup-page-status--ready">
66 + <span class="lp-icon-check" aria-hidden="true"></span>
67 + <?php esc_html_e( 'Created & Ready to use', 'learnpress' ); ?>
68 + </span>
69 +
70 + <a class="lp-setup-page-card__edit" href="<?php echo esc_url( get_edit_post_link( $page_id ) ); ?>" target="_blank" rel="noopener noreferrer">
71 + <span class="lp-icon-edit" aria-hidden="true"></span>
72 + <?php esc_html_e( 'Edit', 'learnpress' ); ?>
73 + </a>
74 +
75 + <a class="lp-setup-page-card__view" href="<?php echo esc_url( get_permalink( $page_id ) ); ?>" target="_blank" rel="noopener noreferrer">
76 + <span class="lp-icon-eye" aria-hidden="true"></span>
77 + <?php esc_html_e( 'View', 'learnpress' ); ?>
78 + </a>
79 + <?php } else { ?>
80 + <span class="lp-setup-page-status lp-setup-page-status--missing">
81 + <?php esc_html_e( 'Needs setup', 'learnpress' ); ?>
82 + </span>
83 + <?php } ?>
84 + </div>
85 + </article>
86 + <?php } ?>
87 + </div>
88 +</section>