function _menu_block_block_configure in Menu Block 5
Same name and namespace in other branches
- 5.2 menu_block.admin.inc \_menu_block_block_configure()
- 6.2 menu_block.admin.inc \_menu_block_block_configure()
- 7.3 menu_block.admin.inc \_menu_block_block_configure()
- 7.2 menu_block.admin.inc \_menu_block_block_configure()
Returns the 'configure' $op info for hook_block().
File
- ./
menu_block.admin.inc, line 96
Code
function _menu_block_block_configure($delta) {
$form['mid'] = array(
'#type' => 'select',
'#title' => t('Menu'),
'#default_value' => variable_get("menu_block_{$delta}_mid", 1),
'#options' => array(),
'#description' => t('The tree (or list) of links will be taken from this menu.'),
);
foreach (menu_get_root_menus() as $mid => $title) {
$form['mid']['#options'][$mid] = $title;
}
$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 2nd level or deeper will only be visible when the active menu item is in the block's tree. Blocks that start with the 1st level will always be visible."),
);
$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('Trees with a maximum depth of 1 will be styled as a menu list, i.e. theme_menu_block_list() instead of theme_menu_block_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;
}