68 Classifieds API

Features
class tree: 68Classifieds | index: 68Classifieds | all elements

 Class Modules

Description

Modules class handles everything for the modules.

Please visit our knowledge base for more information on creating a module.

Located in /includes/classes/kernel/Modules.php (line 20)


	
			
Variable Summary
 array $listeners
Method Summary
 Modules Modules (object database &$db)
 void call_hook (string $hook, mixed $data)
 void changeStatus (int $id, string $state)
 boolean exists ( $module)
 array getModule (int $id)
 array getModuleByName (string $name, [string $type = "user"])
 void initModule (int $id, string $action)
 void register (string $hook,  &$class_reference, string $method, object $class_reference)
 void _activate (string $name)
 void _delete_module (string $name)
 array _load_active ()
 array _load_modules ()
Variables
array $listeners = array() (line 25)
  • var: Array of registered hooks and their listners
Methods
Constructor Modules (line 41)

Plugins constructor

  • access: public
Modules Modules (object database &$db)
  • object database &$db: connection
call_hook (line 83)

Throughout the script when a certain action occurs it will call this hook.

void call_hook (string $hook, mixed $data)
  • string $hook: String containing the hook name.
  • mixed $data: Parameters that are passed.
changeStatus (line 194)

Change the status of a module

void changeStatus (int $id, string $state)
  • int $id
  • string $state
exists (line 306)

Checks if a module exists

  • return: True if files exist, false otherwise
boolean exists ( $module)
  • $module
getModule (line 113)

Get a single module

  • return: of results
  • access: public
array getModule (int $id)
  • int $id: Id of the module.
getModuleByName (line 127)

Get an active module by name

  • return: of results
array getModuleByName (string $name, [string $type = "user"])
  • string $name: The name of the module.
  • string $type: The module type. Defualt is user
initModule (line 142)

Install, uninstall, or upgrade a module. This calls the init file in a module and runs one of the following functions: install(), uninstall(), or upgrade().

void initModule (int $id, string $action)
  • int $id
  • string $action
register (line 69)

Register a listner for a given hook

void register (string $hook,  &$class_reference, string $method, object $class_reference)
  • string $hook
  • object $class_reference
  • string $method
  • &$class_reference
_activate (line 267)

Activate a module

void _activate (string $name)
  • string $name
_delete_module (line 250)

Delete a module

void _delete_module (string $name)
  • string $name
_load_active (line 315)

Loads active modules

array _load_active ()
_load_modules (line 378)

Loads not active modules

array _load_modules ()