/**
  * PHP 5 constructor
  *
  * @package BuddyPress Docs
  * @since 1.0-beta
  */
 function __construct()
 {
     bp_register_group_extension('BP_Docs_Group_Extension');
     // Filter some properties of the query object
     add_filter('bp_docs_get_item_type', array($this, 'get_item_type'));
     add_filter('bp_docs_get_current_view', array($this, 'get_current_view'), 10, 2);
     add_filter('bp_docs_this_doc_slug', array($this, 'get_doc_slug'));
     // Taxonomy helpers
     add_filter('bp_docs_taxonomy_get_item_terms', array($this, 'get_group_terms'));
     add_action('bp_docs_taxonomy_save_item_terms', array($this, 'save_group_terms'));
     // Filter the core user_can_edit function for group-specific functionality
     add_filter('bp_docs_user_can', array($this, 'user_can'), 10, 3);
     // Add group-specific settings to the doc settings box
     add_filter('bp_docs_doc_settings_markup', array($this, 'doc_settings_markup'));
     // Filter the activity actions for group docs-related activity
     add_filter('bp_docs_activity_action', array($this, 'activity_action'), 10, 5);
     add_filter('bp_docs_comment_activity_action', array($this, 'comment_activity_action'), 10, 5);
     // Filter the activity hide_sitewide parameter to respect group privacy levels
     add_filter('bp_docs_hide_sitewide', array($this, 'hide_sitewide'), 10, 5);
     // These functions are used to keep the group Doc count up to date
     add_filter('bp_docs_doc_saved', array($this, 'update_doc_count'));
     add_filter('bp_docs_doc_deleted', array($this, 'update_doc_count'));
     // Sneak into the nav before it's rendered to insert the group Doc count. Hooking
     // to bp_actions because of the craptastic nature of the BP_Group_Extension loader
     add_action('bp_actions', array($this, 'show_doc_count_in_tab'), 9);
     // Prettify the page title
     add_filter('bp_page_title', array($this, 'page_title'));
 }
Exemplo n.º 2
0
 /**
  * Constructor
  *
  * @package CollabPress
  * @subpackage CP BP
  * @since 1.2
  */
 function __construct()
 {
     global $bp;
     parent::start('collabpress', __('CollabPress', 'collabpress'), COLLABPRESS_PLUGIN_DIR);
     // Register ourselves as an active BP component
     $bp->active_components['collabpress'] = '1';
     add_filter('bp_get_template_stack', array($this, 'add_cp_to_template_stack'));
     // Register BP-specific taxonomies
     $this->register_taxonomies();
     // Set up the CP query
     add_action('cp_bp_setup_item', array(&$this, 'do_cp_query'), 5);
     // Load the notification framework
     require_once COLLABPRESS_PLUGIN_DIR . 'includes/cp-bp-notifications.php';
     // Load the Groups integration, if active
     if (bp_is_active('groups')) {
         require_once COLLABPRESS_PLUGIN_DIR . 'includes/cp-bp-groups.php';
         bp_register_group_extension('CP_BP_Group_Extension');
     }
     // Add the admin menus
     add_action('cp_after_advanced_settings', array(&$this, 'render_settings'));
     // Todo: this MUST check to see whether we're in a BP context!!
     add_filter('cp_calendar_permalink', array($this, 'filter_cp_calendar_permalink'), 10, 4);
     add_filter('post_type_link', array(&$this, 'filter_permalinks'), 10, 4);
     add_filter('cp_task_list_link', array(&$this, 'filter_item_link'), 10, 3);
     add_filter('cp_task_link', array(&$this, 'filter_item_link'), 10, 3);
     add_action('cp_project_added', array(&$this, 'mark_post_in_group'));
     add_action('wp_print_styles', array(&$this, 'enqueue_styles'));
 }
