- // Size
- if ($msgcount) {
- // create link with folder-size command
- $onclick = sprintf("return %s.command('folder-size', '%s', this)",
- JS_OBJECT_NAME, JQ($mbox_imap));
- $size = html::a(array('href' => '#', 'onclick' => $onclick, 'id' => 'folder-size'),
- rcube_label('getfoldersize'));
+ if ((!$options['noselect'] && !$options['is_root']) || $mbox_imap == 'INBOX') {
+ $msgcount = $RCMAIL->imap->messagecount($mbox_imap, 'ALL', true, false);
+
+ // Size
+ if ($msgcount) {
+ // create link with folder-size command
+ $onclick = sprintf("return %s.command('folder-size', '%s', this)",
+ JS_OBJECT_NAME, JQ($mbox_imap));
+ $size = html::a(array('href' => '#', 'onclick' => $onclick,
+ 'id' => 'folder-size'), rcube_label('getfoldersize'));
+ }
+ else {
+ // no messages -> zero size
+ $size = 0;
+ }
+
+ $form['props']['fieldsets']['info']['content']['count'] = array(
+ 'label' => rcube_label('messagecount'),
+ 'value' => (int) $msgcount
+ );
+ $form['props']['fieldsets']['info']['content']['size'] = array(
+ 'label' => rcube_label('size'),
+ 'value' => $size,
+ );