You are here

function skinr_object_export in Skinr 7.2

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

Export object function.

See also

ctools_object_export()

2 calls to skinr_object_export()
skinr_context_group_export in skinr_context/skinr_context.module
Output a settings group object as code suitable for skinr_context_group_defaults().
skinr_skin_export in ./skinr.module
Output a skin configuration object as code suitable for skinr_skin_defaults().

File

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

Code

function skinr_object_export($object, $identifier, $prefix = '') {
  $output = $prefix . '$' . $identifier . ' = new ' . get_class($object) . "();\n";
  $output .= $prefix . '$' . $identifier . '->status = ';
  if ($object->status) {
    $output .= 'TRUE; /* Edit this to false to make a default ' . $identifier . ' disabled initially */' . "\n";
  }
  else {
    $output .= 'FALSE; /* Edit this to true to make a default ' . $identifier . ' enabled initially */' . "\n";
  }
  $output .= $prefix . '$' . $identifier . '->api_version = ' . SKINR_VERSION . ";\n";
  foreach ($object as $field => $value) {
    if ($field == 'status') {
      continue;
    }
    $output .= $prefix . '$' . $identifier . '->' . $field . ' = ' . skinr_var_export($value, $prefix) . ";\n";
  }
  return $output;
}