Skip to content

Instantly share code, notes, and snippets.

@gratzc
Created March 5, 2012 01:17
Show Gist options
  • Save gratzc/1975777 to your computer and use it in GitHub Desktop.
Save gratzc/1975777 to your computer and use it in GitHub Desktop.
Add modules external location to CB
/**
* Fired when the module is registered and activated.
*/
function onLoad(){
//get the current external locations
var modulesExternalLocation = controller.getSetting('modulesExternalLocation');
//if the contentbox-modules isn't already part of the setting, add it and register/activate all modules
if (!arrayFind(modulesExternalLocation,"/contentbox-modules")) {
//get the module service
var ms = controller.getModuleService();
//add the contentbox-modules to the setting
arrayAppend(modulesExternalLocation,'/contentbox-modules');
controller.setSetting('modulesExternalLocation',modulesExternalLocation);
//register and activate all the modules now that we have more locations
ms.registerAllModules();
ms.activateAllModules();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment