Project "Theme Creator"
Imported From: http://groups.google.com/group/in-portal-dev/browse_thread/thread/d9ee1cfafed7dfb5#
I suggest new functionality allowing the newbie user, not knowing even HTML and CSS, quickly and easily receive unique, different from other sites front-end. Meanwhile such user can quickly and easily install only one of standard themes and receive a site very similar to hundreds of other sites, made with In-Portal by the same unprepared users.
How this could work. In the administrative console user comes into section Themes, opens a theme on Edit. If the theme supposes fast automatic change there will be one more tab "Parameters". On this tab user can change theme's parameters. In the elementary case there will be enough three parameters:
- primary color of a background
- primary color of the text
- the basic type of a font (Arial, Times etc.)
Having set these parameters user can press button "Apply" - thus it will be automatically changed style.css and other files which are necessary for changing for conformity of a theme to new parametres. How this can be developed. In case the theme supports such automated change, theme's files should contain the information on that what parameters a theme accepts also what files should change automatically. I suggest to make in such themes the "parameters" folder, where to place
- CSV a file parameters.csv with fields
- "Name" - a parameter name, for example "BackgroundColor",
- "Default" - value of a variable by default, that follows to generation of a standard theme
- "Value" - the value entered at last change of a theme
- to Each file which should be changed at theme change, there should correspond a file in the "parameters" folder.
- For example if it is necessary to change a file style.css there should be a file parameters/inc/style.css in which color constants and names of fonts are replaced by a code designating what variable it is necessary to substitute.
- If a theme contains color images which should correspond to the chosen color parametres, them it is possible automatically generate.
For example, if there will be a file parameters/inc/blue_line.gif it is possible at automatic change of a theme on the basis of this file, preset values of color parameters and default values of color parameters in a theme generate a ile inc/blue_line.gif where color of each pixel will be calculated under the formula. It probably to make with GD library (functions imagecolorset, imagecolorat).
Actual variables count can be greater than parameters entered by the user. For example, complementary colors can be calculated automatically, as proportional to components of base colors of a background and the text. For example, color of headings may be taken as 20 % shift colour component's of primary colour of the text towards primary color of a background.
Probably, it is necessary to store in the "parameters" folder also last versions of automatically changed files to warn the user changed files directly about possible loss of changes in result of automatic theme generation.