When a plugin returns 0 items for the Admins Block, don't display that as 'N/A' (bug #0001025) HEAD
authorDirk Haun <dirk@haun-online.de>
Sat Nov 07 11:35:44 2009 +0100 (2009-11-07)
branchHEAD
changeset 7445b0971977fd28
parent 7444 252d8d24012d
child 7446 3e2bd1e79a57
When a plugin returns 0 items for the Admins Block, don't display that as 'N/A' (bug #0001025)
plugins/spamx/functions.inc
public_html/docs/history
public_html/lib-common.php
     1.1 --- a/plugins/spamx/functions.inc	Sat Nov 07 11:15:02 2009 +0100
     1.2 +++ b/plugins/spamx/functions.inc	Sat Nov 07 11:35:44 2009 +0100
     1.3 @@ -139,7 +139,7 @@
     1.4  
     1.5      if (SEC_hasRights('spamx.admin')) {
     1.6          return array($LANG_SX00['plugin_name'],
     1.7 -            $_CONF['site_admin_url'] . '/plugins/spamx/index.php', 0);
     1.8 +            $_CONF['site_admin_url'] . '/plugins/spamx/index.php', '');
     1.9      }
    1.10  }
    1.11  
     2.1 --- a/public_html/docs/history	Sat Nov 07 11:15:02 2009 +0100
     2.2 +++ b/public_html/docs/history	Sat Nov 07 11:35:44 2009 +0100
     2.3 @@ -4,6 +4,8 @@
     2.4  ------------
     2.5  
     2.6  Changes since 1.6.1b1:
     2.7 +- When a plugin returns 0 items for the Admins Block, don't display that as
     2.8 +  'N/A' (bug #0001025) [Dirk]
     2.9  - Fixed a bug in the Group Editor that didn't let you add groups to other groups
    2.10    unless your $_TABLES['groups'] happened to be called "groups" (bug #0000998)
    2.11    [Dirk]
     3.1 --- a/public_html/lib-common.php	Sat Nov 07 11:15:02 2009 +0100
     3.2 +++ b/public_html/lib-common.php	Sat Nov 07 11:35:44 2009 +0100
     3.3 @@ -2758,28 +2758,27 @@
     3.4  
     3.5          // This will show the admin options for all installed plugins (if any)
     3.6  
     3.7 -        for( $i = 0; $i < $num_plugins; $i++ )
     3.8 -        {
     3.9 -            $plg = current( $plugin_options );
    3.10 -
    3.11 -            $adminmenu->set_var( 'option_url', $plg->adminurl );
    3.12 -            $adminmenu->set_var( 'option_label', $plg->adminlabel );
    3.13 -
    3.14 -            if( empty( $plg->numsubmissions ))
    3.15 -            {
    3.16 -                $adminmenu->set_var( 'option_count', $LANG_ADMIN['na'] );
    3.17 +        for ($i = 0; $i < $num_plugins; $i++) {
    3.18 +            $plg = current($plugin_options);
    3.19 +
    3.20 +            $adminmenu->set_var('option_url',   $plg->adminurl);
    3.21 +            $adminmenu->set_var('option_label', $plg->adminlabel);
    3.22 +
    3.23 +            if (isset($plg->numsubmissions) &&
    3.24 +                    is_numeric($plg->numsubmissions)) {
    3.25 +                $adminmenu->set_var('option_count',
    3.26 +                                    COM_numberFormat($plg->numsubmissions));
    3.27 +            } elseif (! empty($plg->numsubmissions)) {
    3.28 +                $adminmenu->set_var('option_count', $plg->numsubmissions);
    3.29 +            } else {
    3.30 +                $adminmenu->set_var('option_count', $LANG_ADMIN['na']);
    3.31              }
    3.32 -            else
    3.33 -            {
    3.34 -                $adminmenu->set_var( 'option_count',
    3.35 -                                     COM_numberFormat( $plg->numsubmissions ));
    3.36 -            }
    3.37 -
    3.38 -            $menu_item = $adminmenu->parse( 'item',
    3.39 -                    ( $thisUrl == $plg->adminurl ) ? 'current' : 'option', true );
    3.40 +
    3.41 +            $menu_item = $adminmenu->parse('item',
    3.42 +                    ($thisUrl == $plg->adminurl) ? 'current' : 'option', true);
    3.43              $link_array[$plg->adminlabel] = $menu_item;
    3.44  
    3.45 -            next( $plugin_options );
    3.46 +            next($plugin_options);
    3.47          }
    3.48  
    3.49          if(( $_CONF['allow_mysqldump'] == 1 ) AND ( $_DB_dbms == 'mysql' ) AND