You are here

function Xmodule_builder_write_buttons in Module Builder 6.2

Same name and namespace in other branches
  1. 7 module_builder.module \Xmodule_builder_write_buttons()

Form after build callback. If update button was clicked, update hooks documentation. Rest of form is not submitted. Cribbed from node_form_add_preview()

File

./module_builder.module, line 450
Builds scaffolding for custom modules.

Code

function Xmodule_builder_write_buttons($form) {
  static $been_here = FALSE;

  // ugly but I'm going round in circles trying to figure out how best to do this
  if ($been_here) {
    return $form;
  }
  $been_here = TRUE;
  global $form_values;
  $op = isset($form_values['op']) ? $form_values['op'] : '';
  if ($op == t('Write module file')) {
    _module_builder_write_file($form_values['module_root_name'], '.module', $form_values['module_code']);
  }
  elseif ($op == t('Write info file')) {
    _module_builder_write_file($form_values['module_root_name'], '.info', $form_values['module_info']);
  }
  return $form;
}