function buddyforms_pig_init()
{
    $buddyforms_pig = get_option('buddyforms_pig_options');
    require dirname(__FILE__) . '/includes/functions.php';
    if ($buddyforms_pig['permission'] != 'disabled') {
        require dirname(__FILE__) . '/includes/buddyforms-post-in-groups.php';
        bp_register_group_extension('BuddyForms_Post_in_Groups');
    }
}
 /**
  *
  * @since    0.0.1
  * @access  public
  * @static
  */
 function init()
 {
     bp_register_group_extension('RW_Group_Blogs_Extension');
     add_action('bp_get_activity_avatar_item_id', array('RW_Group_Blogs_Core', 'activity_avatar_id'));
     add_action('bp_get_activity_avatar_object_groups', array('RW_Group_Blogs_Core', 'activity_avatar_type'));
     add_action('bp_get_activity_avatar_object_activity', array('RW_Group_Blogs_Core', 'activity_avatar_type'));
     add_action('bp_group_activity_filter_options', array('RW_Group_Blogs_Core', 'activity_add_filter'));
     add_action('bp_activity_filter_options', array('RW_Group_Blogs_Core', 'activity_add_filter'));
     add_action('groups_screen_group_home', array('RW_Group_Blogs_Core', 'refetch'));
     add_action('wp_ajax_refetch_groupblogs', array('RW_Group_Blogs_Core', 'ajax_refresh'));
     add_action('rw_group_blogs_cron', array('RW_Group_Blogs_Core', 'cron_refresh'));
 }
function wpmudev_chat_buddypress_init()
{
    if (class_exists('BP_Group_Extension')) {
        if (version_compare(bp_get_version(), "1.8") >= 0) {
            include_once 'buddypress/wpmudec_chat_buddypress_group_1.8.php';
        } else {
            include_once 'buddypress/wpmudec_chat_buddypress_group_1.7.2.php';
        }
        if (class_exists('WPMUDEV_Chat_BuddyPress')) {
            bp_register_group_extension('WPMUDEV_Chat_BuddyPress');
        }
    }
}
 /**
  * Constructor
  *
  * @since 1.0-beta
  */
 function __construct()
 {
     if (class_exists('BP_Group_Extension')) {
         $group_extension_class = apply_filters('bp_docs_group_extension_class_name', 'BP_Docs_Group_Extension');
         bp_register_group_extension($group_extension_class);
     }
     // Filter some properties of the query object
     add_filter('bp_docs_get_item_type', array($this, 'get_item_type'));
     add_filter('bp_docs_get_current_view', array($this, 'get_current_view'), 10, 2);
     add_filter('bp_docs_this_doc_slug', array($this, 'get_doc_slug'));
     add_filter('bp_docs_pre_query_args', array($this, 'pre_query_args'), 10, 2);
     // Taxonomy helpers
     add_filter('bp_docs_taxonomy_get_item_terms', array($this, 'get_group_terms'));
     // Filter the core user_can_edit function for group-specific functionality
     add_filter('bp_docs_user_can', array($this, 'user_can'), 10, 4);
     // Add group-specific options to the access options dropdowns
     add_filter('bp_docs_get_access_options', array($this, 'get_access_options'), 10, 4);
     // Filter the activity actions for group docs-related activity
     add_filter('bp_docs_activity_action', array($this, 'activity_action'), 10, 5);
     add_filter('bp_docs_activity_args', array($this, 'activity_args'), 10, 2);
     add_filter('bp_docs_comment_activity_action', array($this, 'comment_activity_action'), 10, 5);
     // Filter the activity hide_sitewide parameter to respect group privacy levels
     add_filter('bp_docs_hide_sitewide', array($this, 'hide_sitewide'), 10, 5);
     // These functions are used to keep the group Doc count up to date
     add_filter('bp_docs_doc_saved', array($this, 'update_doc_count'));
     add_filter('bp_docs_doc_deleted', array($this, 'update_doc_count'));
     // On non-group Doc directories, add a Groups column
     add_filter('bp_docs_loop_additional_th', array($this, 'groups_th'), 5);
     add_filter('bp_docs_loop_additional_td', array($this, 'groups_td'), 5);
     // On group Doc directories, add the "Unlink from Group" action link
     add_filter('bp_docs_doc_action_links', array($this, 'add_doc_action_unlink_from_group_link'), 10, 2);
     // On group Doc directories, modify the pagination base so that pagination works within the directory.
     add_filter('bp_docs_page_links_base_url', array($this, 'filter_bp_docs_page_links_base_url'), 10, 2);
     // Update group last active metadata when a doc is created, updated, or saved
     add_filter('bp_docs_after_save', array($this, 'update_group_last_active'));
     add_filter('bp_docs_before_doc_delete', array($this, 'update_group_last_active'));
     add_filter('wp_insert_comment', array($this, 'update_group_last_active_comment'), 10, 2);
     // Sneak into the nav before it's rendered to insert the group Doc count. Hooking
     // to bp_actions because of the craptastic nature of the BP_Group_Extension loader
     // @todo Temporarily disabled
     //add_action( 'bp_actions',			array( $this, 'show_doc_count_in_tab' ), 9 );
     // Prettify the page title
     add_filter('bp_page_title', array($this, 'page_title'));
     // Make sure the Create Doc link points to the right place
     add_filter('bp_docs_get_create_link', array($this, 'get_create_link'));
     // When object terms are set, delete the transient
     add_action('set_object_terms', array(&$this, 'delete_transient'), 10, 4);
     // Set the "last directory viewed" cookie when viewing a group docs directory.
     add_action('bp_actions', array($this, 'set_directory_cookie'));
 }
