Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/23/2018 07:10:32 PM (8 years ago)
Author:
mercime
Message:

Finalize the new Site Notices admin screen.

Props mercime, djpaul.
Fixes #7721.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/classes/class-bp-messages-notices-admin.php

    r11870 r11910  
    3737     */
    3838    public $list_table = '';
    39    
     39
    4040
    4141    /**
     
    8888
    8989    /**
    90      * Add the 'All Member Notices' admin menu item.
     90     * Add the 'Site Notices' admin menu item.
    9191     *
    9292     * @since 3.0.0
     
    9999
    100100        $this->screen_id = add_users_page(
    101             _x( 'All Member Notices', 'Notices admin page title', 'buddypress' ),
    102             _x( 'All Member Notices', 'Admin Users menu', 'buddypress' ),
     101            _x( 'Site Notices', 'Notices admin page title', 'buddypress' ),
     102            _x( 'Site Notices', 'Admin Users menu', 'buddypress' ),
    103103            'manage_options',
    104104            'bp-notices',
     
    155155                    $notice = new BP_Messages_Notice( $notice_id );
    156156                    $success = $notice->delete();
    157                     break;         
     157                    break;
    158158            }
    159159            if ( $success ) {
     
    186186            <?php if ( version_compare( $GLOBALS['wp_version'], '4.8', '>=' ) ) : ?>
    187187
    188                 <h1 class="wp-heading-inline"><?php echo esc_html_x( 'All Member Notices', 'Notices admin page title', 'buddypress' ); ?></h1>
    189 
    190                     <a id="add_notice" class="page-title-action" href="#"><?php esc_html_e( 'Add New Notice', 'buddypress' ); ?></a>
    191 
     188                <h1 class="wp-heading-inline"><?php echo esc_html_x( 'Site Notices', 'Notices admin page title', 'buddypress' ); ?></h1>
    192189                <hr class="wp-header-end">
    193190
    194191            <?php else : ?>
    195192
    196                 <h1>
    197                     <?php echo esc_html_x( 'All Member Notices', 'Notices admin page title', 'buddypress' ); ?>
    198                     <a id="add_notice" class="add-new-h2" href="#"><?php esc_html_e( 'Add New Notice', 'buddypress' ); ?></a>
    199                 </h1>
     193                <h1><?php echo esc_html_x( 'Site Notices', 'Notices admin page title', 'buddypress' ); ?></h1>
    200194
    201195            <?php endif; ?>
    202196
    203             <form action=<?php echo esc_url( wp_nonce_url( $this->url, 'new-notice', 'ns-nonce' ) ); ?> method="post">
    204                 <table class="widefat">
    205                     <tr>
    206                         <td><label for="bp_notice_subject"><?php esc_html_e( 'Subject', 'buddypress' ); ?></label></td>
    207                         <td><input type="text" class="widefat" id="bp_notice_subject" name="bp_notice[subject]"/></td>
    208                     </tr>
    209                     <tr>
    210                         <td><label for="bp_notice_content"><?php esc_html_e( 'Content', 'buddypress' ); ?></label></td>
    211                         <td><textarea class="widefat" id="bp_notice_content" name="bp_notice[content]"></textarea></td>
    212                     </tr>
    213                     <tr class="submit">
    214                         <td>&nbsp;</td>
    215                         <td style="float:right">
    216                             <input type="reset" value="<?php esc_attr_e( 'Cancel Notice', 'buddypress' ); ?>" class="button-secondary">
    217                             <input type="submit" value="<?php esc_attr_e( 'Save Notice', 'buddypress' ); ?>" name="bp_notice[send]" class="button-primary">
    218                         </td>
    219                     </tr>
    220                 </table>
    221             <form>
     197            <p class="bp-notice-about"><?php esc_html_e( 'Manage notices shown at front end of your site to all logged-in users.', 'buddypress' ); ?></p>
     198
     199            <div class="bp-new-notice-panel">
     200
     201                <h2 class="bp-new-notice"><?php esc_html_e( 'Add New Notice', 'buddypress' ); ?></h2>
     202
     203                <form action="<?php echo esc_url( wp_nonce_url( $this->url, 'new-notice', 'ns-nonce' ) ); ?>" method="post">
     204
     205                    <div>
     206                        <label for="bp_notice_subject"><?php esc_html_e( 'Subject', 'buddypress' ); ?></label>
     207                        <input type="text" class="bp-panel-input" id="bp_notice_subject" name="bp_notice[subject]"/>
     208
     209                        <label for="bp_notice_content"><?php esc_html_e( 'Content', 'buddypress' ); ?></label>
     210                        <textarea class="bp-panel-textarea" id="bp_notice_content" name="bp_notice[content]"></textarea>
     211                    </div>
     212
     213                    <input type="submit" value="<?php esc_attr_e( 'Publish Notice', 'buddypress' ); ?>" name="bp_notice[send]" class="button button-primary save alignleft">
     214
     215                </form>
     216
     217            </div>
    222218
    223219            <?php if ( isset( $_GET['success'] ) || isset( $_GET['error'] ) ) : ?>
     
    231227                                esc_html_e( 'Notice was not created. Please try again.', 'buddypress' );
    232228                            } else {
    233                                 esc_html_e( 'Notice was not updated. Please try again.', 'buddypress' );                           
     229                                esc_html_e( 'Notice was not updated. Please try again.', 'buddypress' );
    234230                            }
    235231                         } else {
     
    247243            <?php endif; ?>
    248244
     245            <h2 class="bp-notices-list"><?php esc_html_e( 'Notices List', 'buddypress' ); ?></h2>
     246
    249247            <?php $this->list_table->display(); ?>
    250248
Note: See TracChangeset for help on using the changeset viewer.