function megamenu_settings_form in Megamenu 6
Same name and namespace in other branches
- 6.2 megamenu.admin.inc \megamenu_settings_form()
- 7 megamenu.admin.inc \megamenu_settings_form()
1 string reference to 'megamenu_settings_form'
- megamenu_menu in ./
megamenu.module - Implementation of hook_menu()
File
- ./
megamenu.admin.inc, line 38
Code
function megamenu_settings_form(&$node, $form_state = null, $menu_name = '') {
drupal_set_title('Mega-Menu Settings for: ' . $menu_name);
$form = array();
$form['orientations'] = array(
'#title' => t('Orientations'),
'#type' => 'fieldset',
'#description' => t('Set the orienation of various menu elements'),
);
$form['orientations']['menu_orientation'] = array(
'#title' => t('Menu Orientation'),
'#type' => 'radios',
'#options' => array(
'horizontal' => 'horizontal',
'vertical' => 'vertical',
),
'#default_value' => _megamenu_get_menu_orientation_by_name($menu_name),
'#description' => t('Select whether the mega menu will extend horizontally and drop down, or if it will extend vertically and fly out.'),
);
$form['orientations']['slot_orientation'] = array(
'#title' => 'Slot Orientation',
'#type' => 'radios',
'#options' => array(
'columnar' => 'columnar',
'stacking' => 'stacking',
),
'#default_value' => _megamenu_get_slot_orientation_by_name($menu_name),
'#description' => t('Select whether slots will sit next to each other (columnar) or stack on top of each other (stacking).'),
);
$form['style'] = array(
'#title' => 'Style Settings',
'#type' => 'fieldset',
'#description' => t('Select a skin for this menu'),
);
// TODO: Create a function to return a list of default skins
$form['style']['skin_options'] = array(
'#title' => t('Skin Type'),
'#type' => 'radios',
'#options' => array(
'supplied_skin' => t('Use a skin supplied with this module'),
'custom_skin' => t('Use your own custom skin'),
),
'#default_value' => _megamenu_is_skin_default($menu_name) ? 'supplied_skin' : 'custom_skin',
'#description' => t('Select if you wish to use a pre-defined skin'),
);
$form['style']['default_skin'] = array(
'#title' => t('Supplied Skin Name'),
'#type' => 'select',
'#options' => array(
'friendly' => 'friendly',
'minimal' => 'minimal',
),
'#default_value' => _megamenu_is_skin_default($menu_name) ? _megamenu_get_skin_by_name($menu_name) : 'minimal',
'#description' => t('Select one of the supplied skins to use'),
);
$form['style']['custom_skin'] = array(
'#title' => t('Custom Skin Name'),
'#type' => 'textfield',
'#default_value' => _megamenu_is_skin_default($menu_name) ? '' : _megamenu_get_skin_by_name($menu_name),
'#description' => t('Type in the name of your custom skin (This will become a class value applied to the menu: megamenu-skin-[skin name]).'),
);
$form['save_configuration'] = array(
'#type' => 'submit',
'#value' => t('Save Configuration'),
);
// Value placeholder
$form['menu_name'] = array(
'#type' => 'value',
'#value' => $menu_name,
);
return $form;
}