function skinr_context_group_defaults_import in Skinr 8.2
Same name and namespace in other branches
- 7.2 skinr_context/skinr_context.module \skinr_context_group_defaults_import()
Imports default skin settings group objects from code into database.
Parameters
$module_name: Limit importing of defaults to a single module.
$force: If FALSE (default) the default skin settings group will only be imported if it doesn't exist, or if storage is default in code. If TRUE, the skin settings group in code will always be overwritten.
Return value
If an import failed, returns FALSE. If all imports succeeded, returns TRUE.
3 calls to skinr_context_group_defaults_import()
- skinr_context_modules_enabled in skinr_context/
skinr_context.module - Implements hook_modules_enabled().
- skinr_group_features_rebuild in skinr_context/
skinr_context.features.inc - Implements hook_features_rebuild().
- skinr_group_features_revert in skinr_context/
skinr_context.features.inc - Implements hook_features_revert().
File
- skinr_context/
skinr_context.module, line 339 - Provides Skinr integration with Context.
Code
function skinr_context_group_defaults_import($module_name = NULL, $force = FALSE) {
if (isset($module_name)) {
if (!($default_groups = module_invoke($module_name, 'skinr_context_group_defaults'))) {
$default_groups = array();
}
drupal_alter('skinr_context_group_defaults', $default_groups);
}
else {
$default_groups = _skinr_context_group_get_defaults();
}
$status = TRUE;
foreach ($default_groups as $group) {
$status = skinr_context_group_import($group, $force) && $status;
}
return $status;
}