Changeset 656

Show
Ignore:
Timestamp:
02/02/07 00:31:15 (2 years ago)
Author:
mdawaffe
Message:

use bb_admin_notice() for user admin pages

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bb-admin/admin-functions.php

    r653 r656  
    248248                elseif ( !is_wp_error($this->search_errors) ) 
    249249                        $this->search_errors = new WP_Error('no_matching_users_found', __('No matching users were found!')); 
     250 
     251                if ( is_wp_error( $this->search_errors ) ) 
     252                        bb_admin_notice( join( "<br />\n", $this->search_errors->get_error_messages() ), 'error' ); 
    250253        } 
    251254 
     
    314317                        $r .= "\t\t<input type='submit' value='" . __('Search for users &raquo;') . "' />\n\t</p>\n"; 
    315318                        $r .= "</form>\n\n"; 
    316                 } 
    317  
    318                 if ( is_wp_error( $this->search_errors ) ) { 
    319                         $r .= "<div class='error'>\n"; 
    320                         $r .= "\t<ul>\n"; 
    321                         foreach ( $this->search_errors->get_error_messages() as $message ) 
    322                                 $r .= "\t\t<li>$message</li>\n"; 
    323                         $r .= "\t</ul>\n</div>\n\n"; 
    324319                } 
    325320 
     
    394389                else 
    395390                        $this->search_errors = new WP_Error('no_matching_users_found', __('No matching users were found!')); 
     391 
     392                if ( is_wp_error( $this->search_errors ) ) 
     393                        bb_admin_notice( join( "<br />\n", $this->search_errors->get_error_messages() ), 'error' ); 
    396394        } 
    397395 
  • trunk/bb-admin/content-forums.php

    r615 r656  
    1010        if ( !$deleted_forum || $forums_count < 2 || !bb_current_user_can( 'delete_forum', $forum_to_delete ) ) 
    1111                wp_redirect( add_query_arg( array('action' => false, 'id' => false) ) ); 
     12} 
     13 
     14if ( isset($_GET['message']) ) { 
     15        switch ( $_GET['message'] ) : 
     16        case 'deleted' : 
     17                bb_admin_notice( sprintf(__('Forum deleted.  You should have bbPress <a href="%s">recount your site information</a>.'), bb_get_option( 'uri' ) . 'bb-admin/site.php') ); 
     18                break; 
     19        endswitch; 
    1220} 
    1321 
     
    5462</div> 
    5563<?php else: // action ?> 
    56 <?php if ( isset($_GET['message']) ) : ?> 
    57 <div class="updated"> 
    58         <p> 
    59 <?php 
    60 switch ( $_GET['message'] ) : 
    61 case 'deleted' : 
    62         printf(__('Forum deleted.  You should have bbPress <a href="%s">recount your site information</a>.'), bb_get_option( 'uri' ) . 'bb-admin/site.php'); 
    63         break; 
    64 endswitch; 
    65 ?> 
    66         </p> 
    67 </div> 
    68 <?php endif; ?> 
     64 
    6965<form method="post" id="add-forum" action="<?php bb_option('uri'); ?>bb-admin/bb-forum.php"> 
    7066        <h3><?php _e('Add forum'); ?></h3> 
  • trunk/bb-admin/themes.php

    r654 r656  
    1515        $activetheme = BBPATH . 'bb-templates/kakumei'; 
    1616        bb_update_option('bb_active_theme',$activetheme); 
    17         bb_admin_notice( __('Theme not found.  Default theme applied.') ); 
     17        bb_admin_notice( __('Theme not found.  Default theme applied.'), 'error' ); 
    1818} 
    1919 
  • trunk/bb-admin/users-blocked.php

    r651 r656  
    11<?php 
    22require_once('admin.php'); 
    3 bb_get_admin_header(); 
    43 
    54// Query the users 
    65$bb_blocked_users = new BB_Users_By_Role( array('inactive', 'blocked'), $_GET['userspage'] ); 
     6 
     7bb_get_admin_header(); 
     8 
    79$bb_blocked_users->title = __('These users have been blocked by the forum administrators'); 
    810$bb_blocked_users->display( false, bb_current_user_can( 'edit_users' ) ); 
  • trunk/bb-admin/users-moderators.php

    r651 r656  
    11<?php 
    22require_once('admin.php'); 
    3 bb_get_admin_header(); 
    43 
    54// Query the users 
    65$bb_moderators = new BB_Users_By_Role( bb_trusted_roles(), $_GET['userspage'] ); 
     6 
     7bb_get_admin_header(); 
     8 
    79$bb_moderators->title = __('Forum Administrators'); 
    810$bb_moderators->display( false, bb_current_user_can( 'edit_users' ) ); 
  • trunk/bb-admin/users.php

    r651 r656  
    11<?php 
    22require_once('admin.php'); 
    3 bb_get_admin_header(); 
    43 
    54// Query the users 
    65$bb_user_search = new BB_User_Search($_GET['usersearch'], $_GET['userspage']); 
     6 
     7bb_get_admin_header(); 
     8 
    79$bb_user_search->display( true, bb_current_user_can( 'edit_users' ) ); 
    810