function menu_icons_admin_settings in Menu Icons 7.3
Same name and namespace in other branches
- 8 menu_icons.module \menu_icons_admin_settings()
- 6.2 menu_icons.module \menu_icons_admin_settings()
- 6 menu_icons.module \menu_icons_admin_settings()
Build the menu_icon's settings form
Return value
a form array
2 string references to 'menu_icons_admin_settings'
- menu_icons_form_alter in ./
menu_icons.module - Implements hook_form_alter().
- menu_icons_menu in ./
menu_icons.module - Implements hook_menu().
File
- ./
menu_icons.module, line 405 - Module to associate icons with menu items
Code
function menu_icons_admin_settings($form, &$form_state) {
$form['menu_icons_default_icon'] = array(
'#type' => 'textfield',
'#title' => t('Icon path'),
'#default_value' => variable_get('menu_icons_default_icon', drupal_get_path('module', 'menu_icons') . '/images/default_icon.png'),
'#description' => t('A Drupal path to the icon or image to use as a default.'),
'#required' => FALSE,
);
$options = array();
foreach (image_styles() as $pid => $preset) {
$options[$preset['name']] = $preset['name'];
}
if (!empty($options)) {
$form['menu_icons_image_style_default'] = array(
'#type' => 'select',
'#title' => t('Image default style'),
'#default_value' => variable_get('menu_icons_image_style_default', 'menu_icon'),
'#description' => t('Choose a default !link to be used for menu icons. This setting can be overwritten per menu item.', array(
'!link' => l(t('Image style'), 'admin/config/media/image-styles'),
)),
'#required' => FALSE,
'#options' => $options,
);
}
$form['menu_icons_image_folder'] = array(
'#type' => 'textfield',
'#title' => t('Icon folder'),
'#default_value' => variable_get('menu_icons_image_folder', 'menu_icons'),
'#description' => t('The name of the files directory in which the new uploaded icons will be stored. This folder will be created in the files directory'),
'#required' => FALSE,
);
$form['menu_icons_position'] = array(
'#type' => 'select',
'#title' => t('Position'),
'#default_value' => variable_get('menu_icons_position', 'left'),
'#options' => array(
'top' => t('top'),
'bottom' => t('bottom'),
'right' => t('right'),
'left' => t('left'),
),
'#required' => FALSE,
);
$form['menu_icons_hide_titles'] = array(
'#type' => 'checkbox',
'#title' => t('Hide menu titles if icon is present'),
'#default_value' => variable_get('menu_icons_hide_titles', FALSE),
'#description' => t('Check this to hide menu titles and display only the icon, if an icon is configured. You will need to clear the theme registry cache after changing this option for it to take effect.'),
);
$form['menu_icons_use_css'] = array(
'#type' => 'checkbox',
'#title' => t('Provide default CSS for placing menu icons into the menu'),
'#default_value' => variable_get('menu_icons_use_css', TRUE),
'#description' => t("Advanced: uncheck this box if you do not want to enable the Menu Icon style sheet that's provided by default. If you uncheck this box, you must provide your own CSS for Menu Icons to appear!"),
);
return system_settings_form($form);
}