You are here

function token_custom_features_export_render in Custom Tokens 7.2

Implements hook_features_export_render().

File

./token_custom.features.inc, line 39
Features integration for the Custom tokens module.

Code

function token_custom_features_export_render($module_name, $data, $export = NULL) {
  $code = array();
  $i = 0;
  foreach ($data as $component) {

    // Here is just a variable_get, in other cases, it could be a query!
    $token_obj = token_custom_features_config_get_machinename($component);
    if ($token_obj) {
      foreach ($token_obj as $key => $value) {
        $code[$i][$key] = $value;
      }
    }
    $i++;
  }
  $code = "  return " . features_var_export($code, '  ') . ";";
  return array(
    'token_custom_features_default_settings' => $code,
  );
}