function bp_gtm_init() { global $bp; require dirname(__FILE__) . '/bp-gtm-core.php'; $bp->loggedin_user->gtm_access = bp_gtm_get_user_roles(); register_deactivation_hook(__FILE__, 'bp_gtm_deactivation'); $file_data = bp_gtm_get_file_data(GTM_DIR . '/bp-gtm.php', array()); $bp_gtm['deactivate'] = 'only'; $bp_gtm['mce'] = 'on'; $bp_gtm['p_todo'] = 'on'; $bp_gtm['display_activity'] = 'on'; $bp_gtm['display_activity_discuss'] = 'on'; $bp_gtm['groups'] = 'all'; $bp_gtm['groups_own_roles'] = 'none'; $bp_gtm['files'] = 'off'; $bp_gtm['files_count'] = '3'; $bp_gtm['files_size'] = '500'; $bp_gtm['files_types'] = array('zip', 'rar', '7z', 'pdf', 'djvu', 'txt', 'gif', 'jpeg', 'jpg', 'png'); $bp_gtm['db_version'] = '1'; $bp_gtm['theme'] = 'gtm'; $bp_gtm['label_gtm_system'] = __('ToDo', 'bp_gtm'); $bp_gtm['label_assignments'] = __('Assignments', 'bp_gtm'); $bp_gtm['def_g_role'] = 4; $bp_gtm['def_admin_g_role'] = 1; add_option('bp_gtm', $bp_gtm, '', 'yes'); $bp_gtm_actions['role'] = 'on'; add_option('bp_gtm_actions', $bp_gtm_actions, '', 'yes'); }
<?php /* * Register some ABS GTM_ Globals */ define('GTM_DIR', dirname(__FILE__)); // without trailing slash define('GTM_URL', plugin_dir_url(__FILE__)); // with trailing slash define('GTM_THEME_DIR', dirname(__FILE__) . '/templates'); // without trailing slash $file_data = bp_gtm_get_file_data(GTM_DIR . '/bp-gtm.php', array()); define('GTM_VERSION', $file_data['Version']); define('GTM_DB_VERSION', $file_data['DBVersion']); /* * Load textdomain for i18n */ load_plugin_textdomain('bp_gtm', false, dirname(plugin_basename(__FILE__)) . '/langs/'); require_once GTM_DIR . '/bp-gtm-admin.php'; require_once GTM_DIR . '/bp-gtm-cssjs.php'; require_once GTM_DIR . '/bp-gtm-functions.php'; require_once GTM_DIR . '/bp-gtm-filters.php'; require_once GTM_DIR . '/bp-gtm-notifications.php'; class BP_GTM extends BP_Group_Extension { function __construct() { global $bp; $bp_gtm = get_option('bp_gtm'); $bp_gtm_group = get_option('bp_gtm_g_' . $bp->groups->current_group->id . '_settings'); $this->name = esc_html(empty($bp_gtm_group['tab-name']) ? $bp_gtm['label_gtm_system'] : $bp_gtm_group['tab-name']);