Exemplo n.º 7
0
 function __construct()
 {
     global $rtmedia;
     $options = $rtmedia->options;
     if (isset($options['buddypress_enableOnGroup']) && $options['buddypress_enableOnGroup'] == "1") {
         // return;
         $extension = true;
         if (isset($options['general_enableAlbums']) && $options['general_enableAlbums'] == 0) {
             $extension = false;
         }
         $extension = apply_filters('rtmedia_group_media_extension', $extension);
         if (!$extension) {
             return;
         }
     } else {
         return;
     }
     if (function_exists("bp_is_active") && bp_is_active("groups")) {
         bp_register_group_extension("RTMediaGroupExtension");
     }
 }
Exemplo n.º 8
0
 function __construct()
 {
     global $rtmedia;
     $options = $rtmedia->options;
     if (isset($options['buddypress_enableOnGroup']) && 1 === intval($options['buddypress_enableOnGroup'])) {
         // return;
         $extension = true;
         if (isset($options['general_enableAlbums']) && 0 === intval($options['general_enableAlbums'])) {
             $extension = false;
         }
         $extension = apply_filters('rtmedia_group_media_extension', $extension);
         if (!$extension) {
             return;
         }
     } else {
         return;
     }
     if (function_exists('bp_is_active') && bp_is_active('groups') && class_exists('BP_Group_Extension')) {
         bp_register_group_extension('RTMediaGroupExtension');
     }
 }
                    $term_array = wp_update_term($existing_term_id, 'ccgn_related_groups', $term_args);
                } else {
                    $term_args['slug'] = ccgn_create_taxonomy_slug($group_id);
                    $term_array = wp_insert_term($group_name, 'ccgn_related_groups', $term_args);
                }
            }
            // End "is_enabled" check
            // $towrite = PHP_EOL . 'submitted: ' . print_r($_POST['tax_input']['ccgn_related_groups'], TRUE);
            // $towrite .= PHP_EOL . 'this group term: ' . print_r($term_array['term_id'], TRUE);
            // $fp = fopen('narrative-taxonomy.txt', 'a');
            // fwrite($fp, $towrite);
            // fclose($fp);
            // Next, handle relating the group to the right taxonomy terms
            // Make sure that this group is always included - otherwise once the narrative is created it might disappear from the front end
            // TODO: If only site admins can add terms, we may not want to change this unless the submitter is a site admin.
            $group_relations = ccgn_add_this_group_term($_POST['tax_input']['ccgn_related_groups'], $term_array['term_id']);
            // $towrite = PHP_EOL . 'ready to save: ' . print_r($group_relations, TRUE);
            // $fp = fopen('narrative-taxonomy.txt', 'a');
            // fwrite($fp, $towrite);
            // fclose($fp);
            if (!ccgn_update_categories($group_id, $group_relations) || !ccgn_update_groupmeta($group_id)) {
                // @TODO: This might be returning a false positive error - meta and cat updates are weird.
                bp_core_add_message(__('There was an error updating the Group Narratives settings, please try again.', 'ccgn'), 'error');
            } else {
                bp_core_add_message(__('Group Narratives settings were successfully updated.', 'ccgn'));
            }
            // Redirect to the (possibly) new admin slug
        }
    }
    bp_register_group_extension('CC_Group_Narratives_Extension');
}
			</div><!-- .activity.single-group -->

			<?php 
            do_action('bp_after_group_places_content');
            ?>
			
		<?php 
        }
        ?>
		
		<?php 
    }
    function widget_display()
    {
        return false;
    }
    function enable_nav_item()
    {
        global $bp;
        if (empty($bp->groups->current_group->id)) {
            return false;
        }
        if (groups_get_groupmeta($bp->groups->current_group->id, 'checkins_ok')) {
            return true;
        } else {
            return false;
        }
    }
}
bp_register_group_extension('Bp_Checkins_Group');
Exemplo n.º 11
0
        extract($r, EXTR_SKIP);
        if (empty($score)) {
            return false;
        }
        // First record the activity meta for this particular rating
        bp_activity_update_meta($activity_id, 'bpgr_rating', $score);
        // Then add this item to the list of reviews for this group
        if (!($ratings = groups_get_groupmeta($group_id, 'bpgr_ratings'))) {
            $ratings = array();
        }
        $ratings[$activity_id] = $score;
        // Pull the composite scores and recalculate
        if (!($rating = groups_get_groupmeta($group_id, 'bpgr_rating'))) {
            $avg_score = 0;
        }
        if (!($how_many = (int) groups_get_groupmeta($group_id, 'bpgr_how_many_ratings'))) {
            $how_many = 0;
        }
        $how_many++;
        groups_update_groupmeta($group_id, 'bpgr_how_many_ratings', $how_many);
        $raw_score = 0;
        foreach ($ratings as $score) {
            $raw_score += (int) $score;
        }
        $rating = $raw_score / $how_many;
        groups_update_groupmeta($group_id, 'bpgr_rating', $rating);
        groups_update_groupmeta($group_id, 'bpgr_ratings', $ratings);
    }
}
bp_register_group_extension('BP_Group_Reviews_Extension');
Exemplo n.º 12
0
 /**
  * Instantiate classes for BuddyPress integration
  *
  * @since bbPress (r3395)
  */
 public function setup_components()
 {
     // Always load the members component
     bbpress()->extend->buddypress->members = new BBP_BuddyPress_Members();
     // Create new activity class
     if (bp_is_active('activity')) {
         bbpress()->extend->buddypress->activity = new BBP_BuddyPress_Activity();
     }
     // Register the group extension only if groups are active
     if (bbp_is_group_forums_active() && bp_is_active('groups')) {
         bp_register_group_extension('BBP_Forums_Group_Extension');
     }
 }
    {
        return false;
    }
}
// Determine the BP version. It's been historically difficult in this plugin, so provide
// a fallback when not found
if (defined('BP_VERSION')) {
    $bpges_bp_version = (double) BP_VERSION;
} else {
    // Let's guess
    if (function_exists('bp_is_action_variable')) {
        $bpges_bp_version = (double) '1.5';
    } else {
        $bpges_bp_version = (double) '1.2.10';
    }
}
if ($bpges_bp_version < 1.5) {
    // Pre-1.5 versions of BuddyPress
    // Load the abstraction files, which define the necessary 1.5 functions
    require_once dirname(__FILE__) . '/1.5-abstraction.php';
    // Load the group extension in the legacy fashion
    add_action('init', 'ass_activate_extension');
} else {
    // Load the group extension in the proper fashion
    bp_register_group_extension('Group_Activity_Subscription');
}
function ass_activate_extension()
{
    $extension = new Group_Activity_Subscription();
    add_action("wp", array(&$extension, "_register"), 2);
}
Exemplo n.º 14
0
            _e('No group papers found.', 'social-paper');
            ?>
