You are here

function _module_builder_export_module in Module Builder 6

1 call to _module_builder_export_module()
module_builder_export_callback in ./module_builder.api.inc

File

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

Code

function _module_builder_export_module($module) {
  $output = "<?php\n";
  $output .= "// \$" . "Id\$ \n\n";
  $output .= "/**\n";
  $output .= " * @fi" . "le " . $module->name . "\n";
  $output .= " * " . $module->description . "\n";
  $output .= " */\n\n";
  $components = module_builder_get_components();
  foreach ($components as $component_name => $component) {
    if ($component['export'] != FALSE) {
      $values = unserialize(db_result(db_query("SELECT data FROM {module_builder_data} WHERE type = '%s' AND mid = %d", $component_name, $module->mid)));
      if (!$values) {
        $values = new stdClass();
      }
      $output .= $component['export']($values, $module) . "\n";
    }
  }
  $output .= "\n";
  return $output;
}