/**
  * Display the button to launch the Editor
  *
  * @since Rendez Vous (1.0.0)
  */
 public static function editor($editor_id, $settings = array())
 {
     $set = self::set($editor_id, $settings);
     $load_editor = apply_filters('rendez_vous_load_editor', bp_is_my_profile());
     if (current_user_can('publish_rendez_vouss') && !empty($load_editor)) {
         bp_button(array('id' => 'create-' . $set['component'] . '-' . $set['status'], 'component' => 'rendez_vous', 'must_be_logged_in' => true, 'block_self' => false, 'wrapper_id' => $editor_id, 'wrapper_class' => $set['btn_class'], 'link_class' => 'add-' . $set['status'], 'link_href' => '#', 'link_title' => $set['btn_caption'], 'link_text' => $set['btn_caption']));
     }
     self::launch($editor_id);
 }
Beispiel #2
0
        /**
         * Fires inside the groups membership request list loop.
         *
         * @since BuddyPress (1.1.0)
         */
        do_action('bp_group_membership_requests_admin_item');
        ?>

				<div class="action">

					<?php 
        bp_button(array('id' => 'group_membership_accept', 'component' => 'groups', 'wrapper_class' => 'accept', 'link_href' => bp_get_group_request_accept_link(), 'link_title' => __('Accept', 'buddypress'), 'link_text' => __('Accept', 'buddypress')));
        ?>

					<?php 
        bp_button(array('id' => 'group_membership_reject', 'component' => 'groups', 'wrapper_class' => 'reject', 'link_href' => bp_get_group_request_reject_link(), 'link_title' => __('Reject', 'buddypress'), 'link_text' => __('Reject', 'buddypress')));
        ?>

					<?php 
        /**
         * Fires inside the list of membership request actions.
         *
         * @since BuddyPress (1.1.0)
         */
        do_action('bp_group_membership_requests_admin_item_action');
        ?>

				</div>
			</li>

		<?php 
function bp_get_group_new_topic_button($group = false)
{
    global $groups_template;
    if (!$group) {
        $group =& $groups_template->group;
    }
    if (!is_user_logged_in() || bp_group_is_user_banned() || !bp_is_group_forum() || bp_is_group_forum_topic()) {
        return false;
    }
    $button = bp_button(array('id' => 'new_topic', 'component' => 'groups', 'must_be_logged_in' => true, 'block_self' => true, 'wrapper_class' => 'group-button', 'link_href' => '#post-new', 'link_class' => 'group-button show-hide-new', 'link_id' => 'new-topic-button', 'link_text' => __('New Topic', 'buddypress'), 'link_title' => __('New Topic', 'buddypress')));
    // Filter and return the HTML button
    return bp_get_button(apply_filters('bp_get_group_new_topic_button', $button));
}
function bp_edit_profile_button()
{
    global $bp;
    bp_button(array('id' => 'edit_profile', 'component' => 'xprofile', 'must_be_logged_in' => true, 'block_self' => true, 'link_href' => trailingslashit($bp->displayed_user->domain . $bp->profile->slug . '/edit'), 'link_class' => 'edit', 'link_text' => __('Edit Profile', 'buddypress'), 'link_title' => __('Edit Profile', 'buddypress')));
}
Beispiel #5
0
        ?>
" />
				<input type="hidden" name="action" id="action" value="bp_avatar_upload" />
			</p>

			<?php 
        if (bp_get_group_has_avatar()) {
            ?>

				<p><?php 
            _e("If you'd like to remove the existing group profile photo but not upload a new one, please use the delete group profile photo button.", 'buddypress');
            ?>
</p>

				<?php 
            bp_button(array('id' => 'delete_group_avatar', 'component' => 'groups', 'wrapper_id' => 'delete-group-avatar-button', 'link_class' => 'edit', 'link_href' => bp_get_group_avatar_delete_link(), 'link_title' => __('Delete Group Profile Photo', 'buddypress'), 'link_text' => __('Delete Group Profile Photo', 'buddypress')));
            ?>

			<?php 
        }
        ?>

			<?php 
        wp_nonce_field('bp_avatar_upload');
        ?>

	<?php 
    }
    ?>

	<?php 
/**
 * Render an edit profile button.
 *
 * @since 1.0.0
 */
