Roundcube Community Forum

 

folderbuttons plugin

Started by mmaraghy, January 10, 2010, 03:45:14 PM

Previous topic - Next topic

mmaraghy

I got stuck trying to write this plugin, but I finally got it figured out on my own. The plugin adds expand-all and collapse-all buttons to the folder mailbox controls in mail view (see image). The button images come from the mail_footer.png image included with the default skin so this plugin really only works with that theme.

To use the plugin just upload to the plugins directory and then add 'folderbuttons' to the plugin array in main.inc.php.

English language localization file only - translations welcome.

This is my first plugin, so let me know what you think.

mmaraghy

I'm trying to add a delete folder button to the folderbuttons plugin that will delete the select folder from the tree. I am having trouble getting the java script to work. Here's what I have now which does not work.

function deletefolder (){
$("#mailboxlist li.selected").each( function() {
var el = $(this);
var matches = String($(el).attr('onclick')).match(/.*rcmail.command\(["']delete-folder["'],\s*["']([^"']*)["']\).*/i);
rcmail.delete_folder(matches[1]);
});
}


Any ideas?

ABerglund

Quote from: mmaraghy;24505I got stuck trying to write this plugin, but I finally got it figured out on my own. The plugin adds expand-all and collapse-all buttons to the folder mailbox controls in mail view (see image). The button images come from the mail_footer.png image included with the default skin so this plugin really only works with that theme.

To use the plugin just upload to the plugins directory and then add 'folderbuttons' to the plugin array in main.inc.php.

English language localization file only - translations welcome.

This is my first plugin, so let me know what you think.
Just installed this on the latest SVN (3207) and it works and looks great.
Arne Berglund
SysAdmin, Internet Services
Lane Education Service District
Eugene, OR, USA

mmaraghy

Glad you like the plugin.

I created a couple new button images to use with the plugin that follow the default theme a bit better (they have the same rounded corner box as in the default theme). Upload these icons and overwrite the existing ones to switch.

Which button images do you prefer?

ABerglund

Quote from: mmaraghy;24630Glad you like the plugin.

I created a couple new button images to use with the plugin that follow the default theme a bit better (they have the same rounded corner box as in the default theme). Upload these icons and overwrite the existing ones to switch.

Which button images do you prefer?
While the new ones are nice looking, I think the original are a bit more intuitive.
Arne Berglund
SysAdmin, Internet Services
Lane Education Service District
Eugene, OR, USA

rosali

#1- Fixed html output (closing img tags were missing -> breaks IE)
#2- Added German localization
#3- Made plugin skinable
#4- I plan to host the plugin along with MyRoundcube plugins bundle

Enjoy
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

mmaraghy

Quote#1- Fixed html output (closing img tags were missing -> breaks IE)
#2- Added German localization
#3- Made plugin skinable
#4- I plan to host the plugin along with MyRoundcube plugins bundle

Rosali - Thanks for the fixes and enhancements. I am definitely a newbie and I know my code needed polishing.

Any thoughts on how the java script could work for a delete folder button? I made an image for the button (attached) and its easy enough to add that with the php, but I don't know how to make roundcube check which folder is selected, confirm delete with a message box, and then delete it. See my previous post for where I started with this.

Thanks for including the plugin with your MyRoundcube bundle.

rosali

Not tested, just an approach:

      rcmail.set_busy(true, 'folderdeleting');
      rcmail.http_post('delete-folder', '_mboxes='+urlencode(rcmail.env.mailbox), true);
      rcmail.set_env('folder', null);
      ... Ajax stuff to renew folder list or a document.location.href / .reload
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

ABerglund

#8
Sorry, I was going to report an issue with this plugin, but I was using an outdated version. The current version is fine.
Arne Berglund
SysAdmin, Internet Services
Lane Education Service District
Eugene, OR, USA