public function WorkflowFeaturesController::export_render in Workflow 7.2
Generates the result for hook_features_export_render().
This is a copy of the parent, adding 'system_roles'. The workflow is imported in the target system with Workflow::save().
Overrides EntityDefaultFeaturesController::export_render
File
- ./
workflow.features.inc, line 46 - Provides Features integration for Workflow using the CRUD API.
Class
- WorkflowFeaturesController
- Default controller handling features integration.
Code
public function export_render($module, $data, $export = NULL) {
$translatables = $code = array();
$code[] = ' $workflows = array();';
$code[] = '';
foreach ($data as $identifier) {
// Clone workflow to make sure changes are not propagated to original.
if ($workflow = entity_load_single($this->type, $identifier)) {
$this
->export_render_workflow($workflow, $identifier, $code);
}
}
$code[] = ' return $workflows;';
$code = implode("\n", $code);
$hook = isset($this->info['export']['default hook']) ? $this->info['export']['default hook'] : 'default_' . $this->type;
return array(
$hook => $code,
);
}