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8*0bC'lvY{;=C~ЇGV8|p"{$Wo h#XQ}Ү a6Ǟ"KesC.ֿܿzKWuF"NH [~v3&y> Jik -̏tUL&8hqexYc2M4`D:KT`cLpxk'uAzf{2pPAҡGΤDl맯oG齧'w OOd$o3/'zQ(MAOa]g'aݸi&͢w?? DwuɃ~Y!_V濫1I=<~ybON{8.;iw?݀e1lݩgVh@S/ 2P'xYO1T I/6"T#Fce˔G#4uWqb\"ӗo].NA`'=. ~;Ϩ3>ޯ%i4-A7kW~4ՙ/!vu4hDWS _ Uym%:bJ!w|Od-IU=FmN|T.=J9,?~j1!пʧ% Eoq n(Oield(['name' => '_name', 'id' => '_name', 'size' => 30, 'class' => 'form-control']); $foldername = '' . $foldername->show($folder); if (!empty($options['special']) && ($sname = self::localize_foldername($mbox, false, true)) != $folder) { $foldername .= ' (' . rcube::Q($sname) .')'; } $foldername .= ''; } $form['props']['fieldsets']['location'] = [ 'name' => $rcmail->gettext('location'), 'content' => [ 'name' => [ 'label' => $rcmail->gettext('foldername'), 'value' => $foldername, ], ], ]; if (!empty($options) && (!empty($options['norename']) || !empty($options['protected']))) { // prevent user from moving folder $hidden_path = new html_hiddenfield(['name' => '_parent', 'value' => $path]); $form['props']['fieldsets']['location']['content']['name']['value'] .= $hidden_path->show(); } else { $selected = $_POST['_parent'] ?? $path_id; $exceptions = [$mbox]; // Exclude 'prefix' namespace from parent folders list (#1488349) // If INBOX. namespace exists, folders created as INBOX subfolders // will be listed at the same level - selecting INBOX as a parent does nothing if ($prefix = $storage->get_namespace('prefix')) { $exceptions[] = substr($prefix, 0, -1); } $select = self::folder_selector([ 'id' => '_parent', 'name' => '_parent', 'noselection' => '---', 'maxlength' => 150, 'unsubscribed' => true, 'skip_noinferiors' => true, 'exceptions' => $exceptions, 'additional' => is_string($selected) && strlen($selected) ? [$selected] : null, ]); $form['props']['fieldsets']['location']['content']['parent'] = [ 'label' => $rcmail->gettext('parentfolder'), 'value' => $select->show($selected), ]; } // Settings $form['props']['fieldsets']['settings'] = [ 'name' => $rcmail->gettext('settings'), ]; // For servers that do not support both sub-folders and messages in a folder if (!$dual_use_supported) { if (!strlen($mbox)) { $select = new html_select(['name' => '_type', 'id' => '_type']); $select->add($rcmail->gettext('dualusemail'), 'mail'); $select->add($rcmail->gettext('dualusefolder'), 'folder'); $value = rcube_utils::get_input_string('_type', rcube_utils::INPUT_POST); $value = $select->show($value ?: 'mail'); } else { $value = $options['noselect'] ? 'folder' : 'mail'; $value = $rcmail->gettext('dualuse' . $value); } $form['props']['fieldsets']['settings']['content']['type'] = [ 'label' => $rcmail->gettext('dualuselabel'), 'value' => $value, ]; } // Settings: threading if ($threading_supported && ($mbox == 'INBOX' || (empty($options['noselect']) && empty($options['is_root'])))) { $value = 0; $select = new html_select(['name' => '_viewmode', 'id' => '_viewmode']); $select->add($rcmail->gettext('list'), 0); $select->add($rcmail->gettext('threads'), 1); if (isset($_POST['_viewmode'])) { $value = (int) $_POST['_viewmode']; } else if (strlen($mbox)) { $a_threaded = $rcmail->config->get('message_threading', []); $default_mode = $rcmail->config->get('default_list_mode', 'list'); $value = (int) ($a_threaded[$mbox] ?? $default_mode == 'threads'); } $form['props']['fieldsets']['settings']['content']['viewmode'] = [ 'label' => $rcmail->gettext('listmode'), 'value' => $select->show($value), ]; } $msgcount = 0; // Information (count, size) - Edit mode if (strlen($mbox)) { // Number of messages $form['props']['fieldsets']['info'] = [ 'name' => $rcmail->gettext('info'), 'content' => [] ]; if ((!$options['noselect'] && !$options['is_root']) || $mbox == 'INBOX') { $msgcount = (int) $storage->count($mbox, 'ALL', true, false); if ($msgcount) { // Get the size on servers with supposed-to-be-fast method for that if ($storage->get_capability('STATUS=SIZE')) { $size = $storage->folder_size($mbox); if ($size !== false) { $size = self::show_bytes($size); } } // create link with folder-size command if (!isset($size) || $size === false) { $onclick = sprintf("return %s.command('folder-size', '%s', this)", rcmail_output::JS_OBJECT_NAME, rcube::JQ($mbox)); $attr = ['href' => '#', 'onclick' => $onclick, 'id' => 'folder-size']; $size = html::a($attr, $rcmail->gettext('getfoldersize')); } } else { // no messages -> zero size $size = 0; } $form['props']['fieldsets']['info']['content']['count'] = [ 'label' => $rcmail->gettext('messagecount'), 'value' => $msgcount ]; $form['props']['fieldsets']['info']['content']['size'] = [ 'label' => $rcmail->gettext('size'), 'value' => $size, ]; } // show folder type only if we have non-private namespaces if (!empty($namespace['shared']) || !empty($namespace['others'])) { $form['props']['fieldsets']['info']['content']['foldertype'] = [ 'label' => $rcmail->gettext('foldertype'), 'value' => $rcmail->gettext($options['namespace'] . 'folder') ]; } } // Allow plugins to modify folder form content $plugin = $rcmail->plugins->exec_hook('folder_form', [ 'form' => $form, 'options' => $options, 'name' => $mbox, 'parent_name' => $parent ]); $form = $plugin['form']; // Set form tags and hidden fields list($form_start, $form_end) = self::get_form_tags($attrib, 'save-folder', null, $hidden_fields); unset($attrib['form'], $attrib['id']); // return the complete edit form as table $out = "$form_start\n"; // Create form output foreach ($form as $idx => $tab) { if (!empty($tab['fieldsets']) && is_array($tab['fieldsets'])) { $content = ''; foreach ($tab['fieldsets'] as $fieldset) { $subcontent = self::get_form_part($fieldset, $attrib); if ($subcontent) { $subcontent = html::tag('legend', null, rcube::Q($fieldset['name'])) . $subcontent; $content .= html::tag('fieldset', null, $subcontent) ."\n"; } } } else { $content = self::get_form_part($tab, $attrib); } if ($idx != 'props') { $out .= html::tag('fieldset', null, html::tag('legend', null, rcube::Q($tab['name'])) . $content) ."\n"; } else { $out .= $content ."\n"; } } $out .= "\n$form_end"; $rcmail->output->set_env('messagecount', $msgcount); $rcmail->output->set_env('folder', $mbox); if ($mbox !== null && empty($_POST)) { $rcmail->output->command('parent.set_quota', self::quota_content(null, $mbox)); } return $out; } public static function get_form_part($form, $attrib = []) { $rcmail = rcmail::get_instance(); $content = ''; if (!empty($form['content']) && is_array($form['content'])) { $table = new html_table(['cols' => 2]); foreach ($form['content'] as $col => $colprop) { $colprop['id'] = '_' . $col; $label = !empty($colprop['label']) ? $colprop['label'] : $rcmail->gettext($col); $table->add('title', html::label($colprop['id'], rcube::Q($label))); $table->add(null, $colprop['value']); } $content = $table->show($attrib); } else if (isset($form['content'])) { $content = $form['content']; } return $content; } }