当前位置: 首页>>代码示例>>PHP>>正文


PHP bp_group_is_admin函数代码示例

本文整理汇总了PHP中bp_group_is_admin函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_group_is_admin函数的具体用法?PHP bp_group_is_admin怎么用?PHP bp_group_is_admin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了bp_group_is_admin函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: bp_groups_group_admin_menu

/**
 * Adds the Group Admin top-level menu to group pages
 *
 * @package BuddyPress
 * @since 1.5
 *
 * @todo Add dynamic menu items for group extensions
 */
function bp_groups_group_admin_menu()
{
    global $nxt_admin_bar, $bp;
    // Only show if viewing a group
    if (!bp_is_group()) {
        return false;
    }
    // Only show this menu to group admins and super admins
    if (!is_super_admin() && !bp_group_is_admin()) {
        return false;
    }
    if ('3.2' == bp_get_major_nxt_version()) {
        // Group avatar
        $avatar = bp_core_fetch_avatar(array('object' => 'group', 'type' => 'thumb', 'avatar_dir' => 'group-avatars', 'item_id' => $bp->groups->current_group->id, 'width' => 16, 'height' => 16));
        // Unique ID for the 'My Account' menu
        $bp->group_admin_menu_id = !empty($avatar) ? 'group-admin-with-avatar' : 'group-admin';
        // Add the top-level Group Admin button
        $nxt_admin_bar->add_menu(array('id' => $bp->group_admin_menu_id, 'title' => $avatar . bp_get_current_group_name(), 'href' => bp_get_group_permalink($bp->groups->current_group)));
    } elseif ('3.3' == bp_get_major_nxt_version()) {
        // Unique ID for the 'My Account' menu
        $bp->group_admin_menu_id = 'group-admin';
        // Add the top-level Group Admin button
        $nxt_admin_bar->add_menu(array('id' => $bp->group_admin_menu_id, 'title' => __('Edit Group', 'buddypress'), 'href' => bp_get_group_permalink($bp->groups->current_group)));
    }
    // Group Admin > Edit details
    $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'edit-details', 'title' => __('Edit Details', 'buddypress'), 'href' => bp_get_groups_action_link('admin/edit-details')));
    // Group Admin > Group settings
    $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'group-settings', 'title' => __('Edit Settings', 'buddypress'), 'href' => bp_get_groups_action_link('admin/group-settings')));
    // Group Admin > Group avatar
    if (!(int) bp_get_option('bp-disable-avatar-uploads')) {
        $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'group-avatar', 'title' => __('Edit Avatar', 'buddypress'), 'href' => bp_get_groups_action_link('admin/group-avatar')));
    }
    // Group Admin > Manage invitations
    if (bp_is_active('friends')) {
        $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'manage-invitations', 'title' => __('Manage Invitations', 'buddypress'), 'href' => bp_get_groups_action_link('send-invites')));
    }
    // Group Admin > Manage members
    $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'manage-members', 'title' => __('Manage Members', 'buddypress'), 'href' => bp_get_groups_action_link('admin/manage-members')));
    // Group Admin > Membership Requests
    if (bp_get_group_status($bp->groups->current_group) == 'private') {
        $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'membership-requests', 'title' => __('Membership Requests', 'buddypress'), 'href' => bp_get_groups_action_link('admin/membership-requests')));
    }
    // Delete Group
    $nxt_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'delete-group', 'title' => __('Delete Group', 'buddypress'), 'href' => bp_get_groups_action_link('admin/delete-group')));
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:53,代码来源:bp-groups-adminbar.php

示例2: bp_groups_group_admin_menu

/**
 * Add the Group Admin top-level menu when viewing group pages.
 *
 * @since 1.5.0
 *
 * @todo Add dynamic menu items for group extensions.
 *
 * @return false|null False if not on a group page, or if user does not have
 *                    access to group admin options.
 */
