Changeset 1803

Show
Ignore:
Timestamp:
04/08/08 08:11:45 (8 months ago)
Author:
auno
Message:

Skip the blog selection step if only one blog exists. BugzID:74898

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-34/lib/MT/CMS/User.pm

    r1752 r1803  
    13671367        } 
    13681368        if ( !$blog_id ) { 
    1369             push @panels, 'blog'; 
     1369            my @blogs; 
     1370            my $iter = MT::Blog->load_iter(); 
     1371            while ( my $blog = $iter->() ) { 
     1372                push @blogs, $blog->id; 
     1373            } 
     1374 
     1375            # if only one blog exists, skip the blog selection step. 
     1376            if ( @blogs == 1 ) { 
     1377                $blog_id = $blogs[0]; 
     1378            } 
     1379            else { 
     1380                push @panels, 'blog'; 
     1381            } 
    13701382        } 
    13711383        if ( !$author_id ) {