Opened 3 years ago
Closed 3 years ago
#1486668 closed Bugs (fixed)
plugin hooks for folder settings page
| Reported by: | nejec | Owned by: | |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.4-stable |
| Component: | Plugin API | Version: | 0.4-beta |
| Severity: | normal | Keywords: | |
| Cc: |
Description
I am trying to implement a plugin to alter the folder list on folders settings page.
The problem lies in plugin hooks for altering folder list. I have tried following plugin hooks:
- list_mailboxes is not used on folder settings page
- render_mailboxlist is not used on folders settings page either
- manage_folders is used on folders settings page, but it have only add and remove_column functions in html_table object and makes it quite unusable since it does not allow even listing the html_table object rows or removing rows
There are several solutions:
- use list_mailboxes hook in folders settings page since it is declared as global hook, but not used on folder settings page
- alter html_table object to allow altering the html_table by showing/removing rows in the table, so manage_folder plugin hook can remove rows
Attachments (1)
Change History (6)
Changed 3 years ago by nejec
comment:1 Changed 3 years ago by nejec
comment:2 Changed 3 years ago by alec
- Resolution set to fixed
- Status changed from new to closed
Added list_mailboxes hook in list_unsubscribed() in [6f4e7dbc].
comment:3 Changed 3 years ago by nejec
- Resolution fixed deleted
- Status changed from closed to reopened
This does not resolve the issue, since if you use list_mailbox hook, it gets the same results for subscribed and unsubscribed folders and it happens that all folders are now subscribed, which is wrong.
You can reproduce the bug by setting dummy list_mailbox hook which does:
function list_mailboxes($args)
{
$rcmail = rcmail::get_instance();
$args['folders'] = $rcmail->imap->conn->listMailboxes($rcmail->imap->mod_mailbox($args['root']), $args['filter']);
return $args;
}
So there is no way you could find out which folders are subscribed and which are not.
comment:4 Changed 3 years ago by nejec
comment:5 Changed 3 years ago by alec
- Resolution set to fixed
- Status changed from reopened to closed
Added info in doc.

I have digged a bit about list_mailbox plugin hook and found out that folders settings page successfully calls list_mailbox, the problem is in list_unsubscribed function which does not take list_mailboxlist into account.
In that case I would rather change html_table class by adding two dummy get_rows/set_rows functions which would allow the plugin to change the table rows. I am attaching a dummy fix for html.php which allow this...