function bp_groups_group_admin_menu()
{
    global $wp_admin_bar;
    $bp = buddypress();
    // Only show if viewing a group.
    if (!bp_is_group() || bp_is_group_create()) {
        return false;
    }
    // Only show this menu to group admins and super admins.
    if (!bp_current_user_can('bp_moderate') && !bp_group_is_admin()) {
        return false;
    }
    // Unique ID for the 'Edit Group' menu.
    $bp->group_admin_menu_id = 'group-admin';
    // Add the top-level Group Admin button.
    $wp_admin_bar->add_menu(array('id' => $bp->group_admin_menu_id, 'title' => __('Edit Group', 'buddypress'), 'href' => bp_get_group_permalink($bp->groups->current_group)));
    // Index of the Manage tabs parent slug.
    $nav_index = $bp->groups->current_group->slug . '_manage';
    // Check if current group has Manage tabs.
    if (empty($bp->bp_options_nav[$nav_index])) {
        return;
    }
    // Build the Group Admin menus.
    foreach ($bp->bp_options_nav[$nav_index] as $menu) {
        /**
         * Should we add the current manage link in the Group's "Edit" Admin Bar menu ?
         *
         * All core items will be added, plugins can use a new parameter in the BP Group Extension API
         * to also add the link to the "edit screen" of their group component. To do so, set the
         * the 'show_in_admin_bar' argument of your edit screen to true
         */
        if ($menu['show_in_admin_bar']) {
            $title = sprintf(_x('Edit Group %s', 'Group WP Admin Bar manage links', 'buddypress'), $menu['name']);
            // Title is specific for delete.
            if ('delete-group' == $menu['slug']) {
                $title = sprintf(_x('%s Group', 'Group WP Admin Bar delete link', 'buddypress'), $menu['name']);
            }
            $wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => $menu['slug'], 'title' => $title, 'href' => bp_get_groups_action_link('admin/' . $menu['slug'])));
        }
    }
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:51,代码来源:bp-groups-adminbar.php

示例3: bp_groups_group_admin_menu

/**
 * Add the Group Admin top-level menu when viewing group pages.
 *
 * @since BuddyPress (1.5.0)
 *
 * @todo Add dynamic menu items for group extensions.
 */
function bp_groups_group_admin_menu()
{
    global $wp_admin_bar, $bp;
    // Only show if viewing a group
    if (!bp_is_group()) {
        return false;
    }
    // Only show this menu to group admins and super admins
    if (!bp_current_user_can('bp_moderate') && !bp_group_is_admin()) {
        return false;
    }
    // Unique ID for the 'Edit Group' menu
    $bp->group_admin_menu_id = 'group-admin';
    // Add the top-level Group Admin button
    $wp_admin_bar->add_menu(array('id' => $bp->group_admin_menu_id, 'title' => __('Edit Group', 'buddypress'), 'href' => bp_get_group_permalink($bp->groups->current_group)));
    // Group Admin > Edit details
    $wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'edit-details', 'title' => __('Edit Details', 'buddypress'), 'href' => bp_get_groups_action_link('admin/edit-details')));
    // Group Admin > Group settings
    $wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'group-settings', 'title' => __('Edit Settings', 'buddypress'), 'href' => bp_get_groups_action_link('admin/group-settings')));
    // Group Admin > Group avatar
    if (!(int) bp_get_option('bp-disable-avatar-uploads')) {
        $wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'group-avatar', 'title' => __('Edit Avatar', 'buddypress'), 'href' => bp_get_groups_action_link('admin/group-avatar')));
    }
    // Group Admin > Manage invitations
    if (bp_is_active('friends')) {
        $wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'manage-invitations', 'title' => __('Manage Invitations', 'buddypress'), 'href' => bp_get_groups_action_link('send-invites')));
    }
    // Group Admin > Manage members
    $wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'manage-members', 'title' => __('Manage Members', 'buddypress'), 'href' => bp_get_groups_action_link('admin/manage-members')));
    // Group Admin > Membership Requests
    if (bp_get_group_status($bp->groups->current_group) == 'private') {
        $wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'membership-requests', 'title' => __('Membership Requests', 'buddypress'), 'href' => bp_get_groups_action_link('admin/membership-requests')));
    }
    // Delete Group
    $wp_admin_bar->add_menu(array('parent' => $bp->group_admin_menu_id, 'id' => 'delete-group', 'title' => __('Delete Group', 'buddypress'), 'href' => bp_get_groups_action_link('admin/delete-group')));
}
开发者ID:danielcoats,项目名称:schoolpress,代码行数:43,代码来源:bp-groups-adminbar.php

