/**
  * construct method to add some settings and hooks
  */
 public function __construct()
 {
     $args = array('slug' => 'control', 'name' => __('Control', 'altctrl-public-group'), 'visibility' => 'private', 'nav_item_position' => 91, 'enable_nav_item' => false, 'screens' => array('admin' => array('enabled' => false), 'create' => array('enabled' => false), 'edit' => array('enabled' => $this->is_public_group())));
     parent::init($args);
     $this->setup_hooks();
     $this->register_post_type();
 }
示例#2
0
 public function __construct()
 {
     global $bp;
     $this->name = __('Group Hierarchy', 'bp-group-hierarchy');
     $this->nav_item_name = apply_filters('bp_group_hierarchy_extension_tab_name', get_site_option('bpgh_extension_nav_item_name', __('Member Groups %d', 'bp-group-hierarchy')), $bp->groups->current_group);
     if (isset($bp->groups->current_group) && $bp->groups->current_group) {
         $this->nav_item_name = str_replace('%d', '<span>%d</span>', $this->nav_item_name);
         // Only count subgroups if admin has a placeholder in the nav item name
         if (strpos($this->nav_item_name, '%d') !== FALSE) {
             $this->nav_item_name = sprintf($this->nav_item_name, BP_Groups_Hierarchy::get_total_subgroup_count($bp->groups->current_group->id));
         }
     }
     $this->slug = BP_GROUP_HIERARCHY_SLUG;
     if (isset($_COOKIE['bp_new_group_parent_id'])) {
         $bp->group_hierarchy->new_group_parent_id = $_COOKIE['bp_new_group_parent_id'];
         add_action('bp_after_group_details_creation_step', array(&$this, 'add_parent_selection'));
     }
     $this->create_step_position = 6;
     $this->nav_item_position = 61;
     $this->subgroup_permission_options = array('anyone' => __('Anybody', 'bp-group-hierarchy'), 'noone' => __('Nobody', 'bp-group-hierarchy'), 'group_members' => __('only Group Members', 'bp-group-hierarchy'), 'group_admins' => __('only Group Admins', 'bp-group-hierarchy'));
     $bp->group_hierarchy->subgroup_permission_options = $this->subgroup_permission_options;
     if (isset($bp->groups->current_group) && $bp->groups->current_group) {
         $bp->groups->current_group->can_create_subitems = bp_group_hierarchy_can_create_subgroups();
     }
     $this->enable_nav_item = $this->enable_nav_item();
     // BP 1.8+ initiation process -- for future compatibility
     if (method_exists($this, 'init')) {
         $args = array('name' => $this->name, 'slug' => BP_GROUP_HIERARCHY_SLUG, 'enable_nav_item' => $this->enable_nav_item(), 'nav_item_name' => $this->nav_item_name, 'nav_item_position' => $this->nav_item_position, 'screens' => array('create' => array('position' => $this->create_step_position), 'edit' => array('name' => $this->name)));
         parent::init($args);
     }
 }
 function __construct()
 {
     global $bp, $wpmudev_chat;
     $wpmudev_chat->load_configs();
     $this->create_step_position = 21;
     $this->nav_item_position = 31;
     $this->slug = $wpmudev_chat->get_option('bp_menu_slug', 'global');
     $this->name = $wpmudev_chat->get_option('bp_menu_label', 'global');
     $this->enable_nav_item = false;
     if (isset($bp->groups->current_group->id)) {
         if (groups_is_user_member($bp->loggedin_user->id, $bp->groups->current_group->id)) {
             // First check if the old value
             $enabled = groups_get_groupmeta($bp->groups->current_group->id, 'wpmudevchatbpgroupenable');
             if (!empty($enabled)) {
                 echo "here!<br />";
                 groups_delete_groupmeta($bp->groups->current_group->id, 'wpmudevchatbpgroupenable');
                 groups_update_groupmeta($bp->groups->new_group_id, self::settings_slug . '_enable', $enabled);
             }
             $enabled = groups_get_groupmeta($bp->groups->current_group->id, self::settings_slug . '_enable', true);
             if ($enabled == "yes") {
                 $this->enable_nav_item = true;
             }
         }
     }
     $args = array('slug' => $this->slug, 'name' => $this->name, 'enable_nav_item' => $this->enable_nav_item, 'nav_item_position' => $this->nav_item_position, 'screens' => array('edit' => array('name' => $this->name, 'submit_text' => __('Submit', $wpmudev_chat->translation_domain)), 'create' => array('position' => $this->create_step_position)));
     parent::init($args);
 }
 public function __construct()
 {
     global $bp;
     if (method_exists($this, 'init')) {
         $args = array('name' => __('Course', 'vibe'), 'slug' => BP_COURSE_SLUG, 'enable_nav_item' => false, 'screens' => array('edit' => array('submit_text' => __('Save Course Settings', 'vibe'), 'screen_callback' => array($this, 'manage_course_settings'), 'screen_save_callback' => array($this, 'save_course_settings'))));
         parent::init($args);
     }
 }
 /**
  * Initialises this object
  *
  * @return void
  */
 function __construct()
 {
     // init vars with something sensible
     $name = __('Papers', 'social-paper');
     $slug = 'papers';
     $pos = 31;
     // init setup array
     $args = array('name' => $name, 'slug' => $slug, 'nav_item_position' => $pos, 'enable_create_step' => false);
     // init
     parent::init($args);
 }
