You are here

function skinr_skin_export in Skinr 7.2

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

Output a skin configuration object as code suitable for skinr_skin_defaults().

Parameters

$skin: A skin configuration object.

$prefix: A string to prefix the code with, used to indent the resulting code.

Return value

A string.

2 calls to skinr_skin_export()
skinr_skin_features_export_render in ./skinr.features.inc
Implements hook_features_export_render().
skinr_ui_export_form in ./skinr_ui.admin.inc
Form builder for the Skinr settings export form.

File

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

Code

function skinr_skin_export($skin, $prefix = '') {

  // Make sure we don't modify the cached skin object.
  $skin = clone $skin;

  // Let modules modify the skin configuration.
  drupal_alter('skinr_skin_export', $skin, $prefix);

  // Remove site specific $sid.
  unset($skin->sid);
  $output = skinr_object_export($skin, 'skin', $prefix);
  $output .= $prefix . "\$skins['{$skin->uuid}'] = \$skin;\n";
  return $output;
}