/**
  * caches hooks for enabled plugins only
  * indexed by group name
  *
  * @return boolean
  */
 function cachePreferenceOptions()
 {
     $oComponentGroupManager = new OX_Plugin_ComponentGroupManager();
     $aComponentGroups = $GLOBALS['_MAX']['CONF']['pluginGroupComponents'] ? $GLOBALS['_MAX']['CONF']['pluginGroupComponents'] : array();
     $aOptions = array();
     foreach ($aComponentGroups as $name => $enabled) {
         if ($enabled || OA_Permission::getAccountType() == OA_ACCOUNT_ADMIN) {
             $aConfig[$name] = $oComponentGroupManager->_getComponentGroupConfiguration($name);
             if (count($aConfig[$name]['preferences'])) {
                 $aOptions[$name] = array('name' => $name, 'text' => $aConfig[$name]['option'] ? $aConfig[$name]['option'] : $name, 'value' => 'account-preferences-plugin.php?group=' . $name, 'perm' => array(OA_ACCOUNT_ADMIN, OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER, OA_ACCOUNT_TRAFFICKER));
             }
         }
     }
     $oCache = $oComponentGroupManager->_getOA_Cache('Plugins', 'PrefOptions');
     $oCache->setFileNameProtection(false);
     return $oCache->save($aOptions);
 }