My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
CreatingModules  
Developing modules to extend the Fokiz CMS.
Updated Feb 20, 2012 by ksafranski

Getting Started

To create a module, simply build a folder in /system/modules with the name you would like to define for the module. From there, the first thing you'll want to do is create a config.php file in the folder you created, which should look like the following:

<?php

require_once('config.php'); // Includes root config file.
 

 //////////////////////////////////////////////////////////////////
 // Module Configuration
 //////////////////////////////////////////////////////////////////
 
 $module = new StdClass();
 $module->name = "NAME";
 $module->description = "DESCRIPTION"; 
 $module->load = "DEFAULT.php";
 $module->css = "STYLESHEET.css";
 $module->js = "JAVASCRIPT.js";
 $module->param = "PARAMETER_NAME";
 $module->param_options = "PARAMETER_OPTIONS";
 
 //////////////////////////////////////////////////////////////////
 // Get Module Folder
 //////////////////////////////////////////////////////////////////
 
 $module_path = explode("/",dirname(__FILE__));
 $module_path_nodes = count($module_path);
 
 $module->folder = $module_path[($module_path_nodes-1)];

?>

Explanation of Variables

NAME = The (human-readable) name of the module

DESCRIPTION = A brief description of the module and any implementation instructions

DEFAULT.php = The default file to be loaded

STYLESHEET.css = The CSS file(s) to be loaded (leave blank for none)

JAVASCRIPT.js = The JS file(s) to be loaded (leave blank for none)

PARAMETER_NAME = A parameter that can be passed in by the user (leave blank for none)

PARAMETER_OPTIONS = Comma separated list of pre-defined parameters (leave blank for none)

Once the configuration file has been created you can begin developing the module. Modules work like an 'include' file and are loaded similarily.

MULTIPLE CSS/JS FILES - as of version 2.0 multiple css/js files can be called by comma separating each file.

Administrative Modules

to create modules with administrative (back-end) components please see the information [here].


Sign in to add a comment
Powered by Google Project Hosting