You are here

function module_builder_export_callback in Module Builder 6

1 string reference to 'module_builder_export_callback'
module_builder_menu in ./module_builder.module
Implementation of hook_menu().

File

./module_builder.api.inc, line 171
API functions for the module_builder module

Code

function module_builder_export_callback($module, $file) {
  $edit = unserialize(db_result(db_query("SELECT data FROM {module_builder_data} WHERE type = '%s' AND mid = %d", 'edit', $module->mid)));
  $module = (object) ((array) $module + (array) $edit + array(
    'description' => '',
    'machine' => '',
  ));
  if ($file == 'info') {
    header('Content-disposition: attachment');
    print _module_builder_export_info($module);
    exit;
  }
  elseif ($file == 'module') {
    header('Content-disposition: attachment');
    print _module_builder_export_module($module);
    exit;
  }
  elseif ($file == 'tar') {
  }
  else {
    drupal_not_found();
  }
}