Style and themes

When creating custom page you may use some special functions defined by style used. This file also looks for the overriding function that can be defined in user theme, if not found using defaults.

Most of the style functions are just content generators which returns the output code HTML and each of it use definitions from $Style. These functions begin with style_ and may be overrided by appropriate custom_ function.

Many of $Style elements are set to their default values by the main lib/style.php, and overriden by the selected style's include.php.

Variables used by content generators were changed and merged into one $Style array. That affects $BOXBEGIN merged into $Style['Box']['Begin'], $BOXCAPTIONBEGIN into $Style['Box']['Caption']['Begin'] and so on...

Style definition

Styles are stored under style directory, one folder per each. The main file which is read by the core is style.php.



For the detailed description look at the API section here...

Functions may be defined in every custom style.php file or an example CMS module. After including lib/common.php or lib/header.php default style definition in lib/style.php is also included.

Creating box

When you are writing a module you may add a new box to the whole site by creating file named box.php in your module's tree.

You may look that every custom style simply uses these functions changing the style between different site sections. Notice also that every page that includes header at the beginning and footer before end is already the default $content for the main box. That way you may think about your site as a group of boxes (even site links or menu are being drawn that way).

Another thing is creating a box with dynamic content. While creating the output style functions tries to evaluate your strings passed as parameters (content, caption, status) using str_eval() function. It works like if you set the box caption to $MyText str_eval will search the $Lang and $Vars arrays to find the real content. If it is not defined it will return just MyText. Another useful way to create dynamic content is to pass function name followed by at sign (@) as a content like that:

function my_content
	return "This is dynamic content!";