You are here

function biblio_ui_manage_bundles_manage in Bibliography Module 7.3

Managing bundles - creating bundles(i.e biblio types).

1 string reference to 'biblio_ui_manage_bundles_manage'
biblio_ui_menu in modules/biblio_ui/biblio_ui.module
Implements hook_menu().

File

modules/biblio_ui/biblio_ui.module, line 687
Main functionality file for the biblio UI module.

Code

function biblio_ui_manage_bundles_manage($form, $form_state, $data = '') {
  if ($data) {
    $info = biblio_types($data);
    $name = $info->name;
    $machine = $info->type;
    $description = $info->description;
    $form_state['op'] = 'edit';
  }
  else {
    $name = '';
    $machine = '';
    $description = '';
    $form_state['op'] = 'create';
  }
  $form['name'] = array(
    '#title' => t('Name'),
    '#type' => 'textfield',
    '#default_value' => $name,
    '#description' => t('The human readable name of the biblio type.'),
    '#required' => TRUE,
    '#size' => 30,
  );
  $form['type'] = array(
    '#type' => 'machine_name',
    '#default_value' => $machine,
    '#maxlength' => 32,
    '#machine_name' => array(
      'exists' => 'biblio_types',
    ),
    '#description' => t('A machine readable name of the biblio type.'),
  );
  $form['description'] = array(
    '#type' => 'textfield',
    '#title' => t('Description'),
    '#description' => t('A short description about the new biblio type.'),
    '#required' => TRUE,
    '#default_value' => $description,
  );
  $form['actions'] = array(
    '#type' => 'actions',
    'submit' => array(
      '#type' => 'submit',
      '#value' => t('Save'),
    ),
    'cancel' => array(
      '#markup' => l(t('Cancel'), 'admin/structure/biblio'),
    ),
  );
  return $form;
}