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
Modules have the following resources:
xoops_version.php | The manifesto file is in the root of your module directory. Legacy parses this file and recognizes resources which are declared in the file. |
Program files | The page controllers. Normally, these files are in the root of your module directory. |
Program files for admin | The page controllers for the controll panel. These files have to be in the admin directory of your module directory. |
Blocks | Blocks 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. |
Templates | This is a file which is described for looks. Also, you must declare them in xoops_version. |
Languages | There are some directories for each language under the special rule. These directory has the same files which define constants for words. |
Preload | This 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";
Page Info | |
---|---|
Page Name : | XOOPSCubeLegacy/Reference/ModuleOverview |
Page aliases : | None |
Page owner : | Anonymous |
Can Read | |
Groups : | All visitors |
Users : | All visitors |
Can Edit | |
Groups : | Support Site Webmasters |
Users : | No one |