示例#6
0
 /**
  * Your __construct() method will contain configuration options for
  * your extension, and will pass them to parent::init()
  */
 function __construct()
 {
     $args = array('slug' => 'group-cover', 'name' => __('Cover Photo', 'bpcp'), 'access' => 'noone', 'show_tab' => 'noone', 'screens' => array('create' => array('position' => '21')));
     parent::init($args);
     add_action('bp_before_group_header', array($this, 'add_cover'), 20);
     //inject custom css class to body
     add_filter('body_class', array($this, 'get_body_class'), 30);
     //add css for background change
     add_action('wp_head', array($this, 'inject_css'));
     add_action('wp_print_scripts', array($this, 'inject_js'));
     add_action('wp_ajax_bpcp_delete_group_cover', array($this, 'ajax_delete_current_cover'));
 }
 /**
  * Here you can see more customization of the config options
  */
 function __construct()
 {
     global $buddyforms, $buddyforms_user_can;
     $buddyforms_pig = get_option('buddyforms_pig_options');
     $this->post_in_group_form_slug = groups_get_groupmeta(bp_get_current_group_id(), '_bf_pig_form_slug', true);
     $this->buddyforms_pig = groups_get_groupmeta(bp_get_current_group_id(), '_buddyforms_pig', true);
     $buddyforms_user_can = false;
     //$this->enable_create_step       = false;
     $form_slug = $this->post_in_group_form_slug;
     $name = $buddyforms[$form_slug]['name'];
     if (isset($this->buddyforms_pig['create'])) {
         switch ($this->buddyforms_pig['create']) {
             case 'admin':
                 if (groups_is_user_admin(bp_loggedin_user_id(), bp_get_current_group_id())) {
                     $buddyforms_user_can = true;
                 }
                 break;
             case 'mod':
                 if (groups_is_user_mod(bp_loggedin_user_id(), bp_get_current_group_id()) || groups_is_user_admin(bp_loggedin_user_id(), bp_get_current_group_id())) {
                     $buddyforms_user_can = true;
                 }
                 break;
             case 'member':
             default:
                 if (groups_is_user_member(bp_loggedin_user_id(), bp_get_current_group_id())) {
                     $buddyforms_user_can = true;
                 }
                 break;
         }
     }
     $args = array('slug' => $form_slug, 'name' => $name);
     switch ($buddyforms_pig['permission']) {
         case 'all':
             add_action('bp_after_group_settings_admin', array($this, 'bp_pig_after_group_manage_members_admin'), 1, 1);
             add_action('groups_group_settings_edited', array($this, 'bf_pig_groups_group_settings_edited'), 10, 1);
             add_action('bp_after_group_settings_creation_step', array($this, 'bp_pig_after_group_manage_members_admin'), 1, 1);
             add_action('groups_create_group_step_save_group-settings', array($this, 'bf_pig_groups_group_settings_edited'), 10, 1);
             break;
         case 'group-admin':
             add_action('bp_after_group_settings_admin', array($this, 'bp_pig_after_group_manage_members_admin'), 1, 1);
             add_action('groups_group_settings_edited', array($this, 'bf_pig_groups_group_settings_edited'), 10, 1);
             break;
         case 'admin':
             if (is_super_admin()) {
                 add_action('bp_after_group_settings_admin', array($this, 'bp_pig_after_group_manage_members_admin'), 1, 1);
                 add_action('groups_group_settings_edited', array($this, 'bf_pig_groups_group_settings_edited'), 10, 1);
             }
             break;
     }
     parent::init($args);
 }
 public function __construct()
 {
     $class_name = get_class($this);
     $args = array('name' => $class_name, 'slug' => sanitize_title($class_name), 'access' => 'noone', 'show_tab' => 'noone');
     parent::init($args);
 }
 /**
  * construct method to add some settings and hooks
  *
  * @uses buddydrive_get_name() to get the plugin name
  * @uses buddydrive_get_slug() to get the plugin slug
  */
 public function __construct()
 {
     $args = array('slug' => buddydrive_get_slug(), 'name' => buddydrive_get_name(), 'visibility' => 'private', 'nav_item_position' => 31, 'enable_nav_item' => $this->enable_nav_item(), 'screens' => array('admin' => array('metabox_context' => 'side', 'metabox_priority' => 'core'), 'create' => array('enabled' => false), 'edit' => array('enabled' => true)));
     parent::init($args);
 }
 /**
  * RW_Group_Blogs_Extension constructor.
  *
  * @since    0.0.1
  * @access  public
  * @static
  */
 function __construct()
 {
     $args = array('slug' => 'rw-external-blog-feeds', 'name' => __('External Blogs', RW_Group_Blogs::$textdomain), 'enable_nav_item' => false);
     parent::init($args);
 }
