You are here

function skinr_skin_export in Skinr 8.2

Same name and namespace in other branches
  1. 7.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.

File

./skinr.module, line 968
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::moduleHandler()
    ->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;
}