-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtutor-lms-gotipath-integration.php
122 lines (111 loc) · 2.96 KB
/
tutor-lms-gotipath-integration.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
/**
* Plugin Name: Tutor LMS Gotipath Integration
* Plugin URI: https://github.com/GotipathTeam/tutor-lms-gotipath-integration
* Description: Tutor LMS Gotipath integration allows you to host your lesson videos on Tutor LMS using Gotipath Stream. Use this integration to load up and play your meticulously crafted course videos to enhance the experience for students.
* Author: Gotipath
* Version: 1.0.0
* Author URI: https://gotipath.com
* Requires at least: 5.3
* Tested up to: 6.4
* License: GPLv3
* Text Domain: tutor-lms-gotipath-integration
* Domain Path: /languages
*
* @package TutorLMSGotipathIntegration
*/
use Tutor\GotipathIntegration\AdminNotice\AdminNotice;
use Tutor\GotipathIntegration\Integration\Gotipath;
if (!class_exists('TutorLMSGotipathIntegration')) {
/**
* PluginStarter main class that trigger the plugin
*/
final class TutorLMSGotipathIntegration
{
/**
* Plugin meta data
*
* @since v1.0.0
*
* @var $plugin_data
*/
private static $meta_data = array();
/**
* Plugin instance
*
* @since v1.0.0
*
* @var $instance
*/
public static $instance = null;
/**
* Register hooks and load dependent files
*
* @since v1.0.0
*
* @return void
*/
public function __construct()
{
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
include_once __DIR__ . '/vendor/autoload.php';
}
add_action('plugins_loaded', array($this, 'load_packages'));
add_action('init', array(__CLASS__, 'load_textdomain'));
}
/**
* Plugin meta data
*
* @since v1.0.0
*
* @return array contains plugin meta data
*/
public static function meta_data()
{
self::$meta_data['tutor_req_ver'] = '2.1.2';
self::$meta_data['url'] = plugin_dir_url(__FILE__);
self::$meta_data['path'] = plugin_dir_path(__FILE__);
self::$meta_data['basename'] = plugin_basename(__FILE__);
self::$meta_data['templates'] = trailingslashit(plugin_dir_path(__FILE__) . 'templates');
self::$meta_data['views'] = trailingslashit(plugin_dir_path(__FILE__) . 'views');
self::$meta_data['assets'] = trailingslashit(plugin_dir_url(__FILE__) . 'assets');
return self::$meta_data;
}
/**
* Create and return instance of this plugin
*
* @return self instance of plugin
*/
public static function instance()
{
if (null === self::$instance) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Load packages
*
* @return void
*/
public function load_packages()
{
// If tutor is not active then load notice only.
new AdminNotice();
if (function_exists('tutor') && AdminNotice::is_tutor_core_has_req_version()) {
new Gotipath();
}
}
/**
* Load plugin text domain
*
* @return void
*/
public static function load_textdomain()
{
load_plugin_textdomain('easy-poll', false, plugin_dir_path(__FILE__) . 'languages/');
}
}
// trigger.
TutorLMSGotipathIntegration::instance();
}