You are here

function module_data_from_form in Module Builder 7

Same name and namespace in other branches
  1. 6.2 includes/module_builder.pages.inc \module_data_from_form()
  2. 7.2 includes/module_builder.pages.inc \module_data_from_form()

Helper function: creates an array of all the data needed to build the module from form values, suitable for passing to module_builder_generate_module().

1 call to module_data_from_form()
module_builder_page_generate in includes/module_builder.pages.inc
page 2: generate code

File

includes/module_builder.pages.inc, line 410
Menu callback for main module builder page.

Code

function module_data_from_form($form_values) {

  // Most things come in as we want them from the form.
  $data = $form_values;

  // Hooks need flattening.
  $data['hooks'] = array();
  foreach ($form_values['hooks'] as $hook_group) {
    $data['hooks'] += $hook_group;
  }
  return $data;
}