示例4: has_response_caps

 /**
  * has_response_caps( $user_id )
  *
  * Checks if $user_id has response management capabilities
  *
  * @param Int $user_id ID of the user capabilities to be checked
  * @return True if $user_id is eligible and False if not.
  */
 function has_response_caps($user_id = null)
 {
     $is_ok = true;
     if (!$user_id) {
         global $bp;
         $user_id = $bp->loggedin_user->id;
     }
     // Treat super admins
     if (is_super_admin($user_id)) {
         $this->add_response_caps($user_id);
     }
     $user = new WP_User($user_id);
     foreach ($this->caps as $c) {
         if (!$user->has_cap($c)) {
             $is_ok = false;
         }
     }
     if (!get_option('bpsp_allow_only_admins')) {
         if (!bp_group_is_admin()) {
             $is_ok = false;
         }
     }
     return $is_ok;
 }
开发者ID:Nuttify,项目名称:buddypress-courseware,代码行数:32,代码来源:bpsp-responses.class.php

示例5: while

			<?php while ( bp_forum_topic_posts() ) : bp_the_forum_topic_post(); ?>

				<li id="post-<?php bp_the_topic_post_id() ?>" class="<?php bp_the_topic_post_css_class() ?>">
					<div class="poster-meta">
						<a href="<?php bp_the_topic_post_poster_link() ?>">
							<?php bp_the_topic_post_poster_avatar( 'width=40&height=40' ) ?>
						</a>
						<?php echo sprintf( __( '%s said %s ago:', 'buddypress' ), bp_get_the_topic_post_poster_name(), bp_get_the_topic_post_time_since() ) ?>
					</div>

					<div class="post-content">
						<?php bp_the_topic_post_content() ?>
					</div>

					<div class="admin-links">
						<?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_post_is_mine() ) : ?>
							<?php bp_the_topic_post_admin_links() ?>
						<?php endif; ?>

						<?php do_action( 'bp_group_forum_post_meta' ); ?>

						<a href="#post-<?php bp_the_topic_post_id() ?>" title="<?php _e( 'Permanent link to this post', 'buddypress' ) ?>">#</a>
					</div>
				</li>

			<?php endwhile; ?>
		</ul><!-- #topic-post-list -->

		<?php do_action( 'bp_after_group_forum_topic_posts' ) ?>

		<div class="pagination no-ajax">
开发者ID:n-sane,项目名称:zaroka,代码行数:31,代码来源:topic.php

