XOOPS Cube Legacy modules run alike independent web applications. The traditional Xoops2 design is based on a Page Controller model. A Module work with XOOPS Cube including specific files of Legacy.

This document explains the basis of a Legacy module. If you are an expert with a perfect understanding of PHP and MysSQL, you may develop powerful modules over the convention.

Some notes:

  • You can use any development environments or framework to develop a module.
  • The documentation about legacy code on this site is not exhaustive. We suggest to visit xoops.org archives. While that, you should be aware that XOOPS Cube Legacy and XOOPS2 have some big differences.

Structure anchor.png

Modules have the following resources:

xoops_version.phpThe manifesto file is in the root of your module directory. Legacy parses this file and recognizes resources which are declared in the file.
Program filesThe page controllers. Normally, these files are in the root of your module directory.
Program files for adminThe page controllers for the controll panel. These files have to be in the admin directory of your module directory.
BlocksBlocks are parts that site owners can put to other modules. That's a kind of program and the callback model. So you must declare them in xoops_version if you want to use it.
TemplatesThis is a file which is described for looks. Also, you must declare them in xoops_version.
LanguagesThere are some directories for each language under the special rule. These directory has the same files which define constants for words.
PreloadThis is the directory which contains Module Preload files.

In Legacy, Module connects with Legacy_Controller to do something, but that's not Module-Controll relation. You must understand there are two meanings of Legacy, when this article says 'Legacy'. One of them is the core system recognizing blocks and templates of your module. Another one is the check gate for your program file which is the page controller model.

To make Legacy recognize blocks and run them, you have to go through the procedure under Legacy's rules. But, after your module has been installed, Legacy doesn't touch detail to your program file which is the page controller.

Basically, program files of module are the following.

require_once "../../mainfile.php";
require_once XOOPS_ROOT_PATH "/header.php";

// Your code

require_once XOOPS_ROOT_PATH "/footer.php";

Front page   Freeze Diff Backup Copy Rename ReloadPrint View   New Page Page list Search Recent changes   Help   RSS of recent changes (RSS 1.0) RSS of recent changes (RSS 2.0) RSS of recent changes (RSS Atom) Powered by xpWiki
Counter: 16985, today: 1, yesterday: 0
Princeps date: 2007-01-17 (Wed) 02:40:35
Last-modified: 2007-08-15 (Wed) 09:15:44 (JST) (4955d) by Anonymous

Welcome | News | Overview | Documentation | Forum | Tutorialstop
Brasilian | French | German | Greek | Japanese | Korean | Russian | T-Chinese
Powered by XOOPS Cube 2001-2011 The XOOPS Cube Project