You are here

function _menu_block_block_configure in Menu Block 5.2

Same name and namespace in other branches
  1. 5 menu_block.admin.inc \_menu_block_block_configure()
  2. 6.2 menu_block.admin.inc \_menu_block_block_configure()
  3. 7.3 menu_block.admin.inc \_menu_block_block_configure()
  4. 7.2 menu_block.admin.inc \_menu_block_block_configure()

Returns the 'configure' $op info for hook_block().

File

./menu_block.admin.inc, line 157
Provides infrequently used functions for menu_block.

Code

function _menu_block_block_configure($delta) {
  $form['help'] = array(
    '#value' => '<p>' . t('To learn more about configuring menu blocks, see <a href="@url">menu block’s detailed help</a>.', array(
      '@url' => url('admin/help/menu_block'),
    )) . '</p>',
    '#weight' => -18,
  );
  $form['menu_name'] = array(
    '#type' => 'select',
    '#title' => t('Menu'),
    '#default_value' => variable_get("menu_block_{$delta}_menu_name", 1),
    '#options' => menu_get_root_menus(),
    '#description' => t('The tree (or list) of links will be taken from this menu.'),
  );
  $form['level'] = array(
    '#type' => 'select',
    '#title' => t('Starting level of menu tree'),
    '#default_value' => variable_get("menu_block_{$delta}_level", 1),
    '#options' => array(
      '1' => t('1st level (primary)'),
      '2' => t('2nd level (secondary)'),
      '3' => t('3rd level (tertiary)'),
      '4' => t('4th level'),
      '5' => t('5th level'),
      '6' => t('6th level'),
      '7' => t('7th level'),
      '8' => t('8th level'),
      '9' => t('9th level'),
      '10' => t('10th level'),
    ),
    '#description' => t('Blocks that start with the 1st level will always be visible. Blocks that start with the 2nd level or deeper will only be visible when the trail to the active menu item is in the block’s tree.'),
  );
  $form['depth'] = array(
    '#type' => 'select',
    '#title' => t('Maximum depth of menu tree'),
    '#default_value' => variable_get("menu_block_{$delta}_depth", 0),
    '#options' => array(
      '1' => '1',
      '2' => '2',
      '3' => '3',
      '4' => '4',
      '5' => '5',
      '6' => '6',
      '7' => '7',
      '8' => '8',
      '9' => '9',
      '10' => '10',
      '0' => 'Unlimited',
    ),
    '#description' => t('From the starting level, specify the maximum depth of the tree.'),
  );
  $form['expanded'] = array(
    '#type' => 'checkbox',
    '#title' => t('Expand all children'),
    '#default_value' => variable_get("menu_block_{$delta}_expanded", 0),
    '#description' => t('All sub-menus of this menu will be expanded.'),
  );
  return $form;
}