I need to add some vars for the templates to the db. Could or should I use sys_config table or sys_ini table or should I add a new table?
If the variables are available for all themes or general interface settings, then please use sys_ini table. The variables are defined in the system.ini file in the install/conf/ folder and in the form and template file of the interface config form. No database fields have to be added.
The structure of the sys_config table is a little more complex and I think it will leave a lot more leeway for future extension. What have you planned to put in there? EDIT/ADD: Or a new table? Like 'sys_tpl' ?
I had planned to use the sys_config table as general key value store and to implement user defined overrides for default values with it (http://bugtracker.ispconfig.org/index.php?do=details&task_id=582&project=3). The sys_ini system that we use for server and interface values at the moment is easy and works fine, but in case that we reach the limits of the ini style storage in future (e.g. requirements for multiline values), it might be migrated to sys_config values as well. Thats an option too. But then we might have to write some kind of script in the installer / updater that automatically detects the existing themes and adds them to this table, so that we replace the current "scan dir" like functionality for themes with a table that holds the details of the themes and some default values.. Which values do you plan to store for the theme?
I was planning to make "branding" totally global but I had to realize that if themes should be as flexible as possible branding needs to vary on a theme basis. for example the logo might need different dimensions. one more thing to consider is the future possibility to set branding on a per user/per reseller basis. (maybe for 3.0.6)
I have added tables in the format of tpl_*theme-title* for the standard themes: tpl_default + tpl_default-v2 Tables and config pages will not be required for a theme but will be possible by 3.0.5 to make parameters changeable within the frontend
I dont think that its a good idea to have a table for each theme, this will clutter the database and each table will have just one record anyway. We should change this to one table "sys_user_theme" or "sys_theme" to match the naming scheme and the table has a field for the theme name.
how many themes do you want to install? I think I will be happy with 1. But I think we can manage with 1 table for most themes
I dont install any themes at all and use the default one, but I'am most likely not the common user I guess most users try out several themes and this will clutter the database and having the theme name in a database table is not a good choice in my opinion.