function bp_edit_profile_button()
{
    bp_button(array('id' => 'edit_profile', 'component' => 'xprofile', 'must_be_logged_in' => true, 'block_self' => true, 'link_href' => trailingslashit(bp_displayed_user_domain() . bp_get_profile_slug() . '/edit'), 'link_class' => 'edit', 'link_text' => __('Edit Profile', 'buddypress')));
}
 /**
  * Adds a "mark as spam" button to each activity COMMENT item for site admins.
  *
  * This function is intended to be used inside the activity stream loop.
  *
  * @since BuddyPress (1.6)
  */
 public function add_activity_comment_spam_button()
 {
     if (!bp_activity_user_can_mark_spam()) {
         return;
     }
     // By default, only handle activity updates and activity comments.
     $current_comment = bp_activity_current_comment();
     if (empty($current_comment) || !in_array($current_comment->type, BP_Akismet::get_activity_types())) {
         return;
     }
     bp_button(array('block_self' => false, 'component' => 'activity', 'id' => 'activity_make_spam_' . bp_get_activity_comment_id(), 'link_class' => 'bp-secondary-action spam-activity-comment confirm', 'link_href' => wp_nonce_url(bp_get_root_domain() . '/' . bp_get_activity_slug() . '/spam/' . bp_get_activity_comment_id() . '/?cid=' . bp_get_activity_comment_id(), 'bp_activity_akismet_spam_' . bp_get_activity_comment_id()), 'link_text' => __('Spam', 'buddypress'), 'wrapper' => false));
 }
function bp_group_new_topic_button() {
	if ( bp_is_group_forum() && is_user_logged_in() && !bp_is_group_forum_topic() ) {
		bp_button( array (
			'id'                => 'new_topic',
			'component'         => 'groups',
			'must_be_logged_in' => true,
			'block_self'        => true,
			'wrapper_class'     => 'group-button',
			'link_href'         => '#post-new',
			'link_class'        => '',
			'link_text'         => __( 'New Topic', 'buddypress' ),
			'link_title'        => __( 'New Topic', 'buddypress' ),
		) );
	}
}
        bp_group_request_time_since_requested();
        ?>
</span>

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

				<div class="action">

					<?php 
        bp_button(array('id' => 'group_membership_accept', 'component' => 'groups', 'wrapper_class' => 'accept', 'link_class' => 'btn btn-default', 'link_href' => bp_get_group_request_accept_link(), 'link_title' => __('Accept', 'firmasite'), 'link_text' => __('Accept', 'firmasite')));
        ?>

					<?php 
        bp_button(array('id' => 'group_membership_reject', 'component' => 'groups', 'wrapper_class' => 'reject', 'link_class' => 'btn btn-default', 'link_href' => bp_get_group_request_reject_link(), 'link_title' => __('Reject', 'firmasite'), 'link_text' => __('Reject', 'firmasite')));
        ?>

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

				</div>
             </div></div>     
			</li>

		<?php 
    }
    ?>
	</ul>
Beispiel #10
0
            echo $user->block;
            ?>
				</div>
				
				<div class="directory-content">
					<header class="activity-header">	
						<p class="activity"><?php 
            bp_group_request_time_since_requested();
            ?>
</p>
						<div class="actions">
							<?php 
            bp_button(array('id' => 'group_membership_accept', 'component' => 'groups', 'wrapper_class' => 'accept', 'link_href' => bp_get_group_request_accept_link(), 'link_title' => __('Accept', 'buddypress'), 'link_class' => 'button', 'link_text' => '<i class="fa fa-check"></i>Accept', 'wrapper' => false));
            ?>
							<?php 
            bp_button(array('id' => 'group_membership_reject', 'component' => 'groups', 'wrapper_class' => 'reject', 'link_href' => bp_get_group_request_reject_link(), 'link_title' => __('Reject', 'buddypress'), 'link_class' => 'button', 'link_text' => '<i class="fa fa-remove"></i>Reject', 'wrapper' => false));
            ?>
						</div>
					</header>

					<blockquote class="activity-content">
						<?php 
            bp_group_request_comment();
            ?>
					</blockquote>
				</div>
			</li>		
			<?php 
        }
        ?>
		</ul>
/**
 * Output a 'Follow' activity button.
 *
 * @param $args {
 *      Array of arguments.  Also see other args via {@link BP_Button} class.
 *      @type int  $leader_id           Activity ID to follow.
 *      @type int  $follower_id         User ID initiating the follow request.
 *      @type bool $show_follower_count Should we show the follower count for this item? Default: false.
 * }
 */
