| | |
| | | |
| | | if ($result) { |
| | | // Handle subscription of protected folder (#1487656) |
| | | if ($CONFIG['protect_default_folders'] == true |
| | | && in_array($mbox, $CONFIG['default_folders']) |
| | | if ($RCMAIL->config->get('protect_default_folders') |
| | | && in_array($mbox, (array)$RCMAIL->config->get('default_folders')) |
| | | ) { |
| | | $OUTPUT->command('disable_subscription', $mbox); |
| | | } |
| | |
| | | // build table with all folders listed by server |
| | | function rcube_subscription_form($attrib) |
| | | { |
| | | global $RCMAIL, $CONFIG, $OUTPUT; |
| | | global $RCMAIL, $OUTPUT; |
| | | |
| | | list($form_start, $form_end) = get_form_tags($attrib, 'folders'); |
| | | unset($attrib['form']); |
| | |
| | | $a_js_folders = array(); |
| | | $seen = array(); |
| | | $list_folders = array(); |
| | | |
| | | $default_folders = (array) $RCMAIL->config->get('default_folders'); |
| | | $protect_default = $RCMAIL->config->get('protect_default_folders'); |
| | | |
| | | // pre-process folders list |
| | | foreach ($a_unsubscribed as $i => $folder) { |
| | |
| | | $idx = $i + 1; |
| | | $sub_key = array_search($folder['id'], $a_subscribed); |
| | | $subscribed = $sub_key !== false; |
| | | $protected = ($CONFIG['protect_default_folders'] == true && in_array($folder['id'], $CONFIG['default_folders'])); |
| | | $protected = $protect_default && in_array($folder['id'], $default_folders); |
| | | $noselect = false; |
| | | $classes = array($i%2 ? 'even' : 'odd'); |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | // check if the folder is shared, then disable subscription option on it |
| | | if (!$disabled && $folder['virtual'] && !empty($namespace)) { |
| | | // check if the folder is shared, then disable subscription option on it (if not subscribed already) |
| | | if (!$disabled && !$subscribed && $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) { |
| | |
| | | |
| | | $OUTPUT->add_gui_object('subscriptionlist', $attrib['id']); |
| | | $OUTPUT->set_env('subscriptionrows', $a_js_folders); |
| | | $OUTPUT->set_env('defaultfolders', $CONFIG['default_folders']); |
| | | $OUTPUT->set_env('defaultfolders', $default_folders); |
| | | $OUTPUT->set_env('delimiter', $delimiter); |
| | | |
| | | return $form_start . $table->show($attrib) . $form_end; |
| | |
| | | |
| | | $OUTPUT->set_pagetitle(rcube_label('folders')); |
| | | $OUTPUT->include_script('list.js'); |
| | | $OUTPUT->set_env('quota', $STORAGE->get_capability('QUOTA')); |
| | | $OUTPUT->set_env('prefix_ns', $STORAGE->get_namespace('prefix')); |
| | | if ($STORAGE->get_capability('QUOTA')) { |
| | | $OUTPUT->set_env('quota', true); |
| | | } |
| | | |
| | | // add some labels to client |
| | | $OUTPUT->add_label('deletefolderconfirm', 'purgefolderconfirm', 'folderdeleting', |