function edit_screen() { global $bp; if (!bp_is_group_admin_screen($this->slug)) { return false; } ?> <p class="desc"><?php _e("Enter RSS feed URL's for blogs you would like to attach to this group. Any future posts on these blogs will show on the group activity stream. Seperate URL's with commas.", 'bp-groups-externalblogs'); ?> </span> <p> <label for="blogfeeds"><?php _e("Feed URL's:", 'bp-groups-externalblogs'); ?> </label> <textarea name="blogfeeds" id="blogfeeds"><?php echo attribute_escape(implode(', ', (array) groups_get_groupmeta($bp->groups->current_group->id, 'blogfeeds'))); ?> </textarea> </p> <input type="submit" name="save" value="<?php _e("Update Feed URL's", 'bp-groups-externalblogs'); ?> " /> <?php wp_nonce_field('groups_edit_save_' . $this->slug); }
function edit_screen() { global $bp; if (!bp_is_group_admin_screen($this->slug)) { return false; } ?> <h2><?php echo esc_attr($this->name); ?> <?php _e('settings for this group.', 'bp-checkins'); ?> </h2> <p> <input type="checkbox" name="_group_checkins_activate" value="1" <?php if (groups_get_groupmeta($bp->groups->current_group->id, 'checkins_ok')) { ?> checked="checked"<?php } ?> > <?php _e('Activate checkins & places for this group', 'bp-checkins'); ?> </p> <input type="submit" name="save" value="<?php _e('Save', 'bp-checkins'); ?> " /> <?php wp_nonce_field('groups_edit_save_' . $this->slug); }
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'); }
/** * Load the js only when needed * * @return bool */ function cfbgr_is_restriction_js() { // Group create if (bp_is_group_create() && bp_is_group_creation_step('group-settings')) { return true; } // Group manage if (bp_is_group() && bp_is_group_admin_screen('group-settings')) { return true; } return false; }
/** * bp_group_documents_group_mod_menu() * * This function catches the url for the moderators' "group admin" screen. * It will check for changes via the bp_group_documents_group_admin_save() function, * and then call the display template. */ function bp_group_documents_group_admin_menu() { //catch the '/groupname/admin/documents' url if (bp_is_group_admin_screen('documents')) { die('and here'); //check if the user is submitting a form, process if neccessary bp_group_documents_group_admin_save(); //load the display template if ('' != locate_template(array('groups/single/home.php'), false)) { bp_core_load_template(apply_filters('groups_template_group_home', 'groups/single/home')); } else { add_action('bp_template_content_header', 'bp_group_documents_group_admin_header'); add_action('bp_template_content', 'bp_group_documents_group_admin_edit'); bp_core_load_template(apply_filters('bp_core_template_plugin', '/groups/single/plugins')); } } }
/** * Check public group's control options and do the needed job */ public function control() { $bp = buddypress(); if (!$this->is_public_group()) { return; } // Append to current group the control settings $hidden_tabs = (array) groups_get_groupmeta($this->group->id, '_altctrl_tabs', true); $this->group->need_request = groups_get_groupmeta($this->group->id, '_altctrl_request', true); // Managing requests if (bp_is_group_admin_screen('membership-requests') && bp_is_item_admin()) { $bp->groups->current_group->status = 'private'; } // Admin or members always have access if (bp_is_item_admin() || groups_is_user_member(bp_loggedin_user_id(), $this->group->id)) { return; } /** Group members only tabs ***************************************************/ // Hide tabs if (!empty($bp->bp_options_nav[$this->group->slug]) && !empty($hidden_tabs)) { foreach (array_keys($bp->bp_options_nav[$this->group->slug]) as $item_tab) { if (!in_array($item_tab, $hidden_tabs)) { continue; } $bp->bp_options_nav[$this->group->slug][$item_tab]['user_has_access'] = false; } } // Redirect if trying to access the page if (!empty($hidden_tabs) && in_array(bp_current_action(), $hidden_tabs)) { bp_core_add_message(__('This area is restricted to group members', 'altctrl-public-group'), 'error'); bp_core_redirect(bp_get_group_permalink($this->group)); } /** Joining group *************************************************************/ if (!empty($this->group->need_request) && is_user_logged_in()) { // first add the request subnav bp_core_new_subnav_item(array('name' => __('Request Membership', 'altctrl-public-group'), 'slug' => 'request-membership', 'parent_url' => bp_get_group_permalink($this->group), 'parent_slug' => $this->group->slug, 'screen_function' => 'groups_screen_group_request_membership', 'position' => 30)); // Then temporarly make the group private. if (bp_is_group_membership_request()) { $bp->groups->current_group->status = 'private'; } } }
public function edit_screen($group_id = null) { if (!bp_is_group_admin_screen($this->slug)) { return false; } ?> <h2><?php echo esc_attr($this->name); ?> </h2> <?php bcg_admin_form(); wp_nonce_field('groups_edit_save_' . $this->slug); ?> <p><input type="submit" value="<?php _e('Save Changes', 'bcg'); ?> →" id="save" name="save" /></p> <?php }
$tpl .= "<a href=\"%s\">%s</a>"; $tpl .= "</li>"; printf($tpl, $url, $name); } ?> </ul> </div><!-- .item-list-tabs --> <form action="<?php bp_group_admin_form_action(); ?> " name="group-settings-form" id="group-settings-form" class="form standard-form" method="post" enctype="multipart/form-data" role="main"> <?php do_action('bp_before_group_admin_content'); foreach ($admin_menu as $url_key => $name) { if (bp_is_group_admin_screen($url_key)) { bp_get_template_part('groups/single/admin/' . $url_key); break; } } do_action('groups_custom_edit_steps'); // Allow plugins to add custom group edit screens /* This is important, don't forget it */ printf('<input type="hidden" name="group-id" id="group-id" value="%d" />', bp_get_group_id()); do_action('bp_after_group_admin_content'); ?> </form><!-- #group-settings-form -->
/** * Maybe map a bbPress forum/topic/reply permalink to the corresponding group * * @param int $post_id * @uses get_post() * @uses bbp_is_reply() * @uses bbp_get_reply_topic_id() * @uses bbp_get_reply_forum_id() * @uses bbp_is_topic() * @uses bbp_get_topic_forum_id() * @uses bbp_is_forum() * @uses get_post_field() * @uses bbp_get_forum_group_ids() * @uses groups_get_group() * @uses bp_get_group_admin_permalink() * @uses bp_get_group_permalink() * @return Bail early if not a group forum post * @return string */ private function maybe_map_permalink_to_group($post_id = 0, $url = false) { switch (get_post_type($post_id)) { // Reply case bbp_get_reply_post_type(): $topic_id = bbp_get_reply_topic_id($post_id); $forum_id = bbp_get_reply_forum_id($post_id); $url_end = trailingslashit($this->reply_slug) . get_post_field('post_name', $post_id); break; // Topic // Topic case bbp_get_topic_post_type(): $topic_id = $post_id; $forum_id = bbp_get_topic_forum_id($post_id); $url_end = trailingslashit($this->topic_slug) . get_post_field('post_name', $post_id); break; // Forum // Forum case bbp_get_forum_post_type(): $forum_id = $post_id; $url_end = ''; //get_post_field( 'post_name', $post_id ); break; // Unknown // Unknown default: return $url; break; } // Get group ID's for this forum $group_ids = bbp_get_forum_group_ids($forum_id); // Bail if the post isn't associated with a group if (empty($group_ids)) { return $url; } // @todo Multiple group forums/forum groups $group_id = $group_ids[0]; $group = groups_get_group(array('group_id' => $group_id)); if (bp_is_group_admin_screen($this->slug)) { $group_permalink = trailingslashit(bp_get_group_admin_permalink($group)); } else { $group_permalink = trailingslashit(bp_get_group_permalink($group)); } return trailingslashit(trailingslashit($group_permalink . $this->slug) . $url_end); }
function inject_js() { if (bp_is_group_admin_screen($this->slug)) { wp_enqueue_script('bpcp-js', plugin_dir_url(__FILE__) . 'bpcp.js', array('jquery')); } }
/** * * @global type $bp_media * @return boolean */ function edit_screen($group_id = NULL) { if (!bp_is_group_admin_screen($this->slug)) { return false; } $current_level = groups_get_groupmeta(bp_get_current_group_id(), 'rt_media_group_control_level'); if (empty($current_level)) { $current_level = "all"; } // HOOK to add PER GROUP MEDIA enable/diable option in rtMedia PRO do_action('rtmedia_group_media_control_edit'); ?> <div class='rtmedia-group-media-settings'> <?php global $rtmedia; $options = $rtmedia->options; if (isset($options['general_enableAlbums']) && $options['general_enableAlbums'] == 1) { // album is enabled ?> <h4><?php _e('Album Creation Control', 'rtmedia'); ?> </h4> <p><?php _e('Who can create Albums in this group?', 'rtmedia'); ?> </p> <div class="radio"> <label> <input name="rt_album_creation_control" type="radio" id="rt_media_group_level_moderators" value="all"<?php checked($current_level, 'all', true); ?> > <strong><?php _e('All Group Members', 'rtmedia'); ?> </strong> </label> <label> <input name="rt_album_creation_control" type="radio" id="rt_media_group_level_moderators" value="moderators" <?php checked($current_level, 'moderators', true); ?> > <strong><?php _e('Group Admins and Mods only', 'rtmedia'); ?> </strong> </label> <label> <input name="rt_album_creation_control" type="radio" id="rt_media_group_level_admin" value="admin" <?php checked($current_level, 'admin', true); ?> > <strong><?php _e('Group Admin only', 'rtmedia'); ?> </strong> </label> </div> <hr> <?php } ?> <?php do_action('rtmedia_playlist_creation_settings_groups_edit'); ?> </div> <input type="submit" name="save" value="<?php _e('Save Changes', 'rtmedia'); ?> " /> <?php wp_nonce_field('groups_edit_save_' . $this->slug); }
/** * * @since 0.0.1 * @access public * @static * @return bool */ function edit_screen($group_id = NULL) { global $bp; if (!bp_is_group_admin_screen($this->slug)) { return false; } $url = bp_get_root_domain(); $group = groups_get_current_group(); $configstr = base64_encode(json_encode(array('group_id' => $group->id, 'url' => $url))); ?> <p><label for"configstr"><?php _e("Config to invite groupmember to blog.", RW_Group_Blogs::$textdomain); ?> </label> <input id="configstr" type="text" value="<?php echo $configstr; ?> "></p> <?php $options = groups_get_groupmeta($group->id, 'rw-group-blogs-blogdata'); $meta = groups_get_groupmeta($bp->groups->current_group->id, 'rw-group-blogs-fetchtime'); $fetch = !empty($meta) ? $meta : '30'; $times = array('10', '15', '20', '30', '60'); echo '<p><label for="fetch-time">'; _e("Refresh time:", RW_Group_Blogs::$textdomain); echo '</label>'; echo "<select id='fetch-time' name='fetch-time'>"; $default = __('Default', RW_Group_Blogs::$textdomain); echo "<option value='30'>{$default}</option>"; foreach ($times as $time) { $selected = $fetch == $time ? 'selected="selected"' : ''; echo "<option value='{$time}' {$selected}>{$time}</option>"; } echo "</select></p>"; ?> <span class="desc"><?php _e("Enter RSS feed URL's for blogs you would like to attach to this group. Any future posts on these blogs will show on the group activity stream. Seperate URL's with commas.", RW_Group_Blogs::$textdomain); ?> </span> <p> <label for="blogfeeds"><?php _e("Feed URL's:", RW_Group_Blogs::$textdomain); ?> </label> <textarea name="blogfeeds" id="blogfeeds"><?php echo attribute_escape(implode(', ', (array) groups_get_groupmeta($bp->groups->current_group->id, 'rw-group-blogs-feeds'))); ?> </textarea> </p> <input type="submit" name="save" value="<?php _e("Update Feed URL's", RW_Group_Blogs::$textdomain); ?> "/> <?php wp_nonce_field('groups_edit_save_' . $this->slug); }
function edit_screen() { global $groups_template; if (!bp_is_group_admin_screen($this->slug)) { return false; } ?> <h2><?php echo attribute_escape($this->name); ?> </h2> <div class="editfield"> <label for=""><?php _e('Group Slug', 'bp-edit-group-slug'); ?> </label> <p><?php _e('This slug has been automatically created from the group name you entered in step 1.', 'bp-edit-group-slug'); ?> </p> <p><?php _e('You can keep it, or change it to something more accurate.', 'bp-edit-group-slug'); ?> </p> <div class="slug-wrapper"> <?php echo $this->get_group_slug_screen($groups_template->group->id); ?> </div> </div> <div class="form-submit"> <input type="submit" name="save" value="<?php _e("Update Slug", 'bp-edit-group-slug'); ?> " /> </div> <?php wp_nonce_field('groups_edit_save_' . $this->slug); }
<?php do_action('bp_after_group_membership_requests_admin'); ?> <?php } ?> <?php do_action('groups_custom_edit_steps'); ?> <?php /* Delete Group Option */ if (bp_is_group_admin_screen('delete-group')) { ?> <?php do_action('bp_before_group_delete_admin'); ?> <div id="message" class="info"> <p><?php _e('WARNING: Deleting this group will completely remove ALL content associated with it. There is no way back, please be careful with this option.', 'buddypress'); ?> </p> </div> <label><input type="checkbox" name="delete-group-understand" id="delete-group-understand" value="1" onclick="if(this.checked) { document.getElementById('delete-group-button').disabled = ''; } else { document.getElementById('delete-group-button').disabled = 'disabled'; }" /> <?php _e('I understand the consequences of deleting this group.', 'buddypress');
/** * Edit screen. * * @param int $group_id The group ID. */ public function edit_screen($group_id = null) { if (!bp_is_group_admin_screen($this->slug)) { return false; } $meta = groups_get_groupmeta(bp_get_current_group_id(), 'fetchtime'); $fetch = !empty($meta) ? $meta : '30'; $times = array('10', '15', '20', '30', '60'); echo '<p><label for="fetch-time">'; _e("Refresh time:", "bp-groups-externalblogs"); echo '</label>'; echo "<select id='fetch-time' name='fetch-time'>"; $default = __('Default', 'buddysuite'); echo "<option value='30'>{$default}</option>"; foreach ($times as $time) { $selected = $fetch == $time ? 'selected="selected"' : ''; echo "<option value='{$time}' {$selected}>{$time}</option>"; } echo "</select></p>"; ?> <span class="desc"><?php _e("Enter RSS feed URL's for blogs you would like to attach to this group. Any future posts on these blogs will show on the group activity stream. Seperate URL's with commas.", 'bp-groups-externalblogs'); ?> </span> <p> <label for="blogfeeds"><?php _e("Feed URL's:", 'bp-groups-externalblogs'); ?> </label> <textarea name="blogfeeds" id="blogfeeds"><?php echo implode(', ', array_map('esc_url', (array) groups_get_groupmeta(bp_get_current_group_id(), 'blogfeeds'))); ?> </textarea> </p> <input type="submit" name="save" value="<?php _e("Update Feed URL's", 'bp-groups-externalblogs'); ?> " /> <?php wp_nonce_field('groups_edit_save_' . $this->slug); ?> <?php }
/** * Si l'outil est désactivé dans la config générale, vide le panneau de * réglages de l'outil et affiche un message à la place des réglages */ protected function controleAccesReglages() { if (!bp_is_group_admin_screen($this->slug) || $this->desactive_globalement) { echo "<p>L'outil " . $this->name . " a été désactivé par l'administrateur du site.</p>"; exit; } }
<?php /** * Fires inside the group admin form and before the content. * * @since 1.1.0 */ do_action('bp_before_group_admin_content'); ?> <?php /* Fetch the template for the current admin screen being viewed */ ?> <?php if (bp_is_group_admin_screen(bp_action_variable())) { ?> <?php bp_get_template_part('groups/single/admin/' . bp_action_variable()); ?> <?php } ?> <?php /** * Fires inside the group admin template. * * Allows plugins to add custom group edit screens.
/** * Reset the week parameter of the WordPress main query if needed * * When cropping an avatar, a $_POST['w'] var is sent, setting the 'week' * parameter of the WordPress main query to this posted var. To avoid * notices, we need to make sure this 'week' query var is reset to 0 * * @since BuddyPress (2.2.0) * * @param WP_Query $posts_query the main query object * @uses bp_is_group_create() * @uses bp_is_group_admin_page() * @uses bp_is_group_admin_screen() to check for a group admin screen * @uses bp_action_variable() to check for the group's avatar creation step * @uses bp_is_user_change_avatar() to check for the user's change profile screen */ function bp_core_avatar_reset_query($posts_query = null) { $reset_w = false; // Group's avatar edit screen if (bp_is_group_admin_page()) { $reset_w = bp_is_group_admin_screen('group-avatar'); // Group's avatar create screen } elseif (bp_is_group_create()) { /** * we can't use bp_get_groups_current_create_step() * as it's not set yet */ $reset_w = 'group-avatar' === bp_action_variable(1); // User's change avatar screen } else { $reset_w = bp_is_user_change_avatar(); } // A user or a group is cropping an avatar if (true === $reset_w && isset($_POST['avatar-crop-submit'])) { $posts_query->set('w', 0); } }
/** * Redirect to the group admin forum edit screen * * @since bbPress (r3653) * @uses groups_get_current_group() * @uses bp_is_group_admin_screen() * @uses trailingslashit() * @uses bp_get_root_domain() * @uses bp_get_groups_root_slug() */ public function edit_redirect_to($redirect_url = '') { // Get the current group, if there is one $group = groups_get_current_group(); // If this is a group of any kind, empty out the redirect URL if (bp_is_group_admin_screen($this->slug)) { $redirect_url = trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/' . $this->slug); } return $redirect_url; }
/** * The routine run after the user clicks Save from your admin tab * * You'll be pulling your data out of the $_POST global. Be sure to * sanitize as necessary. */ function edit_screen_save() { global $bp, $wpdb; if (!bp_is_group_admin_screen($this->slug)) { return false; } if (!isset($_POST['wpmudev_chat_settings_save_wpnonce']) || !wp_verify_nonce($_POST['wpmudev_chat_settings_save_wpnonce'], 'wpmudev_chat_settings_save')) { return false; } // Controls our menu visibility. See the __construct logic. if (isset($_POST[$this->settings_slug . '_enable']) && $_POST[$this->settings_slug . '_enable'] == "on") { $enabled = "yes"; } else { $enabled = "no"; } groups_update_groupmeta($bp->groups->current_group->id, $this->settings_slug . '_enable', $enabled); if (!isset($_POST['chat'])) { return false; } if (groups_is_user_mod($bp->loggedin_user->id, $bp->groups->current_group->id) || groups_is_user_admin($bp->loggedin_user->id, $bp->groups->current_group->id) || is_super_admin()) { $success = $chat_section = false; $chat_settings = $_POST['chat']; if (isset($chat_settings['section'])) { $chat_section = $chat_settings['section']; unset($chat_settings['section']); } $chat_settings['session_type'] = 'bp-group'; $chat_settings['id'] = 'wpmudev-chat-bp-group-' . $bp->groups->current_group->id; $chat_settings['blog_id'] = $wpdb->blogid; groups_update_groupmeta($bp->groups->current_group->id, $this->settings_slug, $chat_settings); /* Insert your edit screen save code here */ $success = true; /* To post an error/success message to the screen, use the following */ if (!$success) { 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); }
/** * Enqueue all the scripts and styles we need. Per proper WP methods. * * @global none * * @param none * * @return none */ function wp_enqueue_scripts() { //global $bp; global $wp_version; if (is_admin()) { return; } //Register Styles And Scripts wp_register_style('wpmudev-chat-style', plugins_url('/css/wpmudev-chat-style.css', __FILE__), array(), $this->chat_current_version); wp_register_style('wpmudev-chat-admin-css', plugins_url('/css/wpmudev-chat-admin.css', __FILE__), array(), $this->chat_current_version); wp_register_style('wpmudev-chat-wpadminbar-style', plugins_url('/css/wpmudev-chat-wpadminbar.css', __FILE__), array(), $this->chat_current_version); if (!version_compare($wp_version, '3.7.1', '>')) { wp_register_style('wpmudev-chat-wpadminbar-style-pre-38', plugins_url('/css/wpmudev-chat-wpadminbar-pre-38.css', __FILE__), array(), $this->chat_current_version); } //Register scripts wp_register_script('wpmudev-chat-js', plugins_url('/js/wpmudev-chat.js', __FILE__), array('jquery'), $this->chat_current_version, true); wp_register_script('wpmudev-chat-admin-js', plugins_url('/js/wpmudev-chat-admin.js', __FILE__), array('jquery'), $this->chat_current_version, true); wp_register_script('wpmudev-chat-admin-farbtastic-js', plugins_url('/js/wpmudev-chat-admin-farbtastic.js', __FILE__), array(), $this->chat_current_version, true); //Facebook Script $locale = get_locale(); $scheme = is_ssl() ? 'https://' : 'http://'; // We use 'facebook-all' to match our Ultimate Facebook plugin which enques the same script. Prevents enque duplication wp_register_script('facebook-all', $scheme . 'connect.facebook.net/' . $locale . '/all.js'); //$_SCRIPTS_LOADED = false; $_BLOCK_URL = false; // Why yes we are loading the scripts and styles for admin and non-admin pages. Because we are allowing chat to run under both! if (function_exists('bp_is_group_admin_screen') && bp_is_group_admin_screen($this->get_option('bp_menu_slug', 'global'))) { //$_SCRIPTS_LOADED = true; //wp_enqueue_style( 'farbtastic' ); //$this->_registered_styles['farbtastic'] = 'farbtastic'; wp_enqueue_script('jquery'); $this->_registered_scripts['jquery'] = 'jquery'; wp_enqueue_script('json2'); $this->_registered_scripts['json2'] = 'json2'; wp_enqueue_script('jquery-ui-core'); $this->_registered_scripts['jquery-ui-core'] = 'jquery-ui-core'; wp_enqueue_script('jquery-ui-tabs'); $this->_registered_scripts['jquery-ui-tabs'] = 'jquery-ui-tabs'; $this->_registered_styles['wpmudev-chat-style'] = 'wpmudev-chat-style'; $this->_registered_styles[] = 'wpmudev-chat-admin-css'; wp_enqueue_script('wpmudev-chat-js'); $this->_registered_scripts['wpmudev-chat-js'] = 'wpmudev-chat-js'; wp_enqueue_script('wpmudev-chat-admin-js'); $this->_registered_scripts['wpmudev-chat-admin-js'] = 'wpmudev-chat-admin-js'; wp_enqueue_script('wpmudev-chat-admin-farbtastic-js'); $this->_registered_scripts['wpmudev-chat-admin-farbtastic-js'] = 'wpmudev-chat-admin-farbtastic-js'; if ($this->user_meta['chat_wp_toolbar'] == "enabled") { $this->_registered_styles['wpmudev-chat-wpadminbar-style'] = 'wpmudev-chat-wpadminbar-style'; // For older versions of WP (less than 3.8) we add some supplement styles if (!version_compare($wp_version, '3.7.1', '>')) { $this->_registered_styles['wpmudev-chat-wpadminbar-style-pre-38'] = 'wpmudev-chat-wpadminbar-style-pre-38'; } } } else { if (isset($this->user_meta['chat_wp_toolbar']) && $this->user_meta['chat_wp_toolbar'] == "enabled") { $this->_registered_styles['wpmudev-chat-wpadminbar-style'] = 'wpmudev-chat-wpadminbar-style'; // For older versions of WP (less than 3.8) we add some supplement styles if (!version_compare($wp_version, '3.7.1', '>')) { $this->_registered_styles['wpmudev-chat-wpadminbar-style-pre-38'] = 'wpmudev-chat-wpadminbar-style-pre-38'; } } wp_enqueue_script('jquery'); wp_enqueue_script('json2'); $this->_registered_scripts['json2'] = 'json2'; //Facebook Scripts if ($this->chat_localized['settings']["facebook_active"] === true) { wp_enqueue_script('facebook-all'); $this->_registered_scripts['facebook-all'] = 'facebook-all'; } $this->_registered_styles['wpmudev-chat-style'] = 'wpmudev-chat-style'; wp_enqueue_script('wpmudev-chat-js'); $this->_registered_scripts['wpmudev-chat-js'] = 'wpmudev-chat-js'; } }
/** * Determines what shows up on the BP Docs panel of the Group Admin * * @since 1.0-beta */ function edit_screen($group_id = null) { if (!bp_is_group_admin_screen($this->slug)) { return false; } $this->admin_markup(); // On the edit screen, we have to provide a save button ?> <p> <input type="submit" value="<?php _e('Save Changes', 'bp-docs'); ?> " id="save" name="save" /> </p> <?php wp_nonce_field('groups_edit_save_' . $this->slug); }
function edit_screen() { global $bp; if (!bp_is_group_admin_screen($this->slug)) { return false; } if (is_super_admin()) { $exclude_groups = BP_Groups_Hierarchy::get_by_parent($bp->groups->current_group->id); if (count($exclude_groups['groups']) > 0) { foreach ($exclude_groups['groups'] as $key => $exclude_group) { $exclude_groups['groups'][$key] = $exclude_group->id; } $exclude_groups = $exclude_groups['groups']; } else { $exclude_groups = array(); } $exclude_groups[] = $bp->groups->current_group->id; $groups = BP_Groups_Hierarchy::get('alphabetical', null, null, 0, false, false, true, $exclude_groups); $site_root = new stdClass(); $site_root->id = 0; $site_root->name = __('Site Root', 'bp-group-hierarchy'); $display_groups = array($site_root); foreach ($groups['groups'] as $group) { $display_groups[] = $group; } /* deprecated */ $display_groups = apply_filters('bp_group_hierarchy_display_groups', $display_groups); $display_groups = apply_filters('bp_group_hierarchy_available_parent_groups', $display_groups); ?> <label for="parent_id"><?php _e('Parent Group', 'bp-group-hierarchy'); ?> </label> <select name="parent_id" id="parent_id"> <?php foreach ($display_groups as $group) { ?> <option value="<?php echo $group->id; ?> "<?php if ($group->id == $bp->groups->current_group->parent_id) { echo ' selected'; } ?> ><?php echo stripslashes($group->name); ?> </option> <?php } ?> </select> <?php } else { ?> <div id="message"> <p><?php _e('Only a site administrator can edit the group hierarchy.', 'bp-group-hierarchy'); ?> </p> </div> <?php } if (is_super_admin() || bp_group_is_admin()) { $subgroup_permission_options = apply_filters('bp_group_hierarchy_subgroup_permission_options', $this->subgroup_permission_options); $current_subgroup_permission = groups_get_groupmeta($bp->groups->current_group->id, 'bp_group_hierarchy_subgroup_creators'); if ($current_subgroup_permission == '') { $current_subgroup_permission = $this->get_default_permission_option(); } $permission_select = '<select name="allow_children_by" id="allow_children_by">'; foreach ($subgroup_permission_options as $option => $text) { $permission_select .= '<option value="' . $option . '"' . ($option == $current_subgroup_permission ? ' selected' : '') . '>' . $text . '</option>' . "\n"; } $permission_select .= '</select>'; ?> <p> <label for="allow_children_by"><?php _e('Member Groups', 'bp-group-hierarchy'); ?> </label> <?php printf(__('Allow %1$s to create %2$s', 'bp-group-hierarchy'), $permission_select, __('Member Groups', 'bp-group-hierarchy')); ?> </p> <p> <input type="submit" class="button primary" id="save" name="save" value="<?php _e('Save Changes', 'bp-group-hierarchy'); ?> " /> </p> <?php wp_nonce_field('groups_edit_save_' . $this->slug); } }
/** * Checks whether Avatar UI should be loaded. * * @since 2.3.0 * * @return bool True if Avatar UI should load, false otherwise. */ function bp_avatar_is_front_edit() { $retval = false; // No need to carry on if the current WordPress version is not supported. if (!bp_attachments_is_wp_version_supported()) { return $retval; } if (bp_is_user_change_avatar() && 'crop-image' !== bp_get_avatar_admin_step()) { $retval = !bp_core_get_root_option('bp-disable-avatar-uploads'); } if (bp_is_active('groups')) { // Group creation if (bp_is_group_create() && bp_is_group_creation_step('group-avatar') && 'crop-image' !== bp_get_avatar_admin_step()) { $retval = !bp_disable_group_avatar_uploads(); // Group Manage } elseif (bp_is_group_admin_page() && bp_is_group_admin_screen('group-avatar') && 'crop-image' !== bp_get_avatar_admin_step()) { $retval = !bp_disable_group_avatar_uploads(); } } /** * Use this filter if you need to : * - Load the avatar UI for a component that is !groups or !user (return true regarding your conditions) * - Completely disable the avatar UI introduced in 2.3 (eg: __return_false()) * * @since 2.3.0 * * @param bool whether to load the Avatar UI. */ return apply_filters('bp_avatar_is_front_edit', $retval); }
/** * The content of the Group Documents page of the group admin * @author Stergatu Eleni <*****@*****.**> * @since 0.5 * @version 4 18/10/2013, fix the $action_link * v3, 21/5/2013, fix the edit category */ function edit_screen() { global $bp; if (!bp_is_group_admin_screen($this->slug)) { return false; } //useful ur for submits & links $action_link = get_bloginfo('url') . '/' . bp_get_groups_root_slug() . '/' . $bp->current_item . '/' . $bp->current_action . '/' . $this->slug; $this->edit_create_markup($bp->groups->current_group->id); //only show categories if site admin chooses to if (get_option('bp_group_documents_use_categories')) { $parent_id = BP_Group_Documents_Template::get_parent_category_id(); $group_categories = get_terms('group-documents-category', array('parent' => $parent_id, 'hide_empty' => false)); ?> <!-- #group-documents-group-admin-categories --> <div id="group-documents-group-admin-categories"> <label><?php _e('Category List for', 'bp-group-documents'); echo ' ' . $this->name; ?> </label> <div> <ul> <?php foreach ($group_categories as $category) { if (isset($_GET['edit']) && $_GET['edit'] == $category->term_id) { ?> <li id="category-<?php echo $category->term_id; ?> "><input type="text" name="group_documents_category_edit" value="<?php echo $category->name; ?> " /> <input type="hidden" name="group_documents_category_edit_id" value="<?php echo $category->term_id; ?> " /> <input type="submit" id="editCat" name="editCat" value="<?php _e('Update'); ?> " /> </li> <?php } elseif (isset($_GET['delete']) && $_GET['delete'] == $category->term_id) { ?> <div class="bp_group_documents_question" ><?php printf(__('Are you sure you want to delete category <b>%s</b>?', 'bp-group-documents'), $category->name); ?> <br/> <?php printf(__('Any %s in the category will be left with no category.', 'bp-group-documents'), mb_strtolower($this->name)); ?> <br/> <?php _e('You can later assign them to another category.', 'bp-group-documents'); ?> <input type="hidden" name="group_documents_category_del_id" value="<?php echo $category->term_id; ?> " /> <input type="submit" value="<?php _e('Delete', 'buddypress'); ?> " id="delCat" name="delCat"/> </div> <?php } else { $edit_link = wp_nonce_url($action_link . '?edit=' . $category->term_id, 'group_documents_category_edit'); $delete_link = wp_nonce_url($action_link . '?delete=' . $category->term_id, 'group_documents_category_delete'); ?> <li id="category-<?php echo $category->term_id; ?> "><strong><?php echo $category->name; ?> </strong> <a class="group-documents-category-edit" href="<?php echo $edit_link; ?> "><?php _e('Edit', 'bp-group-documents'); ?> </a> <a class="group-documents-category-delete" href="<?php echo $delete_link; ?> "><?php _e('Delete', 'bp-group-documents'); ?> </a> </li> <?php } } ?> <li><input type="text" name="bp_group_documents_new_category" class="bp-group-documents-new-category" /> <input type="submit" value="<?php _e('Add'); ?> " id="addCat" name="addCat"/></li> </ul> </div> </div><!-- end #group-documents-group-admin-categories --> <?php } do_action('bp_group_documents_group_admin_edit'); ?> <p> <input type="submit" value="<?php _e('Save Changes', 'buddypress'); ?> →" id="save" name="save" /> <input type="hidden" name="delCat" value="" /> </p> <?php wp_nonce_field('groups_edit_save_' . $this->slug); }