PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.3.9.1
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.3.9.1
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-unassign-course.php

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

105 lines 2.7 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 4.2.4
6 */
7
8 defined( 'ABSPATH' ) or die();
9
10 $data_struct_course = [
11 'urlApi' => get_rest_url( null, 'lp/v1/admin/tools/search-course' ),
12 'dataType' => 'courses',
13 'keyGetValue' => [
14 'value' => 'ID',
15 'text' => '{{post_title}} (#{{ID}})',
16 'key_render' => [
17 'post_title' => 'post_title',
18 'ID' => 'ID',
19 ],
20 ],
21 'setting' => [
22 'placeholder' => esc_html__( 'Choose Course', 'learnpress' ),
23 ],
24 ];
25 $unassign_course = new LP_Meta_Box_Select_Field(
26 esc_html__( 'Choose Course', 'learnpress' ),
27 [],
28 '',
29 [
30 'options' => array(),
31 'tom_select' => true,
32 'multiple' => true,
33 'name_no_bracket' => true,
34 'custom_attributes' => [ 'data-struct' => htmlentities2( json_encode( $data_struct_course ) ) ],
35 ]
36 );
37 $unassign_course->id = 'course_ids';
38
39 $data_struct_user = [
40 'urlApi' => get_rest_url( null, 'lp/v1/admin/tools/search-user' ),
41 'dataType' => 'users',
42 'keyGetValue' => [
43 'value' => 'ID',
44 'text' => '{{display_name}}(#{{ID}}) - {{user_email}}',
45 'key_render' => [
46 'display_name' => 'display_name',
47 'user_email' => 'user_email',
48 'ID' => 'ID',
49 ],
50 ],
51 'setting' => [
52 'placeholder' => esc_html__( 'Choose User', 'learnpress' ),
53 ],
54 ];
55 $unassign_user = new LP_Meta_Box_Select_Field(
56 esc_html__( 'Choose User', 'learnpress' ),
57 [],
58 '',
59 [
60 'options' => array(),
61 'tom_select' => true,
62 'multiple' => true,
63 'name_no_bracket' => true,
64 'custom_attributes' => [ 'data-struct' => htmlentities2( json_encode( $data_struct_user ) ) ],
65 ]
66 );
67 $unassign_user->id = 'user_ids';
68
69 ?>
70 <div id="learn-press-unassigned-course" class="card">
71 <h2><?php _e( 'Unassign Course', 'learnpress' ); ?></h2>
72 <div class="description">
73 <?php _e( 'Remove user from a course', 'learnpress' ); ?>
74 </div>
75 <i style="color: #a20707">
76 <?php
77 _e(
78 'Noted: when remove user from course, the progress of user with course assign will eraser, so be careful before do this.',
79 'learnpress'
80 );
81 ?>
82 </i>
83 <div class="content">
84 <form id="lp-unassign-user-course-form">
85 <ul>
86 <li>
87 <?php $unassign_course->output( 0 ); ?>
88 </li>
89 <li>
90 <div class="assign-to-user">
91 <?php $unassign_user->output( 0 ); ?>
92 </div>
93 </li>
94 </ul>
95 <div>
96 <button class="button button-primary lp-button-unassign-course" type="submit">
97 <?php _e( 'Remove', 'learnpress' ); ?>
98 </button>
99 <span class="percent" style="margin-left: 10px"></span>
100 <span class="message" style="margin-left: 10px"></span>
101 </div>
102 </form>
103 </div>
104 </div>
105