Ticket #1485498 (new Feature Requests)

Opened 3 months ago

Last modified 7 weeks ago

show disabled checkboxes for protected folders instead of dots or dashes

Reported by: tensor Owned by:
Priority: 5 Milestone: later
Component: User Interface Version: 0.2-beta
Severity: trivial Keywords:
Cc:

Description

It is not visually clear what a dot corresponds to: subscribed or not subscribed folder.

A patch to show disabled checkboxes instead of the dot or dash.

=== program/steps/settings/manage_folders.inc
==================================================================
--- program/steps/settings/manage_folders.inc   (revision 2068)
+++ program/steps/settings/manage_folders.inc   (local)
@@ -208,11 +208,6 @@
     $seen[$folder]++;
   }
 
-  $checkbox_subscribe = new html_checkbox(array(
-    'name' => '_subscribed[]',
-    'onclick' => JS_OBJECT_NAME.".command(this.checked?'subscribe':'unsubscribe',this.value)",
-  ));
-  
   if (!empty($attrib['deleteicon']))
     $del_button = html::img(array('src' => $CONFIG['skin_path'] . $attrib['deleteicon'], 'alt' => rcube_label('delete')));
   else
@@ -240,9 +235,15 @@
     
     $table->add('name', Q($display_folder));
     $table->add('msgcount', ($folder['virtual'] ? '' : $IMAP->messagecount($folder['id'])));
-    $table->add('subscribed', $protected ? ($subscribed ? ' •' : ' -') :
-        $checkbox_subscribe->show(($subscribed ? $folder_utf8 : ''), array('value' => $folder_utf8)));
-    
+    $checkbox_subscribe = new html_checkbox(array(
+      'name' => '_subscribed[]',
+      'onclick' => JS_OBJECT_NAME.".command(this.checked?'subscribe':'unsubscribe',this.value)",
+    ));
+    $chk_attribs =  array('value' => $folder_utf8);
+    //TODO: special handling for disabled={true,false} (also for readonly, etc.)
+    if ($protected)
+      $chk_attribs['disabled'] = 'disabled'; 
+    $table->add('subscribed', $checkbox_subscribe->show(($subscribed ? $folder_utf8 : ''), $chk_attribs));
     // add rename and delete buttons
     if (!$protected) {
       $table->add('rename', html::a(array('href' => "#rename", 'title' => rcube_label('renamefolder')), $edit_button));

Change History

Changed 2 months ago by tensor

There is a minor issue with the patch. When adding or removing folders, the checkboxes become active. More work needed.

Changed 7 weeks ago by thomasb

  • milestone changed from 0.2-stable to later
Note: See TracTickets for help on using tickets.