Themes

themeCreating a Weezo theme

Weezo look'n feel can be completely modified by adding new themes.

You'll need CSS, HTML and some PHP knowledges.

 A Weezo theme is a set of files in a directory. It must contain :

  • a CSS style sheet, named "theme.css",
  • an optional script defining the menu and named "menu.php",
  • an optional script defining the connection form, named "loginForm.php",
  • an optional script for the desktop backgroung, named "background.php",
  • and of course all needed images.


The directory name must be the name of your theme. It must be located in /www/themes

Weezo considers a theme valid if it can find a file named "theme.css" at the root of your theme directory i.e. in /www/themes/your_theme_name .

If you want to distribute your theme, just zip all the files of your theme and rename the zip file as my_theme_name.weezoTheme.

 

Style sheet

We are very sorry but we haven't taken the time to write a documentation yet. The best guess is to start from one of the existing style sheet provided with Weezo and derive your own.

They are (slightly) commented ...

 

menu.php

This script is optional.

With it you can define the control menu. It is usually located on the left of the screen but you can choose to put it wherever suit you, up, bottom or right (cf. "Nature" theme).

The menu is located in the "menuFrame". The script is "required_once" by the menuFrame.php script. It contains two parts :

  • The displayMenu() function manage the menu display in itself. This script must start by closing the </head> tag after having inserted the necessary style or javascript.
    Then it must open the <body> tag, display the various items and end without closing the </body> tag (a form is automatically included at the bottom of the page).
    The script must use the session arrays $_SESSION['res'][resource_nb] which contain each resource session parameters.
    These arrays contain among other things :
    • version : version of file
    • resourceName : name of resource (filename without extension)
    • name : "label" of resource
    • type : type of resource
    • subType : sub type of resource
    • baseFile : main script file name (without path)
    • resourceScriptPath : path (from document root) to resource script(s)
    • resourceDataDir : path to resource data directory
    • resourceIcon : path (from document root) to resource's icon
    • resourceJsLink : javascript link to main resource script
    • resourceTypeLabel : label of resource as specified in resource's desciber file or, if not found, resource's type label
    • resourcePreviewImage (optional) : path (from document root) to resource's preview image
    • resourceDescription (optional) : path (from document root) to resource's description (read from describer.ini file)
    • resourceStartsSession : true if resource doesn't need a session_start from security.php script
    • resourceConfigFile : (optional) resource configuration script name

  • The following variables (outside of the displayMenu function) define how frames are positioned and how windows are used :
    • $menuFramePosition : its value can be 'left', 'top', 'right', 'bottom'. It defines the position of the menu.
    • $menuFrameSize : it defines the width (or the height, be it positioned at the top of the window) of the menu.
    • $scrolling : its value can be the standard HTML values for a frame. It defines the scrollbar display options of the menu frame.
    • $useWin : its value must be "true" to use HTML windows (see resource "OS" for instance) or "false" to not use HTML windows (see resource "Marine" for instance).
    • $winEmptyHTML : (useful only if HTML windows are used) it defines the HTML content of the window iFrame before an SRC is affected to it.
    • stretchedBackground : (useful only if HTML windows are used, optional) its value is the URL of an image that will be displayed (stretched) on the HTML desktop background.

As it is the case for creating an extension, it is recomended you start your theme development from an existing script...

 

loginForm.php 

This script is optional.

It allows you to redefine the login page.

Conversely to menu.php, loginForm.php script manage the whole page display from
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> to </HTML>

Script content is free but must comply with following conditions : connection data must be sent to "/index.php" in a POST. The following data must be included in a form with the property name="loginForm" :

  • 'userId' : account id. ids are numbers between 0 and n-1 (n being the total number of accounts)
  • 'password' : password (yes, believe it or not)
  • 'userSelectedTheme' (optional) : it is recomended touse the instruction : " if(cfGeneralData('allowUserThemeChange')) echo outThemeSelectionControl('general',false); ".
    It displays a control that fills the selected theme in the variable 'userSelectedTheme' from the form 'loginForm'.

To submit this form you must use the javascript function "startEncryption()".It encrypts the password contained in the field "document.loginForm.password.value" before submitting the form.
This function is included by the PHP function includeRSAScripts().

The processing of authentication data is done by the script "login.php".

The script "loginForm.php" can (or even must...) make use of the account array $_SESSION['user'][0..n-1].

For each account, the following data are available :

  • 'authenticationMethod' : its value can be 'password' or 'noAuthentication'. It defines the account authentification type,
  • 'name' : the name of the account,
  • 'icon' : the name of the icon associated with the account. The icon path is '/gfx/icons/'.$_SESSION['user'][$i]['icon']
  • 'hint' (optional) : password recovery hint.

 

Moreover, two variables are defined in the script including loginForm.php :

  • $wrongPasswordSent : this value is "true" if the user typed a wrong password.
  • $userToLoad : selectioned account id (it can be either an account id previously sent through a GET or the account id for which a wrong password was typed).

 

It is also recomended to start from an existing script...


Background.php

This script is optional (it is useful only if HTML windows are used). It defines the HTML desktop background.

If placed at the root of the theme directory, it is included between the tags <body> and </body> by the script "mainFrame.php" (which also includes the HTML window manager scripts).

 

 
© 2008 Weezo
Joomla! est un logiciel libre distribué sous licence GNU/GPL.
Powered By PageCache
Generated in 0.30259 Seconds