Пример #1
0
Файл: 2.1.php Проект: eresyyl/mk
/**
 * Add a member admin menu to the BuddyBar.
 *
 * Adds an Toolbar menu to any profile page providing site moderator actions
 * that allow capable users to clean up a users account.
 *
 * @deprecated BuddyPress (2.1.0)
 */
function bp_members_adminbar_admin_menu()
{
    // Only show if viewing a user
    if (!bp_displayed_user_id()) {
        return false;
    }
    // Don't show this menu to non site admins or if you're viewing your own profile
    if (!current_user_can('edit_users') || bp_is_my_profile()) {
        return false;
    }
    ?>

	<li id="bp-adminbar-adminoptions-menu">

		<a href=""><?php 
    _e('Admin Options', 'buddypress');
    ?>
</a>

		<ul>
			<?php 
    if (bp_is_active('xprofile')) {
        ?>

				<li><a href="<?php 
        bp_members_component_link('profile', 'edit');
        ?>
"><?php 
        printf(__("Edit %s's Profile", 'buddypress'), esc_attr(bp_get_displayed_user_fullname()));
        ?>
</a></li>

			<?php 
    }
    ?>

			<li><a href="<?php 
    bp_members_component_link('profile', 'change-avatar');
    ?>
"><?php 
    printf(__("Edit %s's Profile Photo", 'buddypress'), esc_attr(bp_get_displayed_user_fullname()));
    ?>
</a></li>

			<li><a href="<?php 
    bp_members_component_link('settings', 'capabilities');
    ?>
"><?php 
    _e('User Capabilities', 'buddypress');
    ?>
</a></li>

			<li><a href="<?php 
    bp_members_component_link('settings', 'delete-account');
    ?>
"><?php 
    printf(__("Delete %s's Account", 'buddypress'), esc_attr(bp_get_displayed_user_fullname()));
    ?>
</a></li>

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

		</ul>
	</li>

	<?php 
}
Пример #2
0
/**
 * Adds an admin bar menu to any profile page providing site moderator actions
 * that allow capable users to clean up a users account.
 *
 * @package BuddyPress XProfile
 * @global $bp BuddyPress
 */
function bp_members_adminbar_admin_menu()
{
    global $bp;
    // Only show if viewing a user
    if (!$bp->displayed_user->id) {
        return false;
    }
    // Don't show this menu to non site admins or if you're viewing your own profile
    if (!current_user_can('edit_users') || bp_is_my_profile()) {
        return false;
    }
    ?>

	<li id="bp-adminbar-adminoptions-menu">

		<a href=""><?php 
    _e('Admin Options', 'buddypress');
    ?>
</a>

		<ul>
			<?php 
    if (bp_is_active('xprofile')) {
        ?>

				<li><a href="<?php 
        bp_members_component_link('profile', 'edit');
        ?>
"><?php 
        printf(__("Edit %s's Profile", 'buddypress'), esc_attr($bp->displayed_user->fullname));
        ?>
</a></li>

			<?php 
    }
    ?>

			<li><a href="<?php 
    bp_members_component_link('profile', 'change-avatar');
    ?>
"><?php 
    printf(__("Edit %s's Avatar", 'buddypress'), esc_attr($bp->displayed_user->fullname));
    ?>
</a></li>

			<?php 
    if (!bp_core_is_user_spammer($bp->displayed_user->id)) {
        ?>

				<li><a href="<?php 
        echo nxt_nonce_url($bp->displayed_user->domain . 'admin/mark-spammer/', 'mark-unmark-spammer');
        ?>
" class="confirm"><?php 
        printf(__("Mark as Spammer", 'buddypress'), esc_attr($bp->displayed_user->fullname));
        ?>
</a></li>

			<?php 
    } else {
        ?>

				<li><a href="<?php 
        echo nxt_nonce_url($bp->displayed_user->domain . 'admin/unmark-spammer/', 'mark-unmark-spammer');
        ?>
" class="confirm"><?php 
        _e("Not a Spammer", 'buddypress');
        ?>
</a></li>

			<?php 
    }
    ?>

			<li><a href="<?php 
    echo nxt_nonce_url($bp->displayed_user->domain . 'admin/delete-user/', 'delete-user');
    ?>
" class="confirm"><?php 
    printf(__("Delete %s's Account", 'buddypress'), esc_attr($bp->displayed_user->fullname));
    ?>
</a></li>

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

		</ul>
	</li>

	<?php 
}