Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: mmaraghy on January 10, 2010, 03:45:14 PM

Title: folderbuttons plugin
Post by: mmaraghy on January 10, 2010, 03:45:14 PM
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.
Title: need help to add delete folder feature
Post by: mmaraghy on January 15, 2010, 11:12:12 AM
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?
Title: New Plugin Help
Post by: ABerglund on January 15, 2010, 03:06:05 PM
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.
Title: new button images
Post by: mmaraghy on January 15, 2010, 06:22:22 PM
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?
Title: New Plugin Help
Post by: ABerglund on January 15, 2010, 07:57:29 PM
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.
Title: Fixes/Enhancements
Post by: rosali on January 21, 2010, 09:08:24 AM
#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
Title: New Plugin Help
Post by: mmaraghy on January 21, 2010, 09:47:55 AM
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.
Title: New Plugin Help
Post by: rosali on January 21, 2010, 09:57:33 AM
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
Title: New Plugin Help
Post by: ABerglund on April 16, 2010, 01:27:55 PM
Sorry, I was going to report an issue with this plugin, but I was using an outdated version. The current version is fine.