Author Topic: Hide folders in folders edit form  (Read 4848 times)

Offline ardena

  • Newbie
  • *
  • Posts: 5
Hide folders in folders edit form
« on: May 17, 2013, 12:08:37 PM »
I use the hMailServer, which allows you to create public IMAP folders that have '# Public' as the parent folder. I plan to hide these folders in the settings form.

I've already hidden them in the folders list, by editing the file 'RoundCube \ program \ steps \ settings \ folders.inc', but I can't hide them in the dropdown menu of the parent folder in the edit form.

The drop down menu is generated in the file 'RoundCube \ program \ steps \ settings \ edit_folder.inc', using the function 'rcmail_mailbox_select', but I don't know how to modify this list.

Thanks

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Re: Hide folders in folders edit form
« Reply #1 on: May 17, 2013, 12:16:00 PM »
Check out the following section in the main.inc.php:
Code: [Select]
// If IMAP server doesn't support NAMESPACE extension, but you're
// using shared folders or personal root folder is non-empty, you'll need to
// set these options. All can be strings or arrays of strings.
// Folders need to be ended with directory separator, e.g. "INBOX."
// (special directory "~" is an exception to this rule)
// These can be used also to overwrite server's namespaces
$rcmail_config['imap_ns_personal'] = null;
$rcmail_config['imap_ns_other']    = null;
$rcmail_config['imap_ns_shared']   = null;

Offline ardena

  • Newbie
  • *
  • Posts: 5
Re: Hide folders in folders edit form
« Reply #2 on: May 20, 2013, 09:10:54 AM »
Check out the following section in the main.inc.php:
Code: [Select]
// If IMAP server doesn't support NAMESPACE extension, but you're
// using shared folders or personal root folder is non-empty, you'll need to
// set these options. All can be strings or arrays of strings.
// Folders need to be ended with directory separator, e.g. "INBOX."
// (special directory "~" is an exception to this rule)
// These can be used also to overwrite server's namespaces
$rcmail_config['imap_ns_personal'] = null;
$rcmail_config['imap_ns_other']    = null;
$rcmail_config['imap_ns_shared']   = null;

I've tried to change the imap_ns_shared value, but nothing happened.

I've tried (the delimiter is '.'):

'#Public'
'#Public.'
array('#Public','#Public.Folder1')

No one works.

Offline ardena

  • Newbie
  • *
  • Posts: 5
Re: Hide folders in folders edit form
« Reply #3 on: May 20, 2013, 11:08:56 AM »
I've found the solution.

In edit_folder.inc file, row 124, I've insered before:

Code: [Select]
        $select = rcmail_mailbox_select(array(
            'name'        => '_parent',
            'noselection' => '---',
            'realnames'   => false,
            'maxlength'   => 150,
            'unsubscribed' => true,
            'skip_noinferiors' => true,
            'exceptions'  => $exceptions,
        ));

The following instruction:

Code: [Select]
array_push($exceptions,'#Public');
All the public folders are not inserted in combobox menu in parent folder selection, now.

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
Re: Hide folders in folders edit form
« Reply #4 on: December 09, 2013, 05:33:17 AM »
I have created a plugin to protect hMailserver's #Public folder (hmail_publicfolder):

http://myroundcube.com/myroundcube-plugins

NOTE: As most MyRoundcube plugins this plugin is commercial.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)