Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/tutor-pro/addons/course-bundle/src/Backend/Menu.php
Keine Baseline-Datei – Diff nur gegen leer.
1
-
1
+
<?php
2
+
/**
3
+
* Manage Course Bundle admin sub menu
4
+
*
5
+
* @package TutorPro\CourseBundle\Backend\Menu
6
+
* @author Themeum <support@themeum.com>
7
+
* @link https://themeum.com
8
+
* @since 2.2.0
9
+
*/
10
+
11
+
namespace TutorPro\CourseBundle\Backend;
12
+
13
+
use TutorPro\CourseBundle\Utils;
14
+
15
+
if ( ! defined( 'ABSPATH' ) ) {
16
+
exit;
17
+
}
18
+
19
+
/**
20
+
* Menu Class
21
+
*
22
+
* @since 2.2.0
23
+
*/
24
+
class Menu {
25
+
26
+
/**
27
+
* Register hooks
28
+
*
29
+
* @since 2.2.0
30
+
*
31
+
* @return void
32
+
*/
33
+
public function __construct() {
34
+
add_action( 'tutor_after_courses_admin_menu', array( $this, 'register_submenu' ) );
35
+
}
36
+
37
+
/**
38
+
* Register submenu
39
+
*
40
+
* @since 2.2.0
41
+
*
42
+
* @return void
43
+
*/
44
+
public function register_submenu() {
45
+
add_submenu_page(
46
+
'tutor-pro',
47
+
__( 'Course Bundles', 'tutor-pro' ),
48
+
__( 'Course Bundles', 'tutor-pro' ),
49
+
'manage_tutor_instructor',
50
+
'course-bundle',
51
+
array( $this, 'bundle_list_page' )
52
+
);
53
+
}
54
+
55
+
/**
56
+
* Bundle List
57
+
*
58
+
* @since 2.2.0
59
+
*
60
+
* @since 3.2.0
61
+
* Loading bundle-builder-init file
62
+
*
63
+
* @return void
64
+
*/
65
+
public static function bundle_list_page() {
66
+
if ( Utils::is_bundle_editor() ) {
67
+
echo '
68
+
<style>
69
+
#wpadminbar {
70
+
z-index: 9999;
71
+
position: fixed;
72
+
}
73
+
#adminmenu,
74
+
#adminmenuback,
75
+
#adminmenuwrap,
76
+
#wpfooter {
77
+
display: none !important;
78
+
}
79
+
#wpcontent {
80
+
margin: 0 !important;
81
+
padding: 0 !important;
82
+
}
83
+
#wpbody-content {
84
+
padding-bottom: 0px !important;
85
+
float: none;
86
+
}
87
+
.notice {
88
+
display: none;
89
+
}
90
+
</style>';
91
+
include_once Utils::view_path( 'bundle-builder-init.php' );
92
+
} else {
93
+
wp_safe_redirect( admin_url( 'admin.php?page=tutor' ) );
94
+
}
95
+
}
96
+
}
97
+