示例#11
0
 function __construct()
 {
     // Provide arguments used by the groups API
     $args = array('visibility' => 'private', 'screens' => array('create' => array('enabled' => true, 'name' => 'Guild Leader', 'slug' => 'leader', 'create_step_position' => 99), 'edit' => array('enabled' => false), 'admin' => array('enabled' => false)));
     // Pass the args back to the groups API
     parent::init($args);
 }
 /**
  * Registers the Rendez-vous group extension and sets some globals
  *
  * @package Rendez Vous
  * @subpackage Groups
  *
  * @since Rendez Vous (1.1.0)
  *
  * @uses buddypress()                         to get the BuddyPress instance
  * @uses Rendez_Vous_Group->enable_nav_item() to display or not the Rendez-vous nav item for the group
  * @uses BP_Group_Extension::init()
  */
 public function init_vars()
 {
     $bp = buddypress();
     $args = array('slug' => rendez_vous()->get_component_slug(), 'name' => rendez_vous()->get_component_name(), 'visibility' => 'public', 'nav_item_position' => 80, 'enable_nav_item' => $this->enable_nav_item(), 'screens' => array('admin' => array('enabled' => true, 'metabox_context' => 'side', 'metabox_priority' => 'core'), 'create' => array('position' => 80, 'enabled' => true), 'edit' => array('position' => 80, 'enabled' => true)));
     parent::init($args);
 }
 /**
  * Your __construct() method will contain configuration options for 
  * your extension, and will pass them to parent::init()
  */
 function __construct()
 {
     $categoryId = $this->getRelatedCategory();
     $args = array('slug' => 'cm-answers', 'name' => CMA_Labels::getLocalized('Questions'), 'enable_nav_item' => !empty($categoryId));
     parent::init($args);
 }
 public function __construct()
 {
     $class_name = get_class($this);
     $args = array('name' => $class_name, 'slug' => sanitize_title($class_name));
     parent::init($args);
 }
 function __construct()
 {
     $args = array('slug' => ccgn_get_slug(), 'name' => 'Narratives', 'access' => 'anyone', 'show_tab' => ccgn_is_enabled() ? 'anyone' : 'noone', 'nav_item_position' => 105, 'nav_item_name' => ccgn_get_tab_label(), 'screens' => array('edit' => array('enabled' => true), 'create' => array('enabled' => false), 'admin' => array('enabled' => false)));
     parent::init($args);
 }
 /**
  * Here you can see more customization of the config options
  */
 function __construct()
 {
     $args = array('slug' => 'projects', 'name' => 'Projects', 'nav_item_position' => 105, 'screens' => array('edit' => array('name' => 'Projects', 'submit_text' => 'Submit, submit'), 'create' => array('position' => 100)));
     parent::init($args);
 }
示例#17
0
 function __construct()
 {
     $args = array('slug' => 'group-cover', 'name' => __('Cover Photo', 'bp-profile-cover'), 'visibility' => 'noone', 'enable_nav_item' => false, 'screens' => array('admin' => array('metabox_context' => 'side', 'metabox_priority' => 'core'), 'create' => array('enabled' => false), 'edit' => array('enabled' => true)));
     parent::init($args);
 }
 public function __construct()
 {
     //$is_enabled = mpp_is_active_component( 'groups' );
     $args = array('slug' => MPP_GALLERY_SLUG, 'name' => __('Gallery', 'mediapress'), 'visibility' => 'public', 'nav_item_position' => 80, 'nav_item_name' => __('Gallery', 'mediapress'), 'enable_nav_item' => mpp_group_is_gallery_enabled(), 'screens' => array('create' => array('enabled' => false), 'edit' => array('enabled' => false), 'admin' => array('enabled' => false)));
     parent::init($args);
 }
示例#19
0
 /**
  * Registers the IdeaStream group extension and sets some globals
  *
  * @package WP Idea Stream
  * @subpackage buddypress/groups
  *
  * @since  2.0.0
  *
  * @uses wp_idea_stream_root_slug() to get the IdeaStream root slug
  * @uses wp_idea_stream_archive_title() to get the IdeaStream archive page title
  * @uses WP_Idea_Stream_Group->enable_nav_item() to display or not the IdeaStream nav item for the group
  * @uses WP_Idea_Stream_Group::groups_activated() to check if BuddyPress group integration setting is on.
  * @uses BP_Group_Extension::init()
  */
 public function init_vars()
 {
     $args = array('slug' => wp_idea_stream_root_slug(), 'name' => wp_idea_stream_archive_title(), 'visibility' => 'public', 'nav_item_position' => 61, 'enable_nav_item' => $this->enable_nav_item(), 'screens' => array('admin' => array('enabled' => self::groups_activated(), 'metabox_context' => 'side', 'metabox_priority' => 'core'), 'create' => array('position' => 61, 'enabled' => self::groups_activated()), 'edit' => array('position' => 61, 'enabled' => self::groups_activated(), 'show_in_admin_bar' => true)));
     /**
      * Used to catch groups to avoid requesting too many times the same groups
      *
      * @var object
      */
     $this->group_ideastream = new StdClass();
     $this->group_ideastream->idea_group = array();
     parent::init($args);
 }