</p>

		<?php 
        }
        ?>

		</div>

		<?php 
    }
}
// class ends
// register our class
bp_register_group_extension('CACSP_Group_Extension');
/**
 * Register group connection taxonomy.
 *
 * Fires at init:15 to ensure we have a chance to register the 'cacsp_paper' post type first.
 */
function cacsp_register_group_connection_taxonomy()
{
    register_taxonomy('cacsp_paper_group', 'cacsp_paper', array('public' => false));
}
add_action('init', 'cacsp_register_group_connection_taxonomy', 15);
/**
 * Modify `WP_Query` requests for the 'bp_group' param.
 *
 * @param WP_Query Query object, passed by reference.
 */
Exemplo n.º 15
0
        } else {
            ?>
		<p><?php 
            _e('No member groups were found.', 'bp-group-hierarchy');
            ?>
</p>
		<?php 
        }
        ?>
		</div>
		<?php 
        // reset the $groups_template global and continue with the page
        $groups_template = $parent_template;
    }
}
bp_register_group_extension('BP_Groups_Hierarchy_Extension');
/**
 * 
 * Group creation permission / restriction functions
 * 
 */
/**
 * Store the ID of the group the user selected as the parent for group creation
 */
function bp_group_hierarchy_set_parent_id_cookie()
{
    global $bp;
    if (bp_is_groups_component() && $bp->current_action == 'create' && isset($_REQUEST['parent_id']) && $_REQUEST['parent_id'] != 0) {
        if (bp_group_hierarchy_can_create_subgroups($bp->loggedin_user->id, (int) $_REQUEST['parent_id'])) {
            setcookie('bp_new_group_parent_id', (int) $_REQUEST['parent_id'], time() + 1000, COOKIEPATH);
        } else {
                     // old way - delete all feed items matching the group
                 } else {
                     bp_activity_delete(array('item_id' => bp_get_current_group_id(), 'component' => 'groups', 'type' => 'exb'));
                 }
             }
         }
         groups_update_groupmeta(bp_get_current_group_id(), 'fetchtime', $_POST['fetch-time']);
         groups_update_groupmeta(bp_get_current_group_id(), 'blogfeeds', $blog_feeds);
         groups_update_groupmeta(bp_get_current_group_id(), 'bp_groupblogs_lastupdate', gmdate("Y-m-d H:i:s"));
         /* Re-fetch */
         bp_groupblogs_fetch_group_feeds(bp_get_current_group_id());
         bp_core_add_message(__('External blog feeds updated successfully!', 'bp-groups-externalblogs'));
         bp_core_redirect(bp_get_group_permalink(groups_get_current_group()) . '/admin/' . $this->slug);
     }
 }
 bp_register_group_extension('Group_External_Blogs');
 /**
  * Function to fetch group feeds and save RSS entries as BP activity items.
  *
  * @param int $group_id The group ID.
  */
 function bp_groupblogs_fetch_group_feeds($group_id = false)
 {
     if (empty($group_id)) {
         $group_id = bp_get_current_group_id();
     }
     if ($group_id == bp_get_current_group_id()) {
         $group = groups_get_current_group();
     } else {
         $group = new BP_Groups_Group($group_id);
     }
Exemplo n.º 17
0
            return false;
        }
        // gni?
        check_admin_referer('groups_edit_save_' . $this->slug);
        // mise à jour de la config
        $configModifiee = FloraData::getConfigDefautOutil();
        $configModifiee = $this->preparer_config_locale($configModifiee);
        $configModifiee['projet'] = $_POST['mot-cle-projet'];
        foreach ($configModifiee['modules'] as $nomModule => &$active) {
            $cle = 'module-' . $nomModule;
            $active = false;
            if (isset($_POST[$cle])) {
                $active = $_POST[$cle] == 'on';
            }
        }
        /* Mise à jour de la ligne dans la base de données */
        $table = "{$wpdb->prefix}tb_outils_reglages";
        //var_dump($_POST); exit;
        $data = array('enable_nav_item' => $_POST['activation-outil'] == 'true', 'name' => $_POST['nom-outil'], 'prive' => $_POST['confidentialite-outil'] == 'true', 'config' => json_encode($configModifiee));
        $where = array('id_projet' => $id_projet, 'id_outil' => $this->slug);
        $success = $wpdb->update($table, $data, $where);
        if ($success === false) {
            bp_core_add_message(__('There was an error saving, please try again', 'buddypress'), 'error');
        } else {
            bp_core_add_message(__('Settings saved successfully', 'buddypress'));
            bp_core_redirect(bp_get_group_permalink($bp->groups->current_group) . '/admin/' . $this->slug);
        }
    }
}
bp_register_group_extension('FloraData');
Exemplo n.º 18
0
/**
 * Waits for bp_init hook before loading the group extension
 *
 * Let's make sure the group id is defined before loading our stuff
 *
 * @package WP Idea Stream
 * @subpackage buddypress/groups
 *
 * @since  2.0.0
 *
 * @uses bp_register_group_extension() to register the group extension
 */
