-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcbox-openlab-core.php
95 lines (80 loc) · 3.14 KB
/
cbox-openlab-core.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
<?php
/**
* Plugin Name: CBOX-OpenLab Core
* Plugin URI: http://commonsinabox.org
* Description: Core functionality for CBOX-OpenLab
* Text Domain: cbox-openlab-core
* Domain Path: /languages
* Version: 1.6.0
* Network: true
*/
define( 'CBOXOL_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'CBOXOL_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'CBOXOL_PLUGIN_ROOT_FILE', __FILE__ );
define( 'CBOXOL_PLUGIN_VER', '1.6.0-1723126501946' );
define( 'CBOXOL_ASSET_VER', '1.6.0-1723126501946' );
// @todo Organize this in a meaningful way.
function cboxol_init() {
// @todo cbox checks
if ( version_compare( PHP_VERSION, '5.3', '<' ) && current_user_can( 'install_plugins' ) ) {
add_action( 'admin_notices', 'bhssh_php_admin_notice' );
return;
}
// Abort loading if commons-in-a-box is not active.
if ( ! function_exists( 'cbox_is_main_site' ) ) {
return;
}
require dirname( __FILE__ ) . '/autoload.php';
require CBOXOL_PLUGIN_DIR . 'includes/functions.php';
require CBOXOL_PLUGIN_DIR . 'includes/member-types.php';
require CBOXOL_PLUGIN_DIR . 'includes/group-categories.php';
if ( function_exists( 'buddypress' ) && bp_is_active( 'groups' ) ) {
if ( ! class_exists( 'Bp_Customizable_Group_Categories' ) ) {
require CBOXOL_PLUGIN_DIR . 'lib/bp-customizable-group-categories/bp-customizable-group-categories.php';
$bpcgc_plugin = new Bp_Customizable_Group_Categories();
$bpcgc_plugin->run();
}
require CBOXOL_PLUGIN_DIR . 'includes/group-types.php';
require CBOXOL_PLUGIN_DIR . 'includes/group-sites.php';
require CBOXOL_PLUGIN_DIR . 'includes/private-group-membership.php';
}
require CBOXOL_PLUGIN_DIR . 'includes/brand-settings.php';
require CBOXOL_PLUGIN_DIR . 'includes/academic-terms.php';
require CBOXOL_PLUGIN_DIR . 'includes/academic-units.php';
require CBOXOL_PLUGIN_DIR . 'includes/related-links.php';
require CBOXOL_PLUGIN_DIR . 'includes/registration.php';
require CBOXOL_PLUGIN_DIR . 'includes/communication-settings.php';
require CBOXOL_PLUGIN_DIR . 'includes/profile-fields.php';
require CBOXOL_PLUGIN_DIR . 'includes/search.php';
require CBOXOL_PLUGIN_DIR . 'includes/site-template.php';
// @todo Better loading for these libraries.
require CBOXOL_PLUGIN_DIR . 'includes/portfolios.php';
require CBOXOL_PLUGIN_DIR . 'includes/clone.php';
// Upgrades.
add_action(
'cboxol_register_upgrader',
function() {
require CBOXOL_PLUGIN_DIR . 'includes/upgrades.php';
}
);
if ( is_admin() ) {
include CBOXOL_PLUGIN_DIR . 'includes/admin.php';
}
if ( defined( 'WP_CLI' ) && WP_CLI ) {
include CBOXOL_PLUGIN_DIR . 'tools/cli.php';
}
if ( function_exists( 'bbpress' ) ) {
require CBOXOL_PLUGIN_DIR . 'plugins/bbpress.php';
}
if ( function_exists( 'pressforward' ) ) {
require CBOXOL_PLUGIN_DIR . 'plugins/pressforward.php';
}
$ver = get_site_option( 'cboxol_ver' );
if ( ! empty( $ver ) ) {
require CBOXOL_PLUGIN_DIR . 'includes/network-toolbar.php';
}
// Must wait until WP is set up.
remove_action( 'after_switch_theme', '_wp_sidebars_changed' );
add_action( 'after_switch_theme', 'cboxol_maybe_install', 200 );
}
add_action( 'plugins_loaded', 'cboxol_init' );