thomascube
2011-08-18 fbe54043cf598b19a753dc2b21a7ed558d23fd15
program/steps/settings/folders.inc
@@ -251,6 +251,13 @@
    unset($seen);
    // add drop-target representing 'root'
    $table->add_row(array('id' => 'mailboxroot', 'class' => 'virtual root'));
    $table->add('name', ' ');
    $table->add(null, ' ');
    $a_js_folders['mailboxroot'] = array('', '', true);
    $checkbox_subscribe = new html_checkbox(array(
        'name'    => '_subscribed[]',
        'title'   => rcube_label('changesubscription'),
@@ -260,7 +267,8 @@
    // create list of available folders
    foreach ($list_folders as $i => $folder) {
        $idx        = $i + 1;
        $subscribed = in_array($folder['id'], $a_subscribed);
        $sub_key    = array_search($folder['id'], $a_subscribed);
        $subscribed = $sub_key !== false;
        $protected  = ($CONFIG['protect_default_folders'] == true && in_array($folder['id'], $CONFIG['default_imap_folders']));
        $noselect   = false;
        $classes    = array($i%2 ? 'even' : 'odd');
@@ -306,6 +314,16 @@
                }
            }
        }
        // check if the folder is shared, then disable subscription option on it
        if (!$disabled && $folder['virtual'] && !empty($namespace)) {
            $tmp_ns = array_merge((array)$namespace['other'], (array)$namespace['shared']);
            foreach ($tmp_ns as $item) {
                if (strpos($folder['id'], $item[0]) === 0) {
                    $disabled = true;
                    break;
                }
            }
        }
        $table->add_row(array('id' => 'rcmrow'.$idx, 'class' => join(' ', $classes),
            'foldername' => $folder['id']));