Skip to:
Content

BuddyPress.org

Changeset 9057


Ignore:
Timestamp:
09/30/2014 01:57:50 AM (12 years ago)
Author:
boonebgorges
Message:

Improved documentation in bp-groups-template.php

See #5022

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-template.php

    r9048 r9057  
    22872287        }
    22882288
     2289/**
     2290 * HTML admin subnav items for group pages.
     2291 *
     2292 * @param object $group Optional. Group object. Default: current group in
     2293 *        the loop.
     2294 */
    22892295function bp_group_admin_tabs( $group = false ) {
    22902296        global $groups_template;
     
    23282334}
    23292335
     2336/**
     2337 * Output the group count for the displayed user.
     2338 */
    23302339function bp_group_total_for_member() {
    23312340        echo bp_get_group_total_for_member();
    23322341}
     2342        /**
     2343         * Get the group count for the displayed user.
     2344         *
     2345         * @return string
     2346         */
    23332347        function bp_get_group_total_for_member() {
    23342348                return apply_filters( 'bp_get_group_total_for_member', BP_Groups_Member::total_group_count() );
    23352349        }
    23362350
     2351/**
     2352 * Output the 'action' attribute for a group form.
     2353 *
     2354 * @param string $page Page slug.
     2355 */
    23372356function bp_group_form_action( $page ) {
    23382357        echo bp_get_group_form_action( $page );
    23392358}
     2359        /**
     2360         * Generate the 'action' attribute for a group form.
     2361         *
     2362         * @param string $page Page slug.
     2363         * @param object $group Optional. Group object. Default: current group
     2364         *        in the loop.
     2365         * @return string
     2366         */
    23402367        function bp_get_group_form_action( $page, $group = false ) {
    23412368                global $groups_template;
     
    23472374        }
    23482375
     2376/**
     2377 * Output the 'action' attribute for a group admin form.
     2378 *
     2379 * @param string $page Optional. Page slug.
     2380 */
    23492381function bp_group_admin_form_action( $page = false ) {
    23502382        echo bp_get_group_admin_form_action( $page );
    23512383}
     2384        /**
     2385         * Generate the 'action' attribute for a group admin form.
     2386         *
     2387         * @param string $page Optional. Page slug.
     2388         * @param object $group Optional. Group object. Default: current group
     2389         *        in the loop.
     2390         * @return string
     2391         */
    23522392        function bp_get_group_admin_form_action( $page = false, $group = false ) {
    23532393                global $groups_template;
     
    23622402        }
    23632403
     2404/**
     2405 * Determine whether the logged-in user has requested membership to a group.
     2406 *
     2407 * @param object $group Optional. Group object. Default: current group in
     2408 *        the loop.
     2409 * @return bool
     2410 */
    23642411function bp_group_has_requested_membership( $group = false ) {
    23652412        global $groups_template;
     
    23752422
    23762423/**
    2377  * bp_group_is_member()
    2378  *
    2379  * Checks if current user is member of a group.
    2380  *
    2381  * @uses bp_current_user_can() Check if current user is super admin
    2382  * @uses apply_filters Creates bp_group_is_member filter and passes $is_member
    2383  * @usedby groups/activity.php, groups/single/forum/edit.php, groups/single/forum/topic.php to determine template part visibility
    2384  * @global object $groups_template Current Group (usually in template loop)
    2385  * @param object $group Group to check is_member
    2386  * @return bool If user is member of group or not
     2424 * Check if current user is member of a group.
     2425 *
     2426 * @global object $groups_template
     2427 *
     2428 * @param object $group Optional. Group to check is_member. Default: current
     2429 *        group in the loop.
     2430 * @return bool If user is member of group or not.
    23872431 */
    23882432function bp_group_is_member( $group = false ) {
     
    24022446 * Check whether the current user has an outstanding invite to the current group in the loop.
    24032447 *
    2404  * @param object $group Optional. Group data object. Defaults to the current
     2448 * @param object $group Optional. Group data object. Default: the current
    24052449 *        group in the groups loop.
    24062450 * @return bool True if the user has an outstanding invite, otherwise false.
     
    24702514}
    24712515
     2516/**
     2517 * Output the URL for accepting an invitation to the current group in the loop.
     2518 */
    24722519function bp_group_accept_invite_link() {
    24732520        echo bp_get_group_accept_invite_link();
    24742521}
     2522        /**
     2523         * Generate the URL for accepting an invitation to a group.
     2524         *
     2525         * @param object $group Optional. Group object. Default: Current group
     2526         *        in the loop.
     2527         * @return string
     2528         */
    24752529        function bp_get_group_accept_invite_link( $group = false ) {
    24762530                global $groups_template, $bp;
     
    24822536        }
    24832537
     2538/**
     2539 * Output the URL for accepting an invitation to the current group in the loop.
     2540 */
    24842541function bp_group_reject_invite_link() {
    24852542        echo bp_get_group_reject_invite_link();
    24862543}
     2544        /**
     2545         * Generate the URL for rejecting an invitation to a group.
     2546         *
     2547         * @param object $group Optional. Group object. Default: Current group
     2548         *        in the loop.
     2549         * @return string
     2550         */
    24872551        function bp_get_group_reject_invite_link( $group = false ) {
    24882552                global $groups_template, $bp;
     
    24942558        }
    24952559
     2560/**
     2561 * Output the URL for confirming a request to leave a group.
     2562 */
    24962563function bp_group_leave_confirm_link() {
    24972564        echo bp_get_group_leave_confirm_link();
    24982565}
     2566        /**
     2567         * Generate the URL for confirming a request to leave a group.
     2568         *
     2569         * @param object $group Optional. Group object. Default: Current group
     2570         *        in the loop.
     2571         * @return string
     2572         */
    24992573        function bp_get_group_leave_confirm_link( $group = false ) {
    25002574                global $groups_template;
     
    25062580        }
    25072581
     2582/**
     2583 * Output the URL for rejecting a request to leave a group.
     2584 */
    25082585function bp_group_leave_reject_link() {
    25092586        echo bp_get_group_leave_reject_link();
    25102587}
     2588        /**
     2589         * Generate the URL for rejecting a request to leave a group.
     2590         *
     2591         * @param object $group Optional. Group object. Default: Current group
     2592         *        in the loop.
     2593         * @return string
     2594         */
    25112595        function bp_get_group_leave_reject_link( $group = false ) {
    25122596                global $groups_template;
     
    25182602        }
    25192603
     2604/**
     2605 * Output the 'action' attribute for a group send invite form.
     2606 */
    25202607function bp_group_send_invite_form_action() {
    25212608        echo bp_get_group_send_invite_form_action();
    25222609}
     2610        /**
     2611         * Output the 'action' attribute for a group send invite form.
     2612         *
     2613         * @param object $page Optional. Group object. Default: current group
     2614         *        in the loop.
     2615         * @return string
     2616         */
    25232617        function bp_get_group_send_invite_form_action( $group = false ) {
    25242618                global $groups_template;
     
    25302624        }
    25312625
     2626/**
     2627 * Determine whether the current user has friends to invite to a group.
     2628 *
     2629 * @param object $group Optional. Group object. Default: current group in
     2630 *        the loop.
     2631 * @return bool
     2632 */
    25322633function bp_has_friends_to_invite( $group = false ) {
    25332634        global $groups_template;
     
    25462647
    25472648/**
    2548  * Outputs a 'New Topic' button for a group.
     2649 * Output a 'New Topic' button for a group.
    25492650 *
    25502651 * @since BuddyPress (1.2.7)
    25512652 *
    2552  * @param BP_Groups_Group|bool $group The BP Groups_Group object if passed, boolean false if not passed.
    2553  * @uses bp_get_group_new_topic_button() Returns the 'New Topic' button
     2653 * @param BP_Groups_Group|bool $group The BP Groups_Group object if passed,
     2654 *        boolean false if not passed.
    25542655 */
    25552656function bp_group_new_topic_button( $group = false ) {
     
    25612662         * @since BuddyPress (1.2.7)
    25622663         *
    2563          * @param BP_Groups_Group|bool $group The BP Groups_Group object if passed, boolean false if not passed.
    2564          * @uses is_user_logged_in() Is there a user logged in?
    2565          * @uses bp_group_is_user_banned() Is the current user banned from the current group?
    2566          * @uses bp_is_group_forum() Are we on a group forum page?
    2567          * @uses bp_is_group_forum_topic() Are we on a group topic page?
    2568          * @uses bp_get_button() Renders a button
    2569          * @return string HTML code for the button
     2664         * @param BP_Groups_Group|bool $group The BP Groups_Group object if
     2665         *        passed, boolean false if not passed.
     2666         * @return string HTML code for the button.
    25702667         */
    25712668        function bp_get_group_new_topic_button( $group = false ) {
Note: See TracChangeset for help on using the changeset viewer.