function hook_responsive_menus_style_info in Responsive Menus 8
Same name and namespace in other branches
- 7 responsive_menus.api.php \hook_responsive_menus_style_info()
Example implementation of hook_responsive_menus_style_info().
You can use js/css_folder to load a whole directory's files, or js/css_files to load individual files.
The parameters 'form' & 'js_settings' are callbacks to functions.
Params when declaring hook_responsive_menus_style_info(): name :string: Name displayed when choosing style. form :string: Drupal FAPI callback for admin form. js_folder :string: Folder to recursively include .js files from. css_folder :string: Folder to recursively include .css files from. js_files :array: Individual JS files to include. css_files :array: Individual CSS files to include. js_settings :string: Function to generate settings to pass to JS. use_libraries :boolean: TRUE if uses libraries module to load. library :string: Name that the libraries module uses to load. jquery_version :float: Minimum jQuery version required for this style.
File
- ./
responsive_menus.api.php, line 43 - Hooks provided by the Responsive Menus module.
Code
function hook_responsive_menus_style_info() {
$path = drupal_get_path('module', 'responsive_menus');
$styles = array(
'example_style' => array(
'name' => t('Example Responsive Menus style'),
'form' => 'example_style_settings',
'js_folder' => $path . '/js',
'css_folder' => $path . '/css',
'js_files' => array(
$path . '/js/example1.js',
$path . '/js/example2.js',
),
'css_files' => array(
$path . '/css/example.css',
),
'js_settings' => 'example_style_js_settings',
'use_libraries' => TRUE,
'library' => 'ExampleLibraryFolderName',
'jquery_version' => 1.7,
),
);
return $styles;
}