| 1 |
<?php |
| 2 |
/** |
| 3 |
* Admin View: Help Center page. |
| 4 |
* |
| 5 |
* @package LearnPress/Admin/Views |
| 6 |
* |
| 7 |
* @var array $quick_links |
| 8 |
* @var array $whats_new |
| 9 |
* @var array $articles |
| 10 |
* @var array $banner_ad |
| 11 |
* @var string $tick_icon |
| 12 |
*/ |
| 13 |
|
| 14 |
use LearnPress\TemplateHooks\Admin\AdminHelpCenterDataTemplate; |
| 15 |
use LearnPress\TemplateHooks\Admin\AdminTemplate; |
| 16 |
use LearnPress\TemplateHooks\TemplateAJAX; |
| 17 |
|
| 18 |
defined( 'ABSPATH' ) || exit; |
| 19 |
$quick_links = apply_filters( |
| 20 |
'learn-press/admin/help-center/quick-links', |
| 21 |
array( |
| 22 |
array( |
| 23 |
'icon' => 'help-center/ico-hc-support-ticket.svg', |
| 24 |
'title' => __( 'Support Ticket', 'learnpress' ), |
| 25 |
'description' => __( 'Need help with your LMS website? Submit a ticket to the LearnPress support team.', 'learnpress' ), |
| 26 |
'button' => __( 'Create Ticket', 'learnpress' ), |
| 27 |
'url' => 'https://help.thimpress.com/', |
| 28 |
), |
| 29 |
array( |
| 30 |
'icon' => 'help-center/ico-hc-video-tutorials.svg', |
| 31 |
'title' => __( 'Video Tutorials', 'learnpress' ), |
| 32 |
'description' => __( 'Watch step-by-step videos about LearnPress settings and common workflows.', 'learnpress' ), |
| 33 |
'button' => __( 'Watch Videos', 'learnpress' ), |
| 34 |
'url' => 'https://www.youtube.com/@LearnPressLMS/videos', |
| 35 |
), |
| 36 |
array( |
| 37 |
'icon' => 'help-center/ico-hc-documentation.svg', |
| 38 |
'title' => __( 'Documentation', 'learnpress' ), |
| 39 |
'description' => __( 'Browse LearnPress setup guides, course management, quizzes, payment, and emails.', 'learnpress' ), |
| 40 |
'button' => __( 'Read Docs', 'learnpress' ), |
| 41 |
'url' => 'https://learnpresslms.com/docs/', |
| 42 |
), |
| 43 |
array( |
| 44 |
'icon' => 'help-center/ico-hc-community.svg', |
| 45 |
'title' => __( 'Community', 'learnpress' ), |
| 46 |
'description' => __( 'Join the LearnPress community to share ideas, ask questions, and connect with LMS site owners.', 'learnpress' ), |
| 47 |
'button' => __( 'Join Community', 'learnpress' ), |
| 48 |
'url' => 'https://www.facebook.com/groups/learnpress/', |
| 49 |
), |
| 50 |
array( |
| 51 |
'icon' => 'help-center/ico-hc-feedback.svg', |
| 52 |
'title' => __( 'Feedback', 'learnpress' ), |
| 53 |
'description' => __( 'Share your thoughts, report issues, and help improve the LearnPress experience.', 'learnpress' ), |
| 54 |
'button' => __( 'Send Feedback', 'learnpress' ), |
| 55 |
'url' => 'https://learnpresslms.com/feedback/', |
| 56 |
), |
| 57 |
array( |
| 58 |
'icon' => 'help-center/ico-hc-affiliate.svg', |
| 59 |
'title' => __( 'Affiliate', 'learnpress' ), |
| 60 |
'description' => __( 'Promote LearnPress products, track referrals, and manage your affiliate resources.', 'learnpress' ), |
| 61 |
'button' => __( 'Join Affiliate', 'learnpress' ), |
| 62 |
'url' => 'https://thimpress.com/become-an-affiliate/', |
| 63 |
), |
| 64 |
) |
| 65 |
); |
| 66 |
|
| 67 |
foreach ( $quick_links as &$link ) { |
| 68 |
$link['icon_svg'] = LP_WP_Filesystem::get_icon_svg( $link['icon'] ?? '' ); |
| 69 |
} |
| 70 |
unset( $link ); |
| 71 |
?> |
| 72 |
|
| 73 |
<?php ob_start(); ?> |
| 74 |
<p class="lp-help-center-subtitle"> |
| 75 |
<?php esc_html_e( 'Find documentation, tutorials, troubleshooting guides, and support resources for LearnPress.', 'learnpress' ); ?> |
| 76 |
</p> |
| 77 |
|
| 78 |
<?php if ( $quick_links ) : ?> |
| 79 |
<div class="lp-help-center-grid"> |
| 80 |
<?php foreach ( $quick_links as $item ) : ?> |
| 81 |
<div class="lp-help-center-card"> |
| 82 |
<span class="lp-help-center-card__icon"> |
| 83 |
<?php echo $item['icon_svg'] ?? ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- trusted local SVG file content via LP_WP_Filesystem::get_icon_svg(). ?> |
| 84 |
</span> |
| 85 |
|
| 86 |
<div class="lp-help-center-card__content"> |
| 87 |
<h3><?php echo esc_html( $item['title'] ?? '' ); ?></h3> |
| 88 |
<p><?php echo esc_html( $item['description'] ?? '' ); ?></p> |
| 89 |
</div> |
| 90 |
|
| 91 |
<a class="button lp-help-center-card__button" href="<?php echo esc_url( $item['url'] ?? '#' ); ?>" target="_blank" rel="noopener noreferrer"> |
| 92 |
<?php echo esc_html( $item['button'] ?? '' ); ?> |
| 93 |
</a> |
| 94 |
</div> |
| 95 |
<?php endforeach; ?> |
| 96 |
</div> |
| 97 |
<?php endif; ?> |
| 98 |
|
| 99 |
<?php |
| 100 |
echo TemplateAJAX::load_content_via_ajax( |
| 101 |
[ |
| 102 |
'id_url' => 'data-help-center', |
| 103 |
], |
| 104 |
[ |
| 105 |
'class' => AdminHelpCenterDataTemplate::class, |
| 106 |
'method' => 'html_data_online', |
| 107 |
] |
| 108 |
) |
| 109 |
?> |
| 110 |
<?php |
| 111 |
$content = ob_get_clean(); |
| 112 |
|
| 113 |
echo AdminTemplate::html_on_wp_admin_screen( |
| 114 |
array( |
| 115 |
'content' => $content, |
| 116 |
'title' => __( 'LearnPress Help Center', 'learnpress' ), |
| 117 |
'id' => 'learn-press-help-center', |
| 118 |
) |
| 119 |
); |
| 120 |
|