function profile2_regpath_features_rebuild in Profile2 Registration Path 7
Same name and namespace in other branches
- 7.2 profile2_regpath.module \profile2_regpath_features_rebuild()
Implements hook_features_rebuild(). Rebuild menu after all profile2_regpath components is re-built.
Parameters
string $module_name: The name of the feature module whose components should be rebuilt.
1 call to profile2_regpath_features_rebuild()
- profile2_regpath_features_revert in ./
profile2_regpath.module - Implements hook_features_revert(). Rebuild menu after all profile2_regpath components is reverted.
File
- ./
profile2_regpath.module, line 340 - Attach profile2 form to registration form according to path.
Code
function profile2_regpath_features_rebuild($module_name) {
$regpaths = module_invoke($module_name, 'default_profile2_regpath');
if (!empty($regpaths)) {
foreach ($regpaths as $regpath) {
// Disable non-schema properties
unset($regpath->disabled);
unset($regpath->api_version);
$regpath = get_object_vars($regpath);
$profile = profile2_type_load($regpath['profile_type']);
$regpath['profile_id'] = $profile->id;
profile2_regpath_regpath_save($regpath);
}
}
menu_rebuild();
}