Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/31/2016 03:04:39 PM (3 years ago)
Author:
hnla
Message:

Templates Legacy: Single Groups Admin Screens

Group admin template managing the settings & create steps sub screens has become a file which is hard for developers to navigate through to edit.

Commit re-factors the admin.php file to run as a primary include file checking for the current action variable to load the required template part.

Commit breaks out the sections representing settings /creation steps from the admin template to their own template include files located in a new directory 'single/admin/'.

Smaller split template files are now easier to manage & read for editing and overloading.

Commit re-locates admin files hidden form input to buddypress-functions.php hooking to the existing templates do_action function.

Thanks to Offereins for the original ticket - this commit follows closely the approach used in bp-nouveau templates.

Props offereins, dcavins, r-a-y

Fixes #7079

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/buddypress-functions.php

    r11031 r11050  
    106106            // Group buttons.
    107107            if ( bp_is_active( 'groups' ) ) {
    108                 add_action( 'bp_group_header_actions',          'bp_group_join_button',               5 );
    109                 add_action( 'bp_group_header_actions',          'bp_group_new_topic_button',         20 );
    110                 add_action( 'bp_directory_groups_actions',      'bp_group_join_button'                  );
    111                 add_action( 'bp_groups_directory_group_filter', 'bp_legacy_theme_group_create_nav', 999 );
     108                add_action( 'bp_group_header_actions',          'bp_group_join_button',               5      );
     109                add_action( 'bp_group_header_actions',          'bp_group_new_topic_button',         20      );
     110                add_action( 'bp_directory_groups_actions',      'bp_group_join_button'                       );
     111                add_action( 'bp_groups_directory_group_filter', 'bp_legacy_theme_group_create_nav', 999      );
     112                add_action( 'bp_after_group_admin_content',     'bp_legacy_groups_admin_screen_hidden_input' );
    112113            }
    113114
     
    607608
    608609/**
     610 * Renders the group ID hidden input on group admin screens.
     611 *
     612 * @since 2.7.0
     613 *
     614 * @return string html
     615 */
     616function bp_legacy_groups_admin_screen_hidden_input() {
     617    ?>
     618    <input type="hidden" name="group-id" id="group-id" value="<?php bp_group_id(); ?>" />
     619    <?php
     620}
     621
     622/**
    609623 * Add the Create a Site button to the Sites directory title.
    610624 *
Note: See TracChangeset for help on using the changeset viewer.