Robin Elfrink wrote:
Hi,
Hi Robin
I fully implemented collapsing folders. Collapsed/expanded state of a folder is saved in the user's preferences. Please test.
I've tested it but there's something wrong with the indentation of the folders (see attachment). It happens on Firefox and Safari. Looks like the float:left of the <div> causes this wrong behavior. But because the links have display:block it's quite tricky to fix it.
I'd like specific feedback on the following:
- the structure of the 'string' I use to save the state of
collapsed/expanded folders
I guess this works fine. & should be encoded with escape() and therefore work perfectly as a delimiter.
- the place where I save the preferences (now in steps/mail/func.php).
Actually request processing is done in index.php and not in func.inc. And you should send a valid response with $OUTPUT->send() after saving the prefs even if it's empty.
Also I'd like to point at some implementation details:
User prefs are all merged with the config. It's not necessary to create a getter for user prefs. You can simply use $RCMAIL->config->get('collapsed_folders') or $CONFIG['collapsed_folders'] but the latter one is actually deprecated.
The function save_pref($name, $value) is not really necessary too. You can achieve the same by calling $USER->save_prefs(array($name => $value));
When saving the prefs, you should use get_input_value('_name', RCUBE_INPUT_POST) and get_input_value('_value', RCUBE_INPUT_POST) instead of $_POST['_name'], $_POST['_value'].
And there's one final question: how about unread counts of collapsed folders? To make it perfect, the collapsed parent folder should show the cumulated number of unread messages within it's child folders.
After all, it looks like a simple, straight-forward implementation for this feature and that's exactly what I like to see. Go ahead!
~Thomas
--- 8< --- detachments --- 8< --- The following attachments have been detached and are available for viewing. http://detached.gigo.com/rc/Uk/EpqzG2eX/folders-indent.png Only click these links if you trust the sender, as well as this message. --- 8< --- detachments --- 8< ---
List info: http://lists.roundcube.net/dev/