Changeset 2633

Show
Ignore:
Timestamp:
06/24/08 01:50:07 (5 months ago)
Author:
fumiakiy
Message:

Allow XxxScore and XxxScoreAvg template tags to have singular, plural and/or none modifiers.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-40/lib/MT/Template/ContextHandlers.pm

    r2613 r2633  
    1537715377} 
    1537815378 
     15379# FIXME: should this routine return an empty string? 
    1537915380sub _object_score_for { 
    1538015381    my ($stash_key, $ctx, $args, $cond) = @_; 
     
    1538715388        return $args->{default}; 
    1538815389    } 
    15389     $score; 
    15390        
     15390    return $ctx->count_format($score, $args); 
    1539115391} 
    1539215392 
     
    1558915589} 
    1559015590 
     15591# FIXME: should this routine return an empty string? 
    1559115592sub _object_score_avg { 
    1559215593    my ($stash_key, $ctx, $args, $cond) = @_; 
     
    1559515596    my $object = $ctx->stash($stash_key); 
    1559615597    return '' unless $object; 
    15597     return $object->score_avg($key); 
     15598    my $avg = $object->score_avg($key); 
     15599    return $ctx->count_format($avg, $args); 
    1559815600} 
    1559915601