Umil.module exists
From phpBB Development Wiki
umil::module_exists –– Check if a module exists using the Umil Library.
Contents |
Description
string umil::module_exists ( mixed $class , mixed $parent , mixed $module )
Parameters
| Parameter | Required/Default | Usage |
|---|---|---|
| class | Required | The module class: 'acp', 'mcp', or 'ucp' (or your own if you've added another class) |
| parent | Required | The parent module_id or module_langname. Use 0 for no parent (meaning it checks the base categories) or boolean false to ignore the parent check and check the entire class. |
| module | Required | The module_langname you would like to check to see if exists or not. |
Return Values
True if the module exists
False if the module does not exist
Examples
Example #1
Check if a module named 'ACP_CAT_TEST_MOD' exists in the ACP->'ACP_CAT_DOT_MODS' category.
$umil->module_exists('acp', 'ACP_CAT_DOT_MODS', 'ACP_CAT_TEST_MOD');
Example #2
Check if a module named 'ACP_BOARD_SETTINGS' exists in the entire ACP
$umil->module_exists('acp', false, 'ACP_BOARD_SETTINGS');
Example #3
Check if a module named 'ACP_CAT_DOT_MODS' exists as a base category in the ACP
$umil->module_exists('acp', 0, 'ACP_CAT_DOT_MODS');
See Also