function bp_follow_activity_button($args = array())
{
    global $activities_template;
    $r = bp_parse_args($args, array('leader_id' => !empty($activities_template->in_the_loop) ? bp_get_activity_id() : 0, 'follower_id' => bp_loggedin_user_id(), 'link_text' => '', 'link_title' => '', 'wrapper_class' => '', 'link_class' => 'button bp-primary-action', 'wrapper' => false, 'show_follower_count' => false), 'follow_activity_button');
    if (!$r['leader_id'] || !$r['follower_id']) {
        return;
    }
    $follow_type = bp_follow_activity_get_type($r['leader_id']);
    // if we're checking during an activity loop, then follow status is already
    // queried via bulk_inject_follow_activity_status()
    if (!empty($activities_template->in_the_loop) && $r['follower_id'] == bp_loggedin_user_id() && $r['leader_id'] == bp_get_activity_id() && 'activity' === $follow_type) {
        $is_following = $activities_template->activity->is_following;
        // else we manually query the follow status
    } else {
        $is_following = bp_follow_is_following(array('leader_id' => $r['leader_id'], 'follower_id' => $r['follower_id'], 'follow_type' => $follow_type));
    }
    // setup some variables
    if ($is_following) {
        $id = 'following';
        $action = 'unfollow';
        /* @todo Maybe bring back the count for the 'unfollow' button?
        		$count  = bp_follow_get_the_followers_count( array(
        			'object_id'   => $r['leader_id'],
        			'follow_type' => $follow_type
        		) );
        		*/
        $count = 0;
        if (empty($count)) {
            $link_text = _x('Unfollow', 'Follow activity button', 'bp-follow');
        } else {
            $link_text = sprintf(_x('Unfollow %s', 'Follow activity button', 'bp-follow'), '<span>' . $count . '</span>');
        }
        if (empty($r['link_text'])) {
            $r['link_text'] = $link_text;
        }
    } else {
        $id = 'not-following';
        $action = 'follow';
        $count = 0;
        if (true === $r['show_follower_count']) {
            $count = bp_follow_get_the_followers_count(array('object_id' => $r['leader_id'], 'follow_type' => $follow_type));
        }
        if (empty($count)) {
            $link_text = _x('Follow', 'Follow activity button', 'bp-follow');
        } else {
            $link_text = sprintf(_x('Follow %s', 'Follow activity button', 'bp-follow'), '<span>' . $count . '</span>');
        }
        if (empty($r['link_text'])) {
            $r['link_text'] = $link_text;
        }
    }
    $wrapper_class = 'follow-button ' . $id;
    if (!empty($r['wrapper_class'])) {
        $wrapper_class .= ' ' . esc_attr($r['wrapper_class']);
    }
    $link_class = $action;
    if (!empty($r['link_class'])) {
        $link_class .= ' ' . esc_attr($r['link_class']);
    }
    // setup the button arguments
    $button = array('id' => $id, 'component' => 'follow', 'must_be_logged_in' => true, 'block_self' => false, 'wrapper_class' => $wrapper_class, 'wrapper_id' => 'follow-button-' . (int) $r['leader_id'], 'link_href' => wp_nonce_url(trailingslashit(bp_get_activity_directory_permalink() . $action . '/' . esc_attr($r['leader_id'])), "bp_follow_activity_{$action}"), 'link_text' => $r['link_text'], 'link_title' => esc_attr($r['link_title']), 'link_id' => $action . '-' . (int) $r['leader_id'], 'link_class' => $link_class, 'wrapper' => !empty($r['wrapper']) ? esc_attr($r['wrapper']) : false);
    // Filter and output the HTML button
    bp_button(apply_filters('bp_follow_activity_get_follow_button', $button, $r, $is_following));
}
/**
 * Template tag to add a button.
 *
 * @param string $type The type of button. Either 'delete' or 'publish'.
 */
function cacsp_add_button($type = 'delete')
{
    $r = array('id' => "bpsp-{$type}", 'component' => 'members', 'must_be_logged_in' => true, 'block_self' => false, 'link_text' => 'delete' == $type ? __('Delete', 'social-paper') : __('Publish', 'social-paper'), 'wrapper_class' => 'paper-button', 'link_class' => 'paper-button');
    // add confirm class just so user can confirm the choice
    if ('delete' === $type) {
        $r['link_class'] .= ' confirm';
    }
    $r['link_href'] = wp_nonce_url(trailingslashit(bp_loggedin_user_domain() . 'papers/' . esc_attr($type) . '/' . get_post()->ID), "bp_social_paper_{$type}", "bpsp-{$type}");
    // Output button
    bp_button(apply_filters('bp_social_paper_button_args', $r));
}
/**
 * Single screen title
 *
 * @package Rendez Vous
 * @subpackage Parts
 *
 * @since Rendez Vous (1.0.0)
 */
function rendez_vous_single_title()
{
    rendez_vous_single_the_title();
    if (current_user_can('edit_rendez_vous', rendez_vous_single_get_the_id())) {
        bp_button(array('id' => 'edit-rendez-vous', 'component' => 'rendez_vous', 'must_be_logged_in' => true, 'block_self' => false, 'wrapper_id' => 'rendez-vous-edit-btn', 'wrapper_class' => 'right', 'link_class' => 'edit-rendez-vous', 'link_href' => rendez_vous_single_get_edit_link(), 'link_title' => __('Edit', 'rendez-vous'), 'link_text' => __('Edit', 'rendez-vous')));
    }
}