But how do I create sub-menues within a plugin? I couldn't find any template or documentation. Also no other plugins seem to use sub-menues (Well, the sieve filter plugin does for filter-sets etc. but that is done in a way I don't understand).
Is there a plug-in that does sub-menues in an easy way I could use as a template? Could someone help me with a simple template?
It's not entirely clear what you mean with submenus. But since the mention the managesieve plugin, I suppose you mean a box with multiple settings, like the Preferences->Section box. If you read back a week or so ago in the archives of this list, you'll see a discussion started by me about that exact same subject.
This is actually very difficult. To add your settings you basically have 3 options:
the easiest way is to add settings to existing sections under preferences. For instance, you can create a new setting under Prefences->User Interface. Many plugins do this.
you can also add a new section under one of the existing preferences options. For instance, my Message Highlights plugin creates a section under Preferences. There are a few other plugins that do this.
you can create a whole new tab (this is done through javascript), which creates a row in the leftmost preferences box in the larry theme.
I assume you want to do 3). Unfortunately, if you do this, you're completely on your own. You can create a row through JS, but any new boxes, and any content if you click those boxes, have to be created by you through templates, handlers, etc. It is pretty complex especially if you want to create submenus. Im going through this right now myself for some internal plugins. (converting from classic to larry).
I actually created a plugin that does some of 3). My plugin creates a new tab in the leftmost box. Thats all it does. But then you can create other plugins that hook into that plugin so they're shown in a second box on your new tab. It's currently pretty limited, and pretty much mimics the top preferences tab in functionality simply because I could not figure out how to do more complex UI interactions to make it more generic. it is a pretty ugly hack, but afaik it's not possible to make this any easier because roundcube does not really provide the settings infrastructure to accomplish this.
If you want to see what I mean, look at this screenshot: http://grab.by/qxPm
Id love to know from the roundcube devs if there is some easy way to accomplish this. Right now my plugin can only create easy, basic Preferences/User Interface type settings. It cant handle creating more complex UIs with their own save handlers etc.
Cor