| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template for displaying the Learning Experience step of the setup wizard. |
| 4 |
* |
| 5 |
* @author ThimPress |
| 6 |
* @package LearnPress/Admin/Views |
| 7 |
* @version 4.3.2 |
| 8 |
*/ |
| 9 |
|
| 10 |
use LearnPress\TemplateHooks\Admin\AdminTemplate; |
| 11 |
|
| 12 |
defined( 'ABSPATH' ) || exit; |
| 13 |
|
| 14 |
$is_block_theme = wp_is_block_theme(); |
| 15 |
$course_layout = LP_Settings::get_option( 'layout_single_course', 'modern' ); |
| 16 |
$course_listing = LP_Settings::get_option( 'archive_courses_layout', 'grid' ); |
| 17 |
$auto_enroll = LP_Settings::get_option( 'auto_enroll', 'yes' ); |
| 18 |
$disabled_class = $is_block_theme ? ' lp-setup-choice-group--disabled' : ''; |
| 19 |
?> |
| 20 |
<section class="lp-setup-learning-experience"> |
| 21 |
<header class="lp-setup-section-header"> |
| 22 |
<h2><?php esc_html_e( 'Step 1: Learning Experience', 'learnpress' ); ?></h2> |
| 23 |
<p><?php esc_html_e( 'Choose a few basics for how your courses look and feel.', 'learnpress' ); ?></p> |
| 24 |
</header> |
| 25 |
|
| 26 |
<?php if ( $is_block_theme ) : ?> |
| 27 |
<div class="lp-setup-info" role="status"> |
| 28 |
<span class="lp-setup-info__icon" aria-hidden="true"> |
| 29 |
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"> |
| 30 |
<circle cx="12" cy="12" r="10" fill="currentColor" stroke="none"/> |
| 31 |
<path d="M12 10.75V17M12 7.25V7.5" stroke="white" stroke-width="2" stroke-linecap="round"/> |
| 32 |
</svg> |
| 33 |
</span> |
| 34 |
<span class="lp-setup-info__content"> |
| 35 |
<strong><?php esc_html_e( 'Your current theme supports Gutenberg.', 'learnpress' ); ?></strong> |
| 36 |
<span><?php esc_html_e( 'These settings are not available because they don’t apply to your theme.', 'learnpress' ); ?></span> |
| 37 |
</span> |
| 38 |
</div> |
| 39 |
<?php endif; ?> |
| 40 |
|
| 41 |
<fieldset class="lp-setup-choice-group<?php echo esc_attr( $disabled_class ); ?>"<?php echo $is_block_theme ? ' aria-disabled="true"' : ''; ?>> |
| 42 |
<legend><?php esc_html_e( 'Layout single course', 'learnpress' ); ?></legend> |
| 43 |
<div class="lp-setup-choice-grid"> |
| 44 |
<label class="lp-setup-choice"> |
| 45 |
<input type="radio" name="settings[course][layout_single_course]" value="modern" |
| 46 |
<?php checked( $course_layout, 'modern' ); ?><?php disabled( $is_block_theme ); ?>> |
| 47 |
<span class="lp-setup-choice__card lp-setup-card"> |
| 48 |
<span class="lp-setup-choice__icon" aria-hidden="true"> |
| 49 |
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28" fill="none"> |
| 50 |
<path d="M5.83333 3.5H22.1667C23.4553 3.5 24.5 4.54467 24.5 5.83333V22.1667C24.5 23.4553 23.4553 24.5 22.1667 24.5H5.83333C4.54467 24.5 3.5 23.4553 3.5 22.1667V5.83333C3.5 4.54467 4.54467 3.5 5.83333 3.5ZM10.5 3.5V24.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> |
| 51 |
</svg> |
| 52 |
</span> |
| 53 |
<span class="lp-setup-choice__content"> |
| 54 |
<strong><?php esc_html_e( 'Modern', 'learnpress' ); ?></strong> |
| 55 |
<span><?php esc_html_e( 'Clean and focused course experience.', 'learnpress' ); ?></span> |
| 56 |
</span> |
| 57 |
</span> |
| 58 |
</label> |
| 59 |
|
| 60 |
<label class="lp-setup-choice"> |
| 61 |
<input type="radio" name="settings[course][layout_single_course]" value="classic" |
| 62 |
<?php checked( $course_layout, 'classic' ); ?><?php disabled( $is_block_theme ); ?>> |
| 63 |
<span class="lp-setup-choice__card lp-setup-card"> |
| 64 |
<span class="lp-setup-choice__icon" aria-hidden="true"> |
| 65 |
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 28 28" fill="none"> |
| 66 |
<path d="M16.3328 4.66667H24.4995M16.3328 10.5H24.4995M16.3328 17.5H24.4995M16.3328 23.3333H24.4995M4.66618 3.5H10.4995C11.1438 3.5 11.6662 4.02233 11.6662 4.66667V10.5C11.6662 11.1443 11.1438 11.6667 10.4995 11.6667H4.66618C4.02185 11.6667 3.49951 11.1443 3.49951 10.5V4.66667C3.49951 4.02233 4.02185 3.5 4.66618 3.5ZM4.66618 16.3333H10.4995C11.1438 16.3333 11.6662 16.8557 11.6662 17.5V23.3333C11.6662 23.9777 11.1438 24.5 10.4995 24.5H4.66618C4.02185 24.5 3.49951 23.9777 3.49951 23.3333V17.5C3.49951 16.8557 4.02185 16.3333 4.66618 16.3333Z" stroke="#626262" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> |
| 67 |
</svg> |
| 68 |
</span> |
| 69 |
<span class="lp-setup-choice__content"> |
| 70 |
<strong><?php esc_html_e( 'Classic', 'learnpress' ); ?></strong> |
| 71 |
<span><?php esc_html_e( 'A traditional course layout.', 'learnpress' ); ?></span> |
| 72 |
</span> |
| 73 |
</span> |
| 74 |
</label> |
| 75 |
</div> |
| 76 |
</fieldset> |
| 77 |
|
| 78 |
<fieldset class="lp-setup-choice-group<?php echo esc_attr( $disabled_class ); ?>"<?php echo $is_block_theme ? ' aria-disabled="true"' : ''; ?>> |
| 79 |
<legend><?php esc_html_e( 'Course Listing', 'learnpress' ); ?></legend> |
| 80 |
<div class="lp-setup-choice-grid"> |
| 81 |
<label class="lp-setup-choice"> |
| 82 |
<input type="radio" name="settings[course][archive_courses_layout]" value="grid" |
| 83 |
<?php checked( $course_listing, 'grid' ); ?><?php disabled( $is_block_theme ); ?>> |
| 84 |
<span class="lp-setup-choice__card lp-setup-card"> |
| 85 |
<span class="lp-setup-choice__icon" aria-hidden="true"> |
| 86 |
<span class="lp-icon-th"></span> |
| 87 |
</span> |
| 88 |
<span class="lp-setup-choice__content"> |
| 89 |
<strong><?php esc_html_e( 'Grid', 'learnpress' ); ?></strong> |
| 90 |
<span><?php esc_html_e( 'Show courses in a visual grid.', 'learnpress' ); ?></span> |
| 91 |
</span> |
| 92 |
</span> |
| 93 |
</label> |
| 94 |
|
| 95 |
<label class="lp-setup-choice"> |
| 96 |
<input type="radio" name="settings[course][archive_courses_layout]" value="list" |
| 97 |
<?php checked( $course_listing, 'list' ); ?><?php disabled( $is_block_theme ); ?>> |
| 98 |
<span class="lp-setup-choice__card lp-setup-card"> |
| 99 |
<span class="lp-setup-choice__icon" aria-hidden="true"> |
| 100 |
<span class="lp-icon-th-list"></span> |
| 101 |
</span> |
| 102 |
<span class="lp-setup-choice__content"> |
| 103 |
<strong><?php esc_html_e( 'List', 'learnpress' ); ?></strong> |
| 104 |
<span><?php esc_html_e( 'Show courses in a simple list.', 'learnpress' ); ?></span> |
| 105 |
</span> |
| 106 |
</span> |
| 107 |
</label> |
| 108 |
</div> |
| 109 |
</fieldset> |
| 110 |
|
| 111 |
<fieldset class="lp-setup-choice-group lp-setup-choice-group--enrollment"> |
| 112 |
<legend><?php esc_html_e( 'Course Enrollment', 'learnpress' ); ?></legend> |
| 113 |
<div class="lp-setup-choice lp-setup-choice--wide"> |
| 114 |
<span class="lp-setup-choice__card lp-setup-card"> |
| 115 |
<?php echo AdminTemplate::html_toggle_enable( array( 'name' => 'settings[course][auto_enroll]', 'value' => 'yes' === $auto_enroll, 'classes' => 'lp-setup-auto-enroll' ) ); ?> |
| 116 |
<span class="lp-setup-choice__content"> |
| 117 |
<strong><?php esc_html_e( 'Start courses automatically after purchase', 'learnpress' ); ?></strong> |
| 118 |
<span><?php esc_html_e( 'Students can start learning right away.', 'learnpress' ); ?></span> |
| 119 |
</span> |
| 120 |
</span> |
| 121 |
</div> |
| 122 |
</fieldset> |
| 123 |
|
| 124 |
<p class="lp-setup-learning-experience__note"> |
| 125 |
<?php esc_html_e( 'Don’t worry, you can always change these settings later! 😊', 'learnpress' ); ?> |
| 126 |
</p> |
| 127 |
</section> |
| 128 |
|