If you store the Themebuilder variables in a config file in the theme output directory, it will be possible to edit multiple themes with different settings. Themes that are copied from one host to another can still be edited by Themebuilder.
This could be done by storing all variables in a array and serializing the array into the config file. You would have to deal with the problem of users opening themes created with earlier versions of Themebuilder. The config files for such themes would be missing newer variables. The can be overcome be initializing the variable array to all default values before importing a theme config file.
Thinking further down the road, a variable array could enable developers to create plugins and have their variables saved in the config file too.
Examples (to avoid name conflicts)
$themebuilder_vars['themebuilder_variable_name']
$themebuilder_vars['myplugin_variable_name']
Comments
Comment #1
CZ commentedThis is very interesting! The variables are then not stored in a MySQL table.
Can you post a simple code example for the data.inc file?
Comment #2
DrewMathers commentedChristian,
These examples turn the variables array into a serialized text file. You cannot edit this file or you will break it. If you want store the variables in an editiable ini file instead, read the contributed comments here:
http://php.net/parse_ini_file
Warning: I have not tested this code.
Updated data.inc
Comment #3
DrewMathers commentedHere is some code to save settings in an editable ini file instead of a non-editable serialized array file.
Comment #4
CZ commentedThank you!
The code is in the module, but not yet released. Coming soon.
Chris
Comment #5
CZ commentedDone!
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.