You are here

function skinr_skin_defaults_import in Skinr 7.2

Same name and namespace in other branches
  1. 8.2 skinr.module \skinr_skin_defaults_import()

Imports default skin confiuration objects from code into database.

Parameters

$module_name: Limit importing of defaults to a single module.

$force: If FALSE (default) the default skin will only be imported if the skin configuration doesn't exist, or if storage is default in code. If TRUE, the skin configuration in code will always be overwritten.

Return value

If an import failed, returns FALSE. If all imports succeeded, returns TRUE.

3 calls to skinr_skin_defaults_import()
skinr_modules_enabled in ./skinr.module
Implements hook_modules_enabled().
skinr_skin_features_rebuild in ./skinr.features.inc
Implements hook_features_rebuild().
skinr_skin_features_revert in ./skinr.features.inc
Implements hook_features_revert().

File

./skinr.module, line 935
Handles core Skinr functionality.

Code

function skinr_skin_defaults_import($module_name = NULL, $force = FALSE) {
  if (isset($module_name)) {
    if (!($default_skins = module_invoke($module_name, 'skinr_skin_defaults'))) {
      $default_skins = array();
    }
    drupal_alter('skinr_skin_defaults', $default_skins);
  }
  else {
    $default_skins = _skinr_skin_get_defaults();
  }
  $status = TRUE;
  foreach ($default_skins as $skin) {
    $status = skinr_skin_import($skin, $force) && $status;
  }
  return $status;
}