You are here

function module_builder_edit_form in Module Builder 6

The basic edit form

1 string reference to 'module_builder_edit_form'
module_builder_module_builder in ./module_builder.components.inc

File

./module_builder.components.inc, line 43

Code

function module_builder_edit_form(&$form_state, $values, $mid) {
  $form = array();
  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Name'),
    '#description' => t('The external name of the module'),
    '#size' => 40,
    '#maxlength' => 255,
    '#default_value' => isset($values->name) ? $values->name : '',
  );
  $form['machine'] = array(
    '#type' => 'textfield',
    '#title' => t('Machine-readable name'),
    '#description' => t('Alpha-numeric characters and underscores only'),
    '#size' => 40,
    '#maxlength' => 255,
    '#default_value' => isset($values->machine) ? $values->machine : '',
  );
  $form['description'] = array(
    '#type' => 'textfield',
    '#title' => t('Description'),
    '#description' => t('The description of the module'),
    '#size' => 40,
    '#maxlength' => 255,
    '#default_value' => isset($values->description) ? $values->description : '',
  );
  module_builder_add_js('copy', 'makeUnderscore', '#edit-name', '#edit-machine');
  return $form;
}