You are here

function mb_admin in More Buttons 7

Provides the MB button values settings form.

2 string references to 'mb_admin'
mb_menu in mb/mb.module
Implements hook_menu().
theme_mb_admin in mb/mb.admin.inc
Display the MB button values settings form page.

File

mb/mb.admin.inc, line 11

Code

function mb_admin() {
  $module = 'mb';
  $mb_default_values = mb_default_values($module);
  $mb_values = mb_get_values($module);

  // Provide customizable button and tab values.
  // Don't make default value strings translatable here!
  $form['values'] = array(
    '#type' => 'fieldset',
    '#title' => t('Button and tab values'),
    '#description' => t('Use your own names for the buttons and the tab. These names are translatable with the translation interface. Do not enter translated texts here.'),
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
  );
  $form['values'][$module . '_value_cancel'] = array(
    '#type' => 'textfield',
    '#title' => t('Cancel button'),
    '#size' => 20,
    '#maxlength' => 50,
    '#default_value' => isset($mb_values['cancel']) ? $mb_values['cancel'] : $mb_default_values['cancel'],
    '#required' => TRUE,
    '#prefix' => '<div class="' . $module . '-values-first, ' . $module . '-values-first">',
  );
  $form['values'][$module . '_value_sac'] = array(
    '#type' => 'textfield',
    '#title' => t('Save and continue button'),
    '#size' => 20,
    '#maxlength' => 50,
    '#default_value' => isset($mb_values['sac']) ? $mb_values['sac'] : $mb_default_values['sac'],
    '#required' => TRUE,
    '#suffix' => '</div>',
  );
  $form['values'][$module . '_value_sacn'] = array(
    '#type' => 'textfield',
    '#title' => t('Save and create new button'),
    '#size' => 20,
    '#maxlength' => 50,
    '#default_value' => isset($mb_values['sacn']) ? $mb_values['sacn'] : $mb_default_values['sacn'],
    '#required' => TRUE,
    '#prefix' => '<div class="' . $module . '-values-last, ' . $module . '-values-last">',
  );
  $form['values'][$module . '_value_tabcn'] = array(
    '#type' => 'textfield',
    '#title' => t('Create new tab'),
    '#description' => t('This tab are displayed in addition to the content %edit tab.', array(
      '%edit' => t('Edit'),
    )),
    '#size' => 20,
    '#maxlength' => 50,
    '#default_value' => isset($mb_values['tabcn']) ? $mb_values['tabcn'] : $mb_default_values['tabcn'],
    '#required' => TRUE,
    '#suffix' => '</div>',
  );
  $form['submit']['save'] = array(
    '#type' => 'submit',
    '#name' => 'save',
    '#value' => t('Save'),
  );
  $form['submit']['reset'] = array(
    '#type' => 'submit',
    '#name' => 'reset',
    '#value' => t('Reset to defaults'),
  );
  return $form;
}