Skip to content

Administrative Modules

Fluidbyte edited this page Jul 26, 2012 · 2 revisions

Module Admin Components

As of v.2.0 modules can be coupled with administrative components allowing users to control the module through the back-end of the CMS. The pattern is similar to developing the front-end portion of the module.

To begin, create a folder inside the module's directory called "admin". In this folder you will need the following:

config.php -> The main controller

default.php -> The file that loads by default in the back-end

The config.php File

This file uses a similar syntax to the modules main config.php file:

<?php
    
    //////////////////////////////////////////////////////////////////
    // Includes
    //////////////////////////////////////////////////////////////////
    
    if(empty($check_config)){
        require_once('../../../../config.php'); // System include file
        include('../config.php'); // Module (main) config file
    }

    //////////////////////////////////////////////////////////////////
    // Module Admin Configuration
    //////////////////////////////////////////////////////////////////
    
    $module_admin = new StdClass();
    $module_admin->name           = "Module Template";
    $module_admin->load           = "default.php";
    $module_admin->dialog_width   = 500;
    
?>

Admin-Only Modules

Modules can also be deployed as "admin-only", or with no front-end component to be inserted by the user.

To achieve this type of module simple exclude (or rename) the module's main config.php file.

Clone this wiki locally