示例6: doc_settings_markup

    /**
     * Creates the markup for the group-specific doc settings
     *
     * In the future I'll try to get the markup out of here. Sorry, themers.
     *
     * @package BuddyPress Docs
     * @since 1.0-beta
     *
     * @param array $doc_settings Passed along to reduce lookups
     */
    function doc_settings_markup($doc_settings)
    {
        global $bp;
        // Only add these settings if we're in the group component
        // BP 1.2/1.3 compatibility
        $is_group_component = function_exists('bp_is_current_component') ? bp_is_current_component('groups') : $bp->current_component == $bp->groups->slug;
        if ($is_group_component) {
            // Get the current values
            $edit = !empty($doc_settings['edit']) ? $doc_settings['edit'] : 'group-members';
            $post_comments = !empty($doc_settings['post_comments']) ? $doc_settings['post_comments'] : 'group-members';
            // Read settings have a different default value for public groups
            if (!empty($doc_settings['read_comments'])) {
                $read_comments = $doc_settings['read_comments'];
            } else {
                $read_comments = bp_group_is_visible() ? 'anyone' : 'group-members';
            }
            $view_history = !empty($doc_settings['view_history']) ? $doc_settings['view_history'] : 'anyone';
            $manage = !empty($doc_settings['manage']) ? $doc_settings['manage'] : 'creator';
            // Set the text of the 'creator only' label
            if (!empty($bp->bp_docs->current_post->post_author) && $bp->bp_docs->current_post->post_author != bp_loggedin_user_id()) {
                $creator_text = sprintf(__('Doc creator only (%s)', 'bp-docs'), bp_core_get_user_displayname($bp->bp_docs->current_post->post_author));
            } else {
                $creator_text = __('Doc creator only (that\'s you!)', 'bp-docs');
            }
            ?>
			
			<?php 
            /* EDITING */
            ?>
			<tr>
				<td class="desc-column">
					<label for="settings[edit]"><?php 
            _e('Who can edit this doc?', 'bp-docs');
            ?>
</label>
				</td>
				
				<td class="content-column">
					<input name="settings[edit]" type="radio" value="group-members" <?php 
            checked($edit, 'group-members');
            ?>
/> <?php 
            _e('All members of the group', 'bp-docs');
            ?>
<br />
			
					<input name="settings[edit]" type="radio" value="creator" <?php 
            checked($edit, 'creator');
            ?>
/> <?php 
            echo esc_html($creator_text);
            ?>
<br />
			
					<?php 
            if (bp_group_is_admin() || bp_group_is_mod()) {
                ?>
						<input name="settings[edit]" type="radio" value="admins-mods" <?php 
                checked($edit, 'admins-mods');
                ?>
/> <?php 
                _e('Only admins and mods of this group', 'bp-docs');
                ?>
<br />
					<?php 
            }
            ?>
				</td>
			</tr>
			
			<?php 
            /* POSTING COMMENTS */
            ?>
			<tr>
				<td class="desc-column">
					<label for="settings[post_comments]"><?php 
            _e('Who can <em>post</em> comments on this doc?', 'bp-docs');
            ?>
</label>
				</td>
				
				<td class="content-column">
					<input name="settings[post_comments]" type="radio" value="group-members" <?php 
            checked($post_comments, 'group-members');
            ?>
/> <?php 
            _e('All members of the group', 'bp-docs');
            ?>
<br />
					
//.........这里部分代码省略.........
开发者ID:Nightgunner5,项目名称:Pubcomp-CMS,代码行数:101,代码来源:integration-groups.php

示例7: bp_get_group_class

/**
 * Return the row class of a group
 *
 * @global BP_Groups_Template $groups_template
 * @return string Row class of the group
 * @since BuddyPress (1.7)
 */
function bp_get_group_class()
{
    global $groups_template;
    $classes = array();
    $pos_in_loop = (int) $groups_template->current_group;
    // If we've only one group in the loop, don't both with odd and even.
    if ($groups_template->group_count > 1) {
        $classes[] = $pos_in_loop % 2 ? 'even' : 'odd';
    } else {
        $classes[] = 'bp-single-group';
    }
    // Group type - public, private, hidden.
    $classes[] = esc_attr($groups_template->group->status);
    // User's group status
    if (bp_is_user_active()) {
        if (bp_group_is_admin()) {
            $classes[] = 'is-admin';
        }
        if (bp_group_is_member()) {
            $classes[] = 'is-member';
        }
        if (bp_group_is_mod()) {
            $classes[] = 'is-mod';
        }
    }
    $classes = apply_filters('bp_get_group_class', $classes);
    $classes = array_merge($classes, array());
    $retval = 'class="' . join(' ', $classes) . '"';
    return $retval;
}
开发者ID:kd5ytx,项目名称:Empirical-Wordpress,代码行数:37,代码来源:bp-groups-template.php

示例8: _e

		</div>

		<div id="topic-meta">
			<h3><?php 
    _e('Edit:', 'buddypress');
    ?>
 <?php 
    bp_the_topic_title();
    ?>
 (<?php 
    bp_the_topic_total_post_count();
    ?>
)</h3>

			<?php 
    if (bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_is_mine()) {
        ?>

				<div class="last admin-links">

					<?php 
        bp_the_topic_admin_links();
        ?>

				</div>

			<?php 
    }
    ?>

			<?php 
开发者ID:adisonc,项目名称:MaineLearning,代码行数:31,代码来源:edit.php

示例9: rtmedia_delete_allowed

function rtmedia_delete_allowed()
{
    global $rtmedia_media;
    $flag = $rtmedia_media->media_author == get_current_user_id();
    if (!$flag && isset($rtmedia_media->context) && $rtmedia_media->context == 'group' && function_exists('bp_group_is_admin')) {
        $flag = bp_group_is_admin() || bp_group_is_mod();
    }
    if (!$flag) {
        $flag = is_super_admin();
    }
    $flag = apply_filters('rtmedia_media_delete_priv', $flag);
    return $flag;
}
开发者ID:EfncoPlugins,项目名称:rtMedia,代码行数:13,代码来源:rt-template-functions.php

示例10: can_teach

 /**
  * can_teach( $user_id = null )
  *
  * This will check if current user is allowed to manage courseware for current group
  * @param Int $user_id, the id of the user to check
  * @return Bool, true or false
  */
 function can_teach($user_id = null)
 {
     global $bp;
     if (!$user_id) {
         $user_id = $bp->loggedin_user->id;
     }
     $is_admin = false;
     if (!BPSP_Groups::courseware_status()) {
         return false;
     }
     if (is_super_admin($user_id)) {
         return true;
     }
     if (self::is_teacher($user_id)) {
         $is_admin = true;
     }
     if (!get_option('bpsp_allow_only_admins') && !bp_group_is_admin()) {
         $is_admin = false;
     }
     return $is_admin;
 }
开发者ID:ruanbarbosa,项目名称:buddypress-courseware,代码行数:28,代码来源:roles.class.php

示例11: _e

		<div class="toggleable doc-is-locked">
			<span class="toggle-switch" id="toggle-doc-is-locked"><?php 
    _e('Locked', 'bp-docs');
    ?>
 <span class="hide-if-no-js description"><?php 
    _e('(click for more info)', 'bp-docs');
    ?>
</span></span>
			<div class="toggle-content">
				<p><?php 
    printf(__('This doc is currently being edited by %1$s. In order to prevent edit conflicts, only one user can edit a doc at a time.', 'bp-docs'), bp_docs_get_current_doc_locker_name());
    ?>
</p>

				<?php 
    if (is_super_admin() || bp_group_is_admin()) {
        ?>
					<p><?php 
        printf(__('Please try again in a few minutes. Or, as an admin, you can <a href="%s">force cancel</a> the edit lock.', 'bp-docs'), bp_docs_get_force_cancel_edit_lock_link());
        ?>
</p>
				<?php 
    } else {
        ?>
					<p><?php 
        _e('Please try again in a few minutes.', 'bp-docs');
        ?>
</p>
				<?php 
    }
    ?>
开发者ID:rpi-virtuell,项目名称:rw-social-learner,代码行数:31,代码来源:index-inner.php

示例12: _e

                <li id="assignment-enable-forum">
                    <form method="post" action="<?php 
    echo $assignment_e_forum_permalink;
    ?>
" class="standard-form" >
                        <input type="submit" value="<?php 
    _e('Enable Assignment Forum', 'bpsp');
    ?>
" />
                        <?php 
    echo $assignment_e_forum_nonce;
    ?>
                    </form>
                </li>
            <?php 
} elseif (bp_group_is_admin()) {
    ?>
                <li id="assignment-forum-inactive">
                    <a href="#" class="action alert"><?php 
    _e('You need forums enabled', 'bpsp');
    ?>
</a>
                </li>
            <?php 
}
?>
            <?php 
if (count($responses) > 0) {
    ?>
                <li id="responses">
                    <a href="#courseware-responses-list" class="action">
开发者ID:warinermedia,项目名称:buddypress-courseware,代码行数:31,代码来源:single_assignment.php

示例13: invite_anyone_group_invite_access_test

function invite_anyone_group_invite_access_test()
{
    global $current_user, $bp;
    if (!is_user_logged_in() || empty($bp->groups->current_group)) {
        return 'noone';
    }
    if (!($iaoptions = get_option('invite_anyone'))) {
        $iaoptions = array();
    }
    if (bp_is_group_create()) {
        if (empty($iaoptions['group_invites_can_group_admin']) || $iaoptions['group_invites_can_group_admin'] == 'anyone' || !$iaoptions['group_invites_can_group_admin']) {
            return 'anyone';
        }
        if ($iaoptions['group_invites_can_group_admin'] == 'friends') {
            return 'friends';
        }
        if ($iaoptions['group_invites_can_group_admin'] == 'noone') {
            return 'noone';
        }
    }
    if (!groups_is_user_member($bp->loggedin_user->id, $bp->groups->current_group->id)) {
        return 'noone';
    }
    if (is_super_admin()) {
        if (empty($iaoptions['group_invites_can_admin']) || $iaoptions['group_invites_can_admin'] == 'anyone' || !$iaoptions['group_invites_can_admin']) {
            return 'anyone';
        }
        if ($iaoptions['group_invites_can_admin'] == 'friends') {
            return 'friends';
        }
        if ($iaoptions['group_invites_can_admin'] == 'noone') {
            return 'noone';
        }
    } else {
        if (bp_group_is_admin() || bp_is_group_create()) {
            if (empty($iaoptions['group_invites_can_group_admin']) || $iaoptions['group_invites_can_group_admin'] == 'anyone' || !$iaoptions['group_invites_can_group_admin']) {
                return 'anyone';
            }
            if ($iaoptions['group_invites_can_group_admin'] == 'friends') {
                return 'friends';
            }
            if ($iaoptions['group_invites_can_group_admin'] == 'noone') {
                return 'noone';
            }
        } else {
            if (bp_group_is_mod()) {
                if (empty($iaoptions['group_invites_can_group_mod']) || $iaoptions['group_invites_can_group_mod'] == 'anyone' || !$iaoptions['group_invites_can_group_mod']) {
                    return 'anyone';
                }
                if ($iaoptions['group_invites_can_group_mod'] == 'friends') {
                    return 'friends';
                }
                if ($iaoptions['group_invites_can_group_mod'] == 'noone') {
                    return 'noone';
                }
            } else {
                if (empty($iaoptions['group_invites_can_group_member']) || $iaoptions['group_invites_can_group_member'] == 'anyone' || !$iaoptions['group_invites_can_group_member']) {
                    return 'anyone';
                }
                if ($iaoptions['group_invites_can_group_member'] == 'friends') {
                    return 'friends';
                }
                if ($iaoptions['group_invites_can_group_member'] == 'noone') {
                    return 'noone';
                }
            }
        }
    }
    return 'noone';
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:70,代码来源:group-invites.php

示例14: bp_group_permalink

 * Apocrypha Theme Group Members Component
 * Andrew Clayton
 * Version 2.0
 * 10-18-2014
 */
?>

<nav class="reply-header" id="subnav">
	<ul id="profile-tabs" class="tabs" role="navigation">
		<li class="current"><a href="<?php 
bp_group_permalink();
?>
members/" title="Group Members">Guild Members</a></li>
		
		<?php 
if (bp_group_is_admin() || bp_group_is_mod()) {
    ?>
		<li><a href="<?php 
    bp_group_permalink();
    ?>
admin/manage-members/" title="Manage group members">Roster Management</a></li>
		<?php 
}
?>
	</ul>
</nav><!-- #subnav -->

<div id="members-dir-list" class="members dir-list">
<?php 
if (bp_is_current_action('requests')) {
    ?>
开发者ID:tamriel-foundry,项目名称:apoc2,代码行数:31,代码来源:members.php

示例15: edit_screen

    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);
        }
    }
开发者ID:adisonc,项目名称:MaineLearning,代码行数:95,代码来源:extension.php


注:本文中的bp_group_is_admin函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。