How to modify XsltCMS

Abstract

  1. Modify PHP files
  2. You can also create modules, i.e. additionnal PHP files, into XsltCMS

1. What to do

XsltCMS is in PHP. This is a common web scripting language. Everything in this tool can be modified (behavious, skins of the private part, etc.).

You should know how to use PHP and how XsltCMS behave before reading this documentation (excepting 5. Translating below which is easy).

XsltCMS is GPLed (v.2). You should have received a copy of the GNU Lesser General Public
License along with this tool ; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

2. Special features

XsltCMS should work in any release of PHP from 5.0. It should not require any optionnal extesnsion (php_*.dll files for example) but php_xsl. This extension is documented as "active" by default.

PHP 4 do not fit at all as DOM is heavily used (PHP 4 DOM XML being weak).

Everything is kept as simple as possible. Object Oriented Programming is not used, excepting using existing (DOM, XSL) classes.

3. Main architecture

3.1 Introduction

The public part of XlstCMS is generated, and often do not include any PHP code (but it is possible to do so : include some PHP code in your template)

This documentation id about the private part of XsltCMS (.../create/static/*).

3.1 MVC

The main file is index.php. AS any MVC2 implementation, every call use it (then there are some inclusions...).

The $_GET informations (i.e. index.php?...) should contains an action. An action is like this : module.function.subfunction.subfunction.... . This action (and the other data received) will be processed ( useAction() ) in a .actions.php file in order to :

Then the action, and the result of useAction(), are used to select a view (module.view.subview.... ). This view (HTML code) is created in a .view.php file then sent to the navigator.

3.3 Global variables and data

You should not read (or write) any global variable from your own code, excepting superglobal variables ($_GET, $_POST...).

You can find a lot of useful functions in *.model.php files, including some function to read and write existing global variables.

3.5 Rules

Here are some major rules that you should follow :

4. Modules

There are for now 4 modules in XsltCMS.

A module has 2 files (at least), in create/static/mdoules/ directory : themodule.actions.php and themodule.view.php. This file names are mandatory, there are dynamic includes done corresponding ti actions and view requested.

In order to create a new module, you should add :

5. Translating

Translating the private part of XsltCMS is easy :

About this document

Document base url : http://xsltcms.org/ how_to_modify.html

Version : 070828

Author : Askywhale