Skip to:
Content

BuddyPress.org

Changeset 1960


Ignore:
Timestamp:
09/26/2009 07:28:06 AM (16 years ago)
Author:
apeatling
Message:

Updated admin menu/submenu syntax. Props markjaquith.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r1959 r1960  
    284284        'menu_title' => __( 'BuddyPress', 'buddypress' ),
    285285        'page_title' => __( 'BuddyPress', 'buddypress' ),
    286         'access_level' => 10, 'file' => 'bp-core.php',
     286        'access_level' => 10, 'file' => 'bp-general-settings',
    287287        'function' => 'bp_core_admin_settings',
    288288        'position' => 2
    289289    ) );
    290290   
    291     add_submenu_page( 'bp-core.php', __( 'General Settings', 'buddypress'), __( 'General Settings', 'buddypress' ), 1, 'bp-core.php', 'bp_core_admin_settings' );
    292     add_submenu_page( 'bp-core.php', __( 'Component Setup', 'buddypress'), __( 'Component Setup', 'buddypress' ), 2, __FILE__, 'bp_core_admin_component_setup' );
     291    add_submenu_page( 'bp-general-settings', __( 'General Settings', 'buddypress'), __( 'General Settings', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_settings' );
     292    add_submenu_page( 'bp-general-settings', __( 'Component Setup', 'buddypress'), __( 'Component Setup', 'buddypress' ), 'manage_options', 'bp-component-setup', 'bp_core_admin_component_setup' );
    293293}
    294294add_action( 'admin_menu', 'bp_core_add_admin_menu' );
  • trunk/bp-core/bp-core-cssjs.php

    r1912 r1960  
    1212    global $current_blog;
    1313   
    14     if ( defined( 'BP_DISABLE_ADMIN_BAR') )
     14    if ( defined( 'BP_DISABLE_ADMIN_BAR' ) )
    1515        return false;
    1616   
  • trunk/bp-forums.php

    r1936 r1960  
    7575   
    7676    /* Add the administration tab under the "Site Admin" tab for site administrators */
    77     add_submenu_page( 'bp-core.php', __( 'Forums Setup', 'buddypress' ), __( 'Forums Setup', 'buddypress' ), 2, __FILE__, "bp_forums_bbpress_admin" );
     77    add_submenu_page( 'bp-general-settings', __( 'Forums Setup', 'buddypress' ), __( 'Forums Setup', 'buddypress' ), 'manage_options', 'bb-forums-setup', "bp_forums_bbpress_admin" );
    7878}
    7979add_action( 'admin_menu', 'bp_forums_add_admin_menu' );
  • trunk/bp-forums/bp-forums-admin.php

    r1905 r1960  
    2020            bp_forums_bbpress_install_wizard();
    2121        } else { ?>
    22             <p><?php printf( __( 'bbPress forum integration in BuddyPress has been set up correctly. If you are having problems you can <a href="%s" title="Reinstall bbPress">re-install</a>', 'buddypress' ), site_url( 'wp-admin/admin.php?page=buddypress/bp-forums.php&reinstall=1' ) ); ?>
     22            <p><?php printf( __( 'bbPress forum integration in BuddyPress has been set up correctly. If you are having problems you can <a href="%s" title="Reinstall bbPress">re-install</a>', 'buddypress' ), site_url( 'wp-admin/admin.php?page=bb-forums-setup&reinstall=1' ) ); ?>
    2323            <p><?php _e( 'NOTE: The forums directory will only work if your bbPress tables are in the same database as your WordPress tables. If you are not using an existing bbPress install you can ignore this message.', 'buddypress' ) ?></p>
    2424        <?php   
     
    3030
    3131function bp_forums_bbpress_install_wizard() {
    32     $post_url = site_url( 'wp-admin/admin.php?page=' . 'buddypress/bp-forums.php' );
     32    $post_url = site_url( 'wp-admin/admin.php?page=bb-forums-setup' );
    3333
    3434    switch( $_REQUEST['step'] ) {       
  • trunk/bp-xprofile.php

    r1934 r1960  
    178178           
    179179    /* Add the administration tab under the "Site Admin" tab for site administrators */
    180     add_submenu_page( 'bp-core.php', __("Profile Field Setup", 'buddypress'), __("Profile Field Setup", 'buddypress'), 1, __FILE__, "xprofile_admin" );
     180    add_submenu_page( 'bp-general-settings', __("Profile Field Setup", 'buddypress'), __("Profile Field Setup", 'buddypress'), 'manage-options', 'bp-profile-setup', "xprofile_admin" );
    181181
    182182    /* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
  • trunk/bp-xprofile/bp-xprofile-admin.php

    r1907 r1960  
    6666                                <th scope="col" colspan="<?php if ( $groups[$i]->can_delete ) { ?>3<?php } else { ?>5<?php } ?>"><?php echo attribute_escape( $groups[$i]->name ); ?></th>
    6767                                <?php if ( $groups[$i]->can_delete ) { ?>       
    68                                     <th scope="col"><a class="edit" href="admin.php?page=<?php echo BP_PLUGIN_DIR ?>/bp-xprofile.php&amp;mode=edit_group&amp;group_id=<?php echo attribute_escape( $groups[$i]->id ); ?>"><?php _e( 'Edit', 'buddypress' ) ?></a></th>
    69                                     <th scope="col"><a class="delete" href="admin.php?page=<?php echo BP_PLUGIN_DIR ?>/bp-xprofile.php&amp;mode=delete_group&amp;group_id=<?php echo attribute_escape( $groups[$i]->id ); ?>"><?php _e( 'Delete', 'buddypress' ) ?></a></th>
     68                                    <th scope="col"><a class="edit" href="admin.php?page=bp-profile-setup&amp;mode=edit_group&amp;group_id=<?php echo attribute_escape( $groups[$i]->id ); ?>"><?php _e( 'Edit', 'buddypress' ) ?></a></th>
     69                                    <th scope="col"><a class="delete" href="admin.php?page=bp-profile-setup&amp;mode=delete_group&amp;group_id=<?php echo attribute_escape( $groups[$i]->id ); ?>"><?php _e( 'Delete', 'buddypress' ) ?></a></th>
    7070                                <?php } ?>
    7171                            </tr>
     
    9393                                        <td><?php echo attribute_escape( $field->type ); ?></td>
    9494                                        <td style="text-align:center;"><?php if ( $field->is_required ) { echo '<img src="' . BP_PLUGIN_URL . '/bp-xprofile/admin/images/tick.gif" alt="' . __( 'Yes', 'buddypress' ) . '" />'; } else { ?>--<?php } ?></td>
    95                                         <td style="text-align:center;"><?php if ( !$field->can_delete ) { ?><strike><?php _e( 'Edit', 'buddypress' ) ?></strike><?php } else { ?><a class="edit" href="admin.php?page=<?php echo BP_PLUGIN_DIR ?>/bp-xprofile.php&amp;group_id=<?php echo attribute_escape( $groups[$i]->id ); ?>&amp;field_id=<?php echo attribute_escape( $field->id ); ?>&amp;mode=edit_field"><?php _e( 'Edit', 'buddypress' ) ?></a><?php } ?></td>
    96                                         <td style="text-align:center;"><?php if ( !$field->can_delete ) { ?><strike><?php _e( 'Delete', 'buddypress' ) ?></strike><?php } else { ?><a class="delete" href="admin.php?page=<?php echo BP_PLUGIN_DIR ?>/bp-xprofile.php&amp;field_id=<?php echo attribute_escape( $field->id ); ?>&amp;mode=delete_field"><?php _e( 'Delete', 'buddypress' ) ?></a><?php } ?></td>
     95                                        <td style="text-align:center;"><?php if ( !$field->can_delete ) { ?><strike><?php _e( 'Edit', 'buddypress' ) ?></strike><?php } else { ?><a class="edit" href="admin.php?page=bp-profile-setup&amp;group_id=<?php echo attribute_escape( $groups[$i]->id ); ?>&amp;field_id=<?php echo attribute_escape( $field->id ); ?>&amp;mode=edit_field"><?php _e( 'Edit', 'buddypress' ) ?></a><?php } ?></td>
     96                                        <td style="text-align:center;"><?php if ( !$field->can_delete ) { ?><strike><?php _e( 'Delete', 'buddypress' ) ?></strike><?php } else { ?><a class="delete" href="admin.php?page=bp-profile-setup&amp;field_id=<?php echo attribute_escape( $field->id ); ?>&amp;mode=delete_field"><?php _e( 'Delete', 'buddypress' ) ?></a><?php } ?></td>
    9797                                    </tr>
    9898                           
     
    112112                       
    113113                                <tr class="nodrag">
    114                                     <td colspan="6"><a href="admin.php?page=<?php echo BP_PLUGIN_DIR ?>/bp-xprofile.php&amp;group_id=<?php echo attribute_escape( $groups[$i]->id ); ?>&amp;mode=add_field"><?php _e( 'Add New Field', 'buddypress' ) ?></a></td>
     114                                    <td colspan="6"><a href="admin.php?page=bp-profile-setup&amp;group_id=<?php echo attribute_escape( $groups[$i]->id ); ?>&amp;mode=add_field"><?php _e( 'Add New Field', 'buddypress' ) ?></a></td>
    115115                                </tr>
    116116                       
     
    123123           
    124124                    <p>
    125                         <a class="button" href="admin.php?page=<?php echo BP_PLUGIN_DIR ?>/bp-xprofile.php&amp;mode=add_group"><?php _e( 'Add New Field Group', 'buddypress' ) ?></a>
     125                        <a class="button" href="admin.php?page=bp-profile-setup&amp;mode=add_group"><?php _e( 'Add New Field Group', 'buddypress' ) ?></a>
    126126                    </p>
    127127               
    128128            <?php } else { ?>
    129129                <div id="message" class="error"><p><?php _e('You have no groups.', 'buddypress' ); ?></p></div>
    130                 <p><a href="admin.php?page=<?php echo BP_PLUGIN_DIR ?>/bp-xprofile.php&amp;mode=add_group"><?php _e( 'Add New Group', 'buddypress' ) ?></a></p>
     130                <p><a href="admin.php?page=bp-profile-setup&amp;mode=add_group"><?php _e( 'Add New Group', 'buddypress' ) ?></a></p>
    131131            <?php } ?>
    132132       
  • trunk/bp-xprofile/bp-xprofile-classes.php

    r1907 r1960  
    135135        if ( !$this->id ) {
    136136            $title = __('Add New Field Group', 'buddypress');
    137             $action = "admin.php?page=" . BP_PLUGIN_DIR . "/bp-xprofile.php&amp;mode=add_group";
     137            $action = "admin.php?page=bp-profile-setup&amp;mode=add_group";
    138138        } else {
    139139            $title = __('Edit Field Group', 'buddypress');
    140             $action = "admin.php?page=" . BP_PLUGIN_DIR . "/bp-xprofile.php&amp;mode=edit_group&amp;group_id=" . $this->id;         
     140            $action = "admin.php?page=bp-profile-setup&amp;mode=edit_group&amp;group_id=" . $this->id;         
    141141        }
    142142    ?>
     
    491491                           <input type="<?php echo $default_input ?>" name="isDefault_<?php echo $type ?>_option<?php echo $default_name ?>" <?php if ( (int) $options[$i]->is_default_option ) {?> checked="checked"<?php } ?> " value="<?php echo $j ?>" /> <?php _e( 'Default Value', 'buddypress' ) ?>
    492492                            <?php if ( $j != 1 &&
    493                                 $options[$i]->id != -1 ) : ?><a href="admin.php?page=<?php echo BP_PLUGIN_DIR ?>/bp-xprofile.php&amp;mode=delete_option&amp;option_id=<?php echo $options[$i]->id ?>" class="ajax-option-delete" id="delete-<?php echo $options[$i]->id ?>">[x]</a><?php endif ?></p>
     493                                $options[$i]->id != -1 ) : ?><a href="admin.php?page=bp-profile-setup&amp;mode=delete_option&amp;option_id=<?php echo $options[$i]->id ?>" class="ajax-option-delete" id="delete-<?php echo $options[$i]->id ?>">[x]</a><?php endif ?></p>
    494494                        </p>
    495495                    <?php } // end for ?>
     
    517517        if ( !$this->id ) {
    518518            $title = __('Add Field', 'buddypress');
    519             $action = "admin.php?page=" . BP_PLUGIN_DIR . "/bp-xprofile.php&amp;group_id=" . $this->group_id . "&amp;mode=add_field";
     519            $action = "admin.php?page=bp-profile-setup&amp;group_id=" . $this->group_id . "&amp;mode=add_field";
    520520
    521521            $this->name         = $_POST['title'];
     
    526526        } else {
    527527            $title = __('Edit Field', 'buddypress');
    528             $action = "admin.php?page=" . BP_PLUGIN_DIR . "/bp-xprofile.php&amp;mode=edit_field&amp;group_id=" . $this->group_id . "&amp;field_id=" . $this->id;           
     528            $action = "admin.php?page=bp-profile-setup&amp;mode=edit_field&amp;group_id=" . $this->group_id . "&amp;field_id=" . $this->id;         
    529529        }
    530530    ?>
     
    584584                <p class="submit">
    585585                        &nbsp;<input type="submit" value="<?php _e("Save", 'buddypress') ?> &raquo;" name="saveField" id="saveField" style="font-weight: bold" />
    586                          <?php _e('or', 'buddypress') ?> <a href="admin.php?page=<?php echo BP_PLUGIN_DIR ?>/bp-xprofile.php" style="color: red"><?php _e( 'Cancel', 'buddypress' ) ?></a>
     586                         <?php _e('or', 'buddypress') ?> <a href="admin.php?page=bp-profile-setup" style="color: red"><?php _e( 'Cancel', 'buddypress' ) ?></a>
    587587                </p>
    588588           
  • trunk/bp-xprofile/bp-xprofile-cssjs.php

    r1905 r1960  
    77
    88function xprofile_add_admin_js() {
    9     if ( strpos( $_GET['page'], 'xprofile' ) !== false ) {
     9    if ( strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) {
    1010        wp_enqueue_script( array( "jquery-ui-sortable" ) );
    1111        wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . '/bp-xprofile/admin/js/admin.js', array( 'jquery' ) );
Note: See TracChangeset for help on using the changeset viewer.