You are here

function bat_type_add_units_form in Booking and Availability Management Tools for Drupal 7

Unit add form.

1 string reference to 'bat_type_add_units_form'
bat_type_add_units_form_wrapper in modules/bat_unit/bat_type.admin.inc
Form callback wrapper: create units associated with a type.

File

modules/bat_unit/bat_type.admin.inc, line 803
BatType editing UI.

Code

function bat_type_add_units_form($form, &$form_state, $unit_model) {
  $form['units'] = array(
    '#type' => 'textfield',
    '#title' => t('Units'),
    '#size' => 3,
    '#description' => t('Number of Units to create.'),
  );
  $form['type_id'] = array(
    '#type' => 'hidden',
    '#value' => $unit_model->type_id,
  );
  $form['unit_type'] = array(
    '#type' => 'hidden',
    '#value' => $unit_model->type,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Add'),
  );
  $form['#attached']['css'][] = array(
    'data' => '.form-item-units label { display: inline-block; margin-right: 5px; }',
    'type' => 'inline',
  );
  return $form;
}