Dotclear

Changeset 203:7d4b71c7c72f


Ignore:
Timestamp:
05/07/11 16:35:27 (14 years ago)
Author:
Franck <carnet.franck.paul@…>
Branch:
default
Children:
206:ccf48ff350d5, 207:19dcc79dc756
Message:

Rajout du nombre d'indésirables sous le favori des commentaires - comme c'était le cas avec les versions précédentes, 2.2.x et antérieures.

Location:
plugins/antispam
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/antispam/_admin.php

    r74 r203  
    2525 
    2626$core->addBehavior('adminDashboardFavs','antispamDashboardFavs'); 
     27$core->addBehavior('adminDashboardFavsIcon','antispamDashboardFavsIcon'); 
    2728 
    2829function antispamDashboardFavs($core,$favs) 
     
    3132          'index.php?pf=antispam/icon.png','index.php?pf=antispam/icon-big.png', 
    3233          'admin',null,null)); 
     34} 
     35 
     36function antispamDashboardFavsIcon($core,$name,$icon) 
     37{ 
     38     // Check if it is comments favs 
     39     if ($name == 'comments') { 
     40          // Hack comments title if there is at least one spam 
     41          $str = dcAntispam::dashboardIconTitle($core); 
     42          if ($str != '') { 
     43               $icon[0] .= $str; 
     44          } 
     45     } 
    3346} 
    3447 
  • plugins/antispam/inc/lib.dc.antispam.php

    r0 r203  
    7979     } 
    8080      
     81     public static function dashboardIconTitle($core) 
     82     { 
     83          if (($count = self::countSpam($core)) > 0) { 
     84               $str = ($count > 1) ? __('(including %d spam comments)') : __('(including %d spam comment)'); 
     85               return '</a> <br /><a href="comments.php?status=-2">'.sprintf($str,$count); 
     86          } else { 
     87               return ''; 
     88          } 
     89     } 
     90      
    8191     public static function countSpam($core) 
    8292     { 
Note: See TracChangeset for help on using the changeset viewer.

Sites map