You are here

function boxes_add_form in Boxes 7

Same name and namespace in other branches
  1. 6 boxes.admin.inc \boxes_add_form()

Generate form for creating new boxes.

2 string references to 'boxes_add_form'
boxes_form_alter in ./boxes.module
Implements hook_form_alter().
boxes_menu in ./boxes.module
Implements hook_menu().

File

./boxes.admin.inc, line 6

Code

function boxes_add_form($form, $form_state, $plugin_key) {
  $form_state['box'] = boxes_factory($plugin_key);
  $form = boxes_box_form($form, $form_state);
  $form['delta'] = array(
    '#type' => 'textfield',
    '#title' => t('Machine name'),
    '#description' => t('Lowercase letters, numbers and underscores only'),
    '#required' => TRUE,
    '#element_validate' => array(
      'boxes_validate_delta',
    ),
    '#size' => 32,
    '#maxlength' => 32,
    '#weight' => -20,
  );
  $form['submit']['#attributes']['class'] = array();
  return $form;
}