function wp_idea_stream_register_group_extension()
{
    bp_register_group_extension('WP_Idea_Stream_Group');
}
Exemplo n.º 19
0
    function edit_screen_save($group_id = null)
    {
        global $wpdb, $bp;
        $id_projet = bp_get_current_group_id();
        if (!isset($_POST)) {
            return false;
        }
        // gni?
        check_admin_referer('groups_edit_save_' . $this->slug);
        // mise à jour de la config
        $configModifiee = Forum::getConfigDefautOutil();
        $configModifiee = $this->preparer_config_locale($configModifiee);
        if (is_super_admin()) {
            $configModifiee['ezmlm-php']['list'] = $_POST['list'];
        }
        /* Mise à jour de la ligne dans la base de données */
        $table = "{$wpdb->prefix}tb_outils_reglages";
        //var_dump($_POST); exit;
        $data = array('enable_nav_item' => $_POST['activation-outil'] == 'true', 'name' => $_POST['nom-outil'], 'prive' => $_POST['confidentialite-outil'] == 'true', 'config' => json_encode($configModifiee));
        $where = array('id_projet' => $id_projet, 'id_outil' => $this->slug);
        $success = $wpdb->update($table, $data, $where);
        if ($success === false) {
            bp_core_add_message(__('There was an error saving, please try again', 'buddypress'), 'error');
        } else {
            bp_core_add_message(__('Settings saved successfully', 'buddypress'));
            bp_core_redirect(bp_get_group_permalink($bp->groups->current_group) . '/admin/' . $this->slug);
        }
    }
}
bp_register_group_extension('Forum');
Exemplo n.º 20
0
    }
    function edit_screen()
    {
        global $bp;
        if (!bp_is_group_admin_screen($this->slug)) {
            return false;
        }
        // Attaching the markup via a hook, so that plugins can unhook and replace with
        // their own markup. This is a bit of a hack.
        add_action('bp_groupblog_edit_screen_markup', 'bp_groupblog_signup_blog');
        do_action('bp_groupblog_edit_screen_markup');
    }
    function edit_screen_save()
    {
        if (isset($_POST['save'])) {
            groupblog_edit_settings();
        }
    }
    function display()
    {
    }
    function widget_display()
    {
    }
    function enable_nav_item()
    {
        return bp_is_group() && groups_get_groupmeta(bp_get_current_group_id(), 'groupblog_enable_blog');
    }
}
bp_register_group_extension('BP_Groupblog_Extension');
Exemplo n.º 21
0
 function bp_group_cover_register_group_extension()
 {
     bp_register_group_extension('BP_Group_Cover');
 }
Exemplo n.º 22
0
 /**
  * Load additional BuddyPress classes
  */
 function init()
 {
     // Load the Apoc_Group_Edit class for group administration screens
     if (bp_is_group_create() || bp_is_group_admin_page()) {
         global $group_edit;
         $group_edit = new Apoc_Group_Edit();
     }
     // Groups extensions
     if (class_exists('BP_Group_Extension')) {
         bp_register_group_extension('Apoc_Group_Add_Leader');
     }
 }
Exemplo n.º 23
0
        ?>

			<h3>
				<?php 
        esc_html_e('Projects', 'task_breaker');
        ?>
			</h3>

			<div id="task_breaker-intranet-projects">

				<?php 
        task_breaker_new_project_modal($group_id);
        ?>

				<?php 
        $args = array('meta_key' => 'task_breaker_project_group_id', 'meta_value' => absint($group_id));
        ?>

				<?php 
        task_breaker_project_loop($args);
        ?>

			</div>

		<?php 
        do_action('task_breaker_after_projects_archive');
        return;
    }
}
bp_register_group_extension('Task_Breaker_Projects_Group');
Exemplo n.º 24
0
        global $bp;
        // Group-specific settings always override
        if (!bp_groups_user_can_send_invites()) {
            return false;
        }
        if (invite_anyone_group_invite_access_test() == 'anyone') {
            return true;
        } else {
            return false;
        }
    }
    function widget_display()
    {
    }
}
bp_register_group_extension('BP_Invite_Anyone');
function invite_anyone_catch_group_invites()
{
    global $bp;
    if (BP_INVITE_ANYONE_SLUG == $bp->current_action && isset($bp->action_variables[0]) && 'send' == $bp->action_variables[0]) {
        if (!check_admin_referer('groups_send_invites', '_wpnonce_send_invites')) {
            return false;
        }
        // Send the invites.
        groups_send_invites($bp->loggedin_user->id, $bp->groups->current_group->id);
        bp_core_add_message(__('Group invites sent.', 'buddypress'));
        do_action('groups_screen_group_invite', $bp->groups->current_group->id);
        bp_core_redirect(bp_get_group_permalink($bp->groups->current_group) . BP_INVITE_ANYONE_SLUG);
    }
}
add_action('wp', 'invite_anyone_catch_group_invites', 1);
Exemplo n.º 25
0
    }
    // not in use
    function create_screen()
    {
    }
    function edit_screen()
    {
    }
    function edit_screen_save()
    {
    }
    function widget_display()
    {
    }
}
bp_register_group_extension('BP_GTM');
/*
 * Filter to use template files in plugin's directory
 */
function bp_gtm_load_template_filter($found_template, $templates)
{
    global $bp;
    if ($bp->current_action == $bp->gtm->slug || $bp->current_component == $bp->gtm->slug) {
        foreach ((array) $templates as $template) {
            $path = is_child_theme() ? TEMPLATEPATH : STYLESHEETPATH;
            // different path to themes files
            if (file_exists($path . '/' . $template)) {
                $filtered_templates[] = $path . '/' . $template;
            } else {
                if (file_exists(STYLESHEETPATH . '/gtm/' . $template)) {
                    $filtered_templates[] = STYLESHEETPATH . '/gtm/' . $template;
        {
            echo do_shortcode(sprintf('[cma-questions cat=%d %s]', $this->getRelatedCategory($group_id), CMA_Settings::getOption(CMA_Settings::OPTION_BP_GROUP_SHORTCODE_ATTR)));
        }
        /**
         * settings_screen() is the catch-all method for displaying the content 
         * of the edit, create, and Dashboard admin panels
         */
        function settings_screen($group_id = NULL)
        {
            $categories = CMA_Category::getCategoriesTree(null, 0, $onlyVisible = false);
            $currentCategory = $this->getRelatedCategory();
            $options = '<option value="">-- none --</option>';
            foreach ($categories as $categoryId => $categoryName) {
                $options .= sprintf('<option value="%s"%s>%s</option>', esc_attr($categoryId), selected($categoryId, $currentCategory, false), esc_html($categoryName));
            }
            printf('<p><label for="cma-category">%s</label>
			<select name="cma-category" id="cma-category">%s</select></p>', CMA::__('Related CM Answers category'), $options);
        }
        /**
         * settings_sceren_save() contains the catch-all logic for saving 
         * settings from the edit, create, and Dashboard admin panels
         */
        function settings_screen_save($group_id = NULL)
        {
            if (isset($_POST['cma-category'])) {
                $this->setRelatedCategory($_POST['cma-category']);
            }
        }
    }
    bp_register_group_extension('CMA_BP_Group_Extension');
}
Exemplo n.º 27
0
/**
 * Registers the rendez-vous group's component
 *
 * @package Rendez Vous
 * @subpackage Groups
 *
 * @since Rendez Vous (1.1.0)
 *
 * @uses bp_register_group_extension() to register the group extension
 */
function rendez_vous_register_group_extension()
{
    bp_register_group_extension('Rendez_Vous_Group');
}
        ?>
 &rarr;" id="save" name="save" /></p>
	<?php 
    }
    public function edit_screen_save($group_id = null)
    {
        $bp = buddypress();
        if (!isset($_POST['save'])) {
            return false;
        }
        check_admin_referer('groups_edit_save_' . $this->slug);
        $group_id = $bp->groups->current_group->id;
        $cats = $_POST['blog_cats'];
        if (!bcg_update_categories($group_id, $cats)) {
            bp_core_add_message(__('There was an error updating Group Blog Categories settings, please try again.', 'bcg'), 'error');
        } else {
            bp_core_add_message(__('Group Blog Categories settings were successfully updated.', 'bcg'));
        }
        bp_core_redirect(bp_get_group_permalink($bp->groups->current_group) . '/admin/' . $this->slug);
    }
    public function display($group_id = null)
    {
        /* Use this function to display the actual content of your group extension when the nav item is selected */
    }
    public function widget_display($group_id = null)
    {
    }
}
if (!bcg_is_disabled_for_group()) {
    bp_register_group_extension('BCG_Group_Extension');
}
        /**
         * settings_screen() is the catch-all method for displaying the content 
         * of the edit, create, and Dashboard admin panels
         */
        public function settings_screen($group_id = null)
        {
        }
        /**
         * settings_sceren_save() contains the catch-all logic for saving 
         * settings from the edit, create, and Dashboard admin panels
         */
        public function settings_screen_save($group_id = null)
        {
        }
    }
    bp_register_group_extension('MPP_Group_Gallery_Extension');
}
function mppp_group_enable_form()
{
    if (!mpp_is_active_component('groups')) {
        return;
        //do not show if gallery is not enabled for group component
    }
    ?>
    <div class="checkbox mpp-group-gallery-enable">
		<label><input type="checkbox" name="mpp-enable-gallery" id="mpp-enable-gallery" value="yes" <?php 
    echo checked(1, mpp_group_is_gallery_enabled());
    ?>
/> <?php 
    _e('Enable Gallery', 'mediapress');
    ?>
Exemplo n.º 30
0
 /**
  * Waits for bp_init hook before loading the group extension
  *
  * Let's make sure the group id is defined before loading our stuff
  *
  * @since 1.1.1
  *
  * @uses bp_register_group_extension() to register the group extension
  */
 function buddydrive_register_group_extension()
 {
     bp_register_group_extension('BuddyDrive_Group');
 }