-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPlugin.php
More file actions
85 lines (77 loc) · 2.59 KB
/
Copy pathPlugin.php
File metadata and controls
85 lines (77 loc) · 2.59 KB
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
<?php
namespace Barn2\Plugin\Document_Library;
use Barn2\Plugin\Document_Library\Dependencies\Lib\Plugin\Simple_Plugin;
use Barn2\Plugin\Document_Library\Dependencies\Lib\Util;
use Barn2\Plugin\Document_Library\Dependencies\Lib\Admin\Help_Scout_Beacon;
use Barn2\Plugin\Document_Library\Admin\Wizard\Setup_Wizard;
/**
* The main plugin class.
*
* @package Barn2\document-library-lite
* @author Barn2 Plugins <support@barn2.com>
* @license GPL-3.0
* @copyright Barn2 Media Ltd
*/
class Plugin extends Simple_Plugin {
const NAME = 'Document Library Lite';
const ITEM_ID = 425625;
/**
* Services array.
*
* @var array $services
*/
private $services;
/**
* Constructs and initializes the Document Library plugin instance.
*
* @param string $file The main plugin __FILE__
* @param string $version The current plugin version
*/
public function __construct( $file = null, $version = '1.0' ) {
parent::__construct(
[
'id' => self::ITEM_ID,
'name' => self::NAME,
'version' => $version,
'file' => $file,
'settings_path' => 'admin.php?page=document_library',
'documentation_path' => 'kb/document-library-wordpress-documentation/?utm_source=settings&utm_medium=settings&utm_campaign=settingsinline&utm_content=dlw-settings',
]
);
}
/**
* Load the plugin.
*/
public function maybe_load_plugin() {
// Don't load plugin if Pro version active
if ( ! Util::is_barn2_plugin_active( '\\Barn2\\Plugin\\Document_Library_Pro\\document_library_pro' ) ) {
add_action( 'after_setup_theme', [ $this, 'start_standard_services' ] );
}
}
public function add_services() {
$this->add_service( 'plugin_setup', new Plugin_Setup( $this->get_file(), $this ), true );
$this->add_service( 'ajax_handler', new Table\Ajax_Handler() );
$this->add_service( 'wizard', new Setup_Wizard( $this ) );
$this->add_service( 'post_type', new Post_Type() );
$this->add_service( 'taxonomies', new Taxonomies() );
$this->add_service( 'shortcode', new Document_Library_Shortcode() );
$this->add_service( 'scripts', new Frontend_Scripts( $this ) );
$this->add_service( 'review_notice', new Review_Notice( $this ) );
$this->add_service( 'admin', new Admin\Admin_Controller( $this ) );
$this->add_service(
'helpscout_beacon',
new Help_Scout_Beacon(
$this,
[
'plugin_slug' => 'document-library-pro',
'screen_hooks' => [
'toplevel_page_document_library',
'documents_page_dlp_import',
'documents_page_dll_protect',
],
'capability' => 'manage_options',
]
)
);
}
}