function menu_block_split_settings in Menu Block Split 6
Same name and namespace in other branches
- 5.2 menu_block_split.module \menu_block_split_settings()
- 5 menu_block_split.module \menu_block_split_settings()
- 6.2 menu_block_split.module \menu_block_split_settings()
- 7.2 menu_block_split.module \menu_block_split_settings()
Settings form
1 string reference to 'menu_block_split_settings'
- menu_block_split_menu in ./
menu_block_split.module - Implementation of hook_menu().
File
- ./
menu_block_split.module, line 81 - Allow to have an splitted menu within two blocks Developed by Robert Garrigos <robert@garrigos.cat> Modified for Drupal 6.x by Frank Meyerer <meyerer@digi-info.de> http://www.digi-info.de
Code
function menu_block_split_settings() {
$form['menu_block_split_howmany'] = array(
'#type' => 'select',
'#title' => t('How many blocks with first level menu do you need?'),
'#default_value' => variable_get('menu_block_split_howmany', 1),
'#options' => range(0, 10),
'#description' => t('Set how many first menu level blocks do you need and click on the Save Configuration button to have the form available.'),
);
// We don't want zero as an option
unset($form['menu_block_split_howmany']['#options'][0]);
$menu_select_options = array();
foreach (menu_get_menus() as $name => $title) {
if (count(menu_navigation_links($name)) > 0) {
$menu_select_options[$name] = $title;
}
}
for ($i = 1; $i <= variable_get('menu_block_split_howmany', 1); $i++) {
$form['menu_block_split_fieldset_' . $i] = array(
'#type' => 'fieldset',
'#title' => t('Menu Block Split !i', array(
'!i' => $i,
)),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['menu_block_split_fieldset_' . $i]['menu_block_split_' . $i] = array(
'#type' => 'select',
'#title' => t('Block' . $i),
'#options' => $menu_select_options,
'#default_value' => variable_get('menu_block_split_' . $i, ''),
'#description' => t('Choose a block as first level menu to split.'),
);
$form['menu_block_split_fieldset_' . $i]['menu_block_splittitle_' . $i] = array(
'#type' => 'textfield',
'#title' => t('Title') . ' ' . $i,
'#default_value' => variable_get('menu_block_splittitle_' . $i, ''),
'#required' => FALSE,
'#description' => t('Set the title of the resulting block.'),
);
}
return system_settings_form($form);
}