You are here

function mb_content_admin in More Buttons 7

Provides the central MB Content settings form.

1 string reference to 'mb_content_admin'
mb_content_menu in mb_content/mb_content.module
Implements hook_menu().

File

mb_content/mb_content.admin.inc, line 11

Code

function mb_content_admin() {
  $module = 'mb_content';
  $mb_content_mappings = mb_get_mappings($module);
  $form['#mappings'] = $mb_content_mappings;
  foreach ($mb_content_mappings as $type => $v) {

    // It makes no sense to use the MB Content module with the content type panel.
    if ($type == 'panel') {
      continue;
    }

    // Provide "Cancel" button setting.
    $form[$module][$type][$module . '_cancel_' . $type] = array(
      '#type' => 'select',
      '#options' => mb_cancel_button_positions(),
      '#default_value' => variable_get($module . '_cancel_' . $type, 0),
    );

    // Provide "Save and continue" button setting.
    $form[$module][$type][$module . '_sac_' . $type] = array(
      '#type' => 'select',
      '#options' => mb_save_button_positions($module),
      '#default_value' => variable_get($module . '_sac_' . $type, 0),
    );

    // Provide the "Create new" setting.
    $form[$module][$type][$module . '_tabcn_' . $type] = array(
      '#type' => 'select',
      '#options' => mb_create_new_options(),
      '#default_value' => variable_get($module . '_tabcn_' . $type, 0),
    );
  }
  $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;
}