Dotclear


Ignore:
Timestamp:
01/29/14 13:32:04 (12 years ago)
Author:
Dsls
Branch:
default
Message:

Added "none", "one","more" attributes to all *Count template tags, fixes #1147

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/attachments/_public.php

    r2566 r2646  
    211211     public static function EntryAttachmentCount($attr) 
    212212     { 
    213           $none = 'no attachment'; 
    214           $one = 'one attachment'; 
    215           $more = '%d attachments'; 
    216  
    217           if (isset($attr['none'])) { 
    218                $none = addslashes($attr['none']); 
    219           } 
    220           if (isset($attr['one'])) { 
    221                $one = addslashes($attr['one']); 
    222           } 
    223           if (isset($attr['more'])) { 
    224                $more = addslashes($attr['more']); 
    225           } 
    226  
    227           return 
    228           "<?php if (\$_ctx->posts->countMedia() == 0) {\n". 
    229           "  printf(__('".$none."'),(integer) \$_ctx->posts->countMedia());\n". 
    230           "} elseif (\$_ctx->posts->countMedia() == 1) {\n". 
    231           "  printf(__('".$one."'),(integer) \$_ctx->posts->countMedia());\n". 
    232           "} else {\n". 
    233           "  printf(__('".$more."'),(integer) \$_ctx->posts->countMedia());\n". 
    234           "} ?>"; 
     213          global $core; 
     214          return $core->tpl->displayCounter( 
     215               '$_ctx->posts->countMedia()', 
     216               array( 
     217                    'none' => 'no attachment', 
     218                    'one'  => 'one attachment', 
     219                    'more' => '%d attachments' 
     220               ), 
     221               $attr, 
     222               false 
     223          ); 
    235224     } 
    236225} 
Note: See TracChangeset for help on using the changeset viewer.

Sites map