You are here

function flexslider_form_optionset_add in Flex Slider 7

Form builder; Form for adding a new option set.

1 string reference to 'flexslider_form_optionset_add'
flexslider_menu in ./flexslider.module
Implements hook_menu().

File

./flexslider.admin.inc, line 37
Administrative page callbacks for the flexslider module.

Code

function flexslider_form_optionset_add($form, &$form_state) {
  $form['title'] = array(
    '#type' => 'textfield',
    '#maxlength' => '255',
    '#title' => t('Title'),
    '#description' => t('A human-readable title for this option set.'),
    '#required' => TRUE,
  );
  $form['name'] = array(
    '#type' => 'machine_name',
    '#maxlength' => '255',
    '#machine_name' => array(
      'source' => array(
        'title',
      ),
      'exists' => 'flexslider_optionset_exists',
    ),
    '#required' => TRUE,
  );
  $form['actions'] = array(
    '#type' => 'actions',
    'submit' => array(
      '#type' => 'submit',
      '#value' => t('Create new option set'),
    ),
    'cancel' => array(
      '#type' => 'link',
      '#title' => t('Cancel'),
      '#href' => 'admin/config/media/flexslider',
    ),
  );
  return $form;
}