3.4. Layouts

3.4.1. Separation

In this version of ByteHoard I'm introducing complete separation of the layout and actual processing. The modules simply call the layout class, pass it a few parameters (type of page, title, content) and then call its display() function. What the layout does is completely separate; the default one obviously displays the stuff in the relevant places, as well as showing any error messages that have appeared in the $bh_errors global variable, but it could simply show the files for a directory listing, just output plain text, or do things like change the backgrounds baedon the action or even the file types.

3.4.2. Skins

Of course, this introduced the problem of what skin designers were to do; with just this in place, making a new skin would invlove an understanding of PHP. So, in this vein, there is also a skinning system. This allows the images for the layout to be swapped around - the layout of the... layout doesn't change, but the images do. This means that anyone with a graphics editor can create a skin, somewhat akin to the old winamp 2.x skins, although with lots of pictures rather than one.

3.4.3. Further Examples & Explanation

The default layout is a good example of all the above mentioned ideas - the skins, where you can change the borders of the toolbar and the boxes, the separation, and everything else. Have a look at the code if you're interested; it uses includes to keep the code smaller and more manageable, so the major page sections are in separate files (and easy to edit and understand for someone with HTM knowledge).