function homebox_features_export_render in Homebox 7.3
Same name and namespace in other branches
- 6.3 homebox.features.inc \homebox_features_export_render()
- 6.2 homebox.features.inc \homebox_features_export_render()
- 7.2 homebox.features.inc \homebox_features_export_render()
Implements hook_features_export_render().
File
- ./
homebox.features.inc, line 54 - Features support.
Code
function homebox_features_export_render($module = 'foo', $data) {
$code = array();
// Begin code
$code[] = ' $homeboxes = array();' . "\n";
foreach ($data as $name) {
// Load the page
$page = homebox_get_page($name);
// Create exported settings
$export = features_var_export($page->settings);
// Fix spacing
$export = str_replace("\n", "\n ", $export);
// Add to code
$code[] = ' $homeboxes[\'' . $page->name . '\'] = ' . $export . ";\n";
}
// End code
$code[] = "\n" . ' return $homeboxes;';
// Put code into a string
$code = implode("\n", $code);
return array(
'homebox' => $code,
);
}