Example #1
0
 public function getFilters($context, $fallback = array())
 {
     if (isset($this->constants['class_filters']) && class_exists($this->constants['class_filters'])) {
         $filtred = gPluginFactory::get($this->constants['class_filters']);
         return $filtred->get($context, $fallback);
     }
     return $fallback;
 }
Example #2
0
 public function setup_globals($constants = array(), $args = array())
 {
     $this->current_blog = get_current_blog_id();
     $this->option_group = isset($args['option_group']) ? $args['option_group'] : 'gpluginsettings';
     $this->page = isset($args['page']) && $args['page'] ? $args['page'] : 'general';
     $this->constants = array_merge(array('plugin_dir' => GPLUGIN_DIR, 'plugin_url' => GPLUGIN_URL, 'class_filters' => 'gPluginFiltersCore'), $constants);
     $this->args = array_merge(array('plugin_class' => FALSE, 'plugin_args' => array(), 'settings_sanitize' => NULL, 'field_callback' => FALSE, 'site_options' => FALSE, 'register_hook' => FALSE), $args);
     $this->options = self::get_options();
     $this->enabled = isset($this->options['enabled']) ? $this->options['enabled'] : FALSE;
     // for something like old gMember Restricted class
     // when we have to initiate a plugin module if enabled option
     if ($this->enabled && class_exists($this->args['plugin_class'])) {
         gPluginFactory::get($this->args['plugin_class'], $this->constants, $this->args['plugin_args']);
     }
 }
Example #3
0
function gmember_init($gplugin_version = NULL)
{
    global $gMemberNetwork;
    if (!$gplugin_version || !version_compare($gplugin_version, GMEMBER_VERSION_GPLUGIN, '>=')) {
        return;
    }
    $includes = array('network', 'filtered', 'signup', 'login', 'profile', 'widgets', 'admin', 'social', 'cleanup', 'buddypress');
    foreach ($includes as $file) {
        if (file_exists(GMEMBER_DIR . 'includes/' . $file . '.class.php')) {
            require_once GMEMBER_DIR . 'includes/' . $file . '.class.php';
        }
    }
    $args = array('domain' => 'gmember', 'title' => __('gMember', GMEMBER_TEXTDOMAIN), 'network' => TRUE, 'logger_args' => array('name' => __('Logs', GMEMBER_TEXTDOMAIN), 'post_type' => 'gmember_log', 'taxonomy' => 'gmember_log_type', 'meta_prefix' => '_gmember_log_', 'hook_prefix' => 'gmember_log_', 'types' => array('email')));
    $constants = array('plugin_dir' => GMEMBER_DIR, 'plugin_url' => GMEMBER_URL, 'plugin_ver' => GMEMBER_VERSION, 'plugin_vdb' => GMEMBER_VERSION_DB, 'class_filters' => 'gMemberFiltered', 'theme_templates_dir' => 'gmember-templates', 'class_network_settings' => 'gMemberNetworkSettings', 'meta_key' => '_gmember', 'term_meta_key' => '_gmember', 'root_meta_key' => '_gmember_root', 'remote_meta_key' => '_gmember_remote', 'meta_register_ip' => 'register_ip', 'meta_lastlogin' => 'lastlogin', 'meta_disable_user' => 'disable_user', 'meta_disable_password_reset' => 'disable_password_reset', 'meta_approved_user' => 'approved_user');
    if (class_exists('gPluginFactory')) {
        $gMemberNetwork = gPluginFactory::get('gMemberNetwork', $constants, $args);
    }
}
Example #4
0
 public function bp_include()
 {
     $this->buddypress = gPluginFactory::get('gMemberBuddyPress', $this->constants, $this->args);
 }