This is how can I hide modules

Hi,

I created a custom module to be used on the back end only. I didn’t want it available for menus or panels so I hide it. To achieve that I
modify, custom/Extension/application/Ext/Include/MyCustomModule.php and modify from:


<?php 
$beanList['MyCustomModule'] = 'MyCustomModule';
$beanFiles['htgi3_MultipleActivities'] = 'modules/MyCustomModule/MyCustomModule.php';
$moduleList[] = 'MyCustomModule';
?> 

To this:


<?php 
$beanList['MyCustomModule'] = 'MyCustomModule';
$beanFiles['MyCustomModule'] = 'modules/MyCustomModule/MyCustomModule.php';
$modules_exempt_from_availability_check['MyCustomModule'] = 'MyCustomModule';
$report_include_modules['MyCustomModule'] = 'MyCustomModule';
$modInvisList[] = 'MyCustomModule';

?>

If you need to hide unused core modules you can create this file custom/application/Ext/Include/modules.ext.php and include code similar to the above. If you need a reference check file /include/modules.php (DO NOT MODIFY THIS FILE)

Thanks,

AlxGr

2 Likes

Correction:
If you want to hide a core module please follow these steps (In this sample I’m hiding the Contacts module):

  1. Go to Admin >Display Modules and Subpanels and to hide both: the module and the subpanel for the required module.
  2. Create file custom\Extension\application\Ext\Include\Contacts.php and add the following code

$beanList['Contacts'] = 'Contacts';
$beanFiles['Contacts'] = 'modules/Contacts/Contact.php';
$modules_exempt_from_availability_check['Contacts'] = 'Contacts';
$report_include_modules['Contacts'] = 'Contacts';
$modInvisList[] = 'Contacts';
  1. Do a quick repair/rebuild

Thanks.

2 Likes