Common Module Functions

Common Module Functions

register_activation_hook

/**
 * Register module activation hook
 * @param  string $module   module system name
 * @param  mixed $function  function for the hook
 * @return mixed
 */
 
register_activation_hook($module, $function)

register_deactivation_hook

/**
 * Register module deactivation hook
 * @param  string $module   module system name
 * @param  mixed $function  function for the hook
 * @return mixed
 */
 
register_deactivation_hook($module, $function)

register_uninstall_hook

/**
 * Register module uninstall hook
 * @param  string $module   module system name
 * @param  mixed $function  function for the hook
 * @return mixed
 */
 
register_uninstall_hook($module, $function)

register_cron_task

/**
 * Register module cron task, the cron task is executed after the core cron tasks are finished
 * @param  mixed $function  function/class parameter for the hook
 * @return null
 */
 
register_cron_task($function)

register_payment_gateway

 /**
     * Inject custom payment gateway into the payment gateways array
     * @param string $idpayment gateway id, should equal like the libraries/classname e.q. gateways/New_gateway
     * @param string $module       module name to load the gateway if not already loaded
     */
 
register_payment_gateway($id, $module)

register_language_files

/**
 * Register module language files to support custom_lang.php file
 * @param  string $module    module system name
 * @param  array  $languages array of language file names without the _lang.php
 * @return null
 */
 
register_language_files($module, $languages)

module_dir_url

/**
 * Module URL
 * e.q. https://crm-installation.com/module_name/
 * @param  string $module  module system name
 * @param  string $segment additional string to append to the URL
 * @return string
 */
 
module_dir_url($module, $segment = '')

module_dir_path

 /**
 * Module directory absolute path
 * @param  string $module module system name
 * @param  string $concat append additional string to the path
 * @return string
 */
 
module_dir_path($module, $concat = '')

module_libs_path

/**
 * Module libraries path
 * e.q. modules/module_name/libraries
 * @param  string $module module name
 * @param  string $concat append additional string to the path
 * @return string
 */
 
module_libs_path($module, $concat = '')

    • Related Articles

    • 19: Common Things

      Connect over shared interests with the "Common Things" module on BIMeta using this simple guide: 1. Locate 'Common Things': On the left side of the site, find and click on the 'Common Things' module. 2. Explore Common Things Page: · Clicking opens ...
    • Module Basics

      Modules location & Name All modules should be added in the modules folder in your root directory where Our CRM is installed and each module must have unique folder name and init file with the same name as your module folder name. Creating your first ...
    • Module Security

      So, you created your module and works fine, but is it secure? You must ensure that your module is secure and is not vulnerable to any SQL Injections are directory traversing. You can find below best practices to ensure that your module will be ...
    • Module File Headers

      Each module in Our CRM consist of init file which contains the general module configuration and includes headers containing meta-information regarding the module. Module init file headers example The follow example is taken from the default Our CRM ...
    • Create Menu Items

      If you are creating your custom modules, probably you will want to create menu items that will be shown on admin area sidebar or clients area navigation. With Our CRM you can easily achieve this with few lines of code. The code samples below, should ...