PHPBuilder - PHP enabled stylesheets Page 3



RSS Twitter
Articles Html

PHP enabled stylesheets - Page 3

by: Bertrand Potier
|
November 24, 2002

The Visual Configuration File

This file is meant for the end user. Although being still a text/php file, its layout as well as the way variables are named is taking that into account: being as user-friendly as possible is the key. For that reason, I made the choice to not use variables but multi-dimensional associative arrays that are giving the opportunity to name the different element in a very comprehensive way.
This array is named $VISUALS in capital letters to follow a naming convention I'm using for all "global" arrays. The array is first indexed on an integer value to allow multiple configuration sets to be defined. This is the way the eDreamers tools are made "skin-able", you can jump from one set to another by just changing the id which can be provided by an URL (HTTP Get request) for example.
The parameters that you want to make available via this visual configuration file are up to you. It fully depends on your stylesheet and what is the freedom that you want to give or not give to your end user. In the scope of this article, we will consider the following very simple example:

<?php
 
// Retrieving POST and GET variables
 
if (substr(phpversion(),0,3) != '4.1') { 
  
$_REQUEST array_merge($HTTP_POST_VARS$HTTP_GET_VARS); 
 }
 
// Define which skin you'd like to use.
 
if (isset($_REQUEST['SkinID'])) { 
  
$SkinID $_REQUEST['SkinID']; 
 } else if (!isset(
$SkinID) ) { 
  
$SkinID  '0'
 }
 
 
// Default Skin
 
$VISUALS[0]['page']['font'] = 'Verdana, Tahoma';
 
$VISUALS[0]['page']['fontsize'] = '10';
 
$VISUALS[0]['page']['fontunit'] = 'px';
 
$VISUALS[0]['page']['background']['color'] = '#838383';
?>

« Previous Page
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
Next Page »

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Bertrand Potier

Comment:



Comment:

(Maximum characters: 1200). You have characters left.