PHP Class Addons_model, 68kb

Inheritance: extends CI_Model
Show file Open project: 68kb/68kb

Public Methods

Method Description
__construct ( ) Constructor
activate ( $module_directory ) : boolean Activate a module
exists ( $module_directory, $file = '' ) : boolean Checks if a module file exists
get_config ( $module_directory ) : array Get an add-on's config.php and return the $data array.
get_module ( $module_id ) : array Get a single module
init_module ( $module_name, $action = '', $msg = '' ) : mixed Install an add-on
load_active ( ) : array Loads active add-ons
load_inactive ( ) : array Loads inactive add-ons
remove_dir ( $module_directory ) : boolean Try to remove the add-on directory
show_docs ( $module_name ) : mixed Show A Module read-me page.

Private Methods

Method Description
_get_addons ( ) : array Get all active add-ons
_get_config ( $module_directory ) : array Get an add-on's config.php and return the $data array.
_load_init ( $module_name ) : boolean Load an add-on init file

Method Details

__construct() public method

Setup add-ons path.
public __construct ( )

activate() public method

Activate a module
public activate ( $module_directory ) : boolean
return boolean

exists() public method

Checks if a module file exists
public exists ( $module_directory, $file = '' ) : boolean
return boolean

get_config() public method

If the config.php file is not found or the $data array is not present it returns an empty array.
public get_config ( $module_directory ) : array
return array

get_module() public method

Get a single module
public get_module ( $module_id ) : array
return array

init_module() public method

Install an add-on
public init_module ( $module_name, $action = '', $msg = '' ) : mixed
return mixed

load_active() public method

Loads active add-ons
public load_active ( ) : array
return array

load_inactive() public method

Scans the add-ons directory for inactive add-ons
public load_inactive ( ) : array
return array

remove_dir() public method

Try to remove the add-on directory
public remove_dir ( $module_directory ) : boolean
return boolean

show_docs() public method

Show A Module read-me page.
public show_docs ( $module_name ) : mixed
return mixed