3. File Structures

To continue learning about modules, please download demo module. The following information will be based on demo module.

File/Folder Structure

Creating a module for qE is quite easy, but you need to pay attention on the folder & file structure.

Require Folders

Generally, module's folder structure is as follow:

  • /admin/module/[mod_name]
  • /module/[mod_name]
  • /skins/_admin/module_[mod_name_*].tpl (you may not need this)
  • /skins/default/module_[mod_name_*].tpl

Required Files

Each folder may have specific required files:

  • /admin/module/[mod_name]/
    • index.html, used to block directory listing.
    • info.html, contains module information, such as installation method, how to use, etc. Pure HTML.
    • ini.xml, contains module information to be read by qE, including installation SQL, uninstallation SQL, etc.
  • /module/[mod_name]l/
    • index.html, used to block directory listing.
    • window.php, windowed mode file
    • main.php, full page mode file
  • Other folders don't need specific files.

Example: Portal Module

For example, for Portal module (aka Article management, weird name, yes i know), it has these files:

  • /admin/module/portal/
    • index.html, used to block directory listing.
    • info.html, contains module information, such as installation method, how to use, etc. Pure HTML.
    • ini.xml, contains module information to be read by qE, including installation SQL, uninstallation SQL, etc.
    • pcat_admin.php, pcat_del.php, pcat_del_process.php, pcat_edit.php, ppage.php, module dependent files.*
  • /module/portal/
    • index.html, used to block directory listing.
    • window.php, windowed mode file
    • main.php, full page mode file
    • cat.php, read.php, module dependent files.*
  • /skins/_admin/
    • module_pcat_browse.tpl, module_pcat_del.tpl, module dependent files.*
  • /skins/default/
    • module_portal_cat.tpl, module_portal_read.tpl, module_portal_window.tpl, module dependent files.*

Other than module dependent files, all other files are mandatory, except main.php if your module doesn't have full screen mode (but you still need to provide window.php, even if your module doesn't have windowed mode).

Explanation of Each Required File

The following information will use demo module to simplify the explanations. Please download it first.

/admin/module/demo/info.html

The file is basically a user guide, you can use your own style, or copy demo module's. qE will display this file when a user click on Documentation in module management.

The file is in HTML, skipping the <head><body> areas.

/admin/module/demo/ini.xml

This file contains module configurations, including installation SQL, uninstallation, etc. See /admin/module/demo/ini.xml for fields informations.

/module/demo/window.php

This file contains the windowed mode script of the module. qE also checks for this file to determine a module existance. So, be sure to always supply this file, even your module doesn't have windowed mode. See /module/demo/window.php for additional informations.

/module/demo/main.php

This file contains the full screen mode script of the module. This is the file called when you link to task.php?mod=demo.

You can also pass variables by using task.php?mod=demo&amp;var1=value1&amp;var2=value2...

See /module/demo/main.php for additional informations.


There is no comment. Why not be the first?

More Comments/Post Your Own

Advertisement

Online Users

There are 115 users online.

Connect

Connect with us on Facebook

Newsletter

Subscribe to our newsletter for the latest updates and exciting promotions!