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
learnpress / inc / admin / views / tools / course / html-reset-course-progress.php

html-reset-course-progress.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.8, at inc/admin/views/tools/course/html-reset-course-progress.php

108 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @author ThimPress
4 * @package LearnPress/Admin/Views
5 * @version 3.0.1
6 */
7
8 use LearnPress\Helpers\Template;
9 use LearnPress\TemplateHooks\Admin\AdminTemplate;
10 use LearnPress\TemplateHooks\Admin\Tools\AdminCourseTools;
11 use LearnPress\TemplateHooks\TemplateAJAX;
12
13 defined( 'ABSPATH' ) or die();
14 ?>
15
16 <div id="learn-press-reset-course-users" class="card lp-max-width-768">
17 <h2><?php echo esc_html__( 'Reset User Course Progress', 'learnpress' ); ?></h2>
18 <p><?php echo esc_html__( 'This action will reset course progress of users who have enrolled.', 'learnpress' ); ?></p>
19 <?php
20 echo sprintf(
21 '<button type="button"
22 data-template="#lp-tmpl-select-courses-to-reset-progress"
23 data-message-resetting="%1$s"
24 data-message-choose="%2$s"
25 class="lp-button button lp-btn-show-popup-items-to-select lp-btn-choose-courses-to-reset-progress">
26 %2$s
27 </button>',
28 esc_html__( 'Resetting courses progress', 'learnpress' ),
29 esc_html__( 'Choose data to reset progress', 'learnpress' )
30 ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
31
32 $html_fields = sprintf(
33 '<div class="filter-field">
34 <label>%s</label>
35 <input
36 class="lp-seach-course lp-filter-field"
37 type="text" name="lp-search-course" placeholder="%s">
38 </div>
39 <div class="filter-field">
40 <label>%s</label>
41 <input
42 class="lp-search-user lp-filter-field"
43 type="text" name="lp-search-user" placeholder="%s">
44 </div>',
45 esc_html__( 'Course', 'learnpress' ),
46 esc_attr__( 'Search course by title', 'learnpress' ),
47 esc_html__( 'Student', 'learnpress' ),
48 esc_attr__( 'Search student by name or email', 'learnpress' ),
49 );
50 $html_filter_fields = AdminTemplate::html_form_filter(
51 [
52 'fields' => $html_fields,
53 'form_classes' => 'lp-form-filter-reset-course-progress',
54 ]
55 );
56
57 $html_items = TemplateAJAX::load_content_via_ajax(
58 [
59 'id_url' => 'courses-to-reset-progress',
60 'enableScrollToView' => false,
61 'paged' => 1,
62 ],
63 [
64 /* @use AdminCourseTools::render_courses_to_reset_progress */
65 'class' => AdminCourseTools::class,
66 'method' => 'render_courses_to_reset_progress',
67 ]
68 );
69
70 $tabs = [
71 LP_COURSE_CPT => __( 'Courses', 'learnpress' ),
72 ];
73
74 $section = [
75 'wrap-script-template' => '<script type="text/template" id="lp-tmpl-select-courses-to-reset-progress">',
76 'popup' => AdminTemplate::html_popup_items_to_select_clone(
77 $tabs,
78 $html_items,
79 $html_filter_fields,
80 [
81 'classes' => 'lp-popup-select-courses-to-reset-progress',
82 'btn-add-label' => __( 'Reset data progress', 'learnpress' ),
83 'btn-add-classes' => 'lp-btn-reset-courses-progress',
84 'btn-add-attrs' => sprintf(
85 'data-message-confirm="%s"',
86 esc_html__( 'Are you sure you want to reset data progress choosed?', 'learnpress' )
87 ),
88 'btn-custom' => sprintf(
89 '<button type="button"
90 data-message-confirm="%s"
91 class="lp-button lp-btn-reset-all-courses-progress">
92 %s
93 </button>',
94 esc_html__(
95 'Are you sure you want to reset all data progress by filter?',
96 'learnpress'
97 ),
98 __( 'Reset all data progress', 'learnpress' )
99 ),
100 ]
101 ),
102 'wrap-script-template-end' => '</script>',
103 ];
104
105 echo Template::combine_components( $section ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
106 ?>
107 </div>
108