You are here

function _menu_block_settings in Menu Block 5

Display the settings form for Menu block.

Return value

The form array.

1 call to _menu_block_settings()
menu_block_settings in ./menu_block.module
Display the settings form for Menu block.

File

./menu_block.admin.inc, line 9

Code

function _menu_block_settings() {
  $form = array();
  $form['menu_block_enabled_blocks'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Enable the following blocks of menu trees'),
    '#default_value' => variable_get('menu_block_enabled_blocks', array()),
    '#options' => array(),
    '#description' => t('Only enabled blocks will appear on the <a href="!url">administer blocks page</a>.', array(
      '!url' => url('admin/build/block'),
    )),
  );
  foreach (variable_get('menu_block_enabled_blocks', array()) as $delta => $enabled) {
    $form['menu_block_enabled_blocks']['#options'][$delta] = _menu_block_format_title($delta);
  }
  $form['menu_block_enabled_blocks']['#options']['-1'] = '<em>' . t('Add a new unconfigured menu block.') . '</em>';
  $form['buttons']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  if (!empty($_POST) && form_get_errors()) {
    drupal_set_message(t('The settings have not been saved because of the errors.'), 'error');
  }
  return $form;
}