'Superfish', 'description' => 'Configure Superfish Menus', 'page callback' => 'drupal_get_form', 'page arguments' => array('superfish_admin_settings'), 'access arguments' => array('administer superfish'), 'file' => 'superfish.admin.inc', ); return $items; } /** * Implements hook_permission(). */ function superfish_permission() { return array( 'administer superfish' => array( 'title' => t('Administer Superfish'), ), ); } /** * Implements hook_help(). */ function superfish_help($path, $arg) { $output = ''; switch ($path) { case 'admin/modules#description': $output .= t('jQuery Superfish plugin for your Drupal menus.'); break; case 'admin/config/user-interface/superfish': $output .= t('

Block-specific Superfish settings could be found at !link

', array('!link' => l('admin/structure/block', 'admin/structure/block'))); break; } return $output; } /** * Implements hook_block_info(). */ function superfish_block_info() { $blocks = array(); $number = variable_get('superfish_number', 4); for ($i = 1; $i <= $number; $i++) { $blocks[$i] = array( 'info' => variable_get('superfish_name_' . $i, 'Superfish ' . $i) . ' (Superfish)', 'cache' => DRUPAL_NO_CACHE, ); } return $blocks; } /** * Implements hook_block_configure(). */ function superfish_block_configure($delta = 0) { $form = array(); $form['superfish_name_' . $delta] = array( '#type' => 'textfield', '#title' => t('Block description'), '#description' => t('A brief description of your block. Used on the !link', array('!link' => l(t('Blocks administration page'), 'admin/structure/block'))), '#default_value' => variable_get('superfish_name_' . $delta, 'Superfish ' . $delta), ); $form['sf-menu'] = array( '#type' => 'fieldset', '#title' => t('Menu'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); $form['sf-menu']['superfish_menu_' . $delta] = array( '#type' => 'select', '#title' => t('Menu parent'), '#description' => t('The menu you want to be displayed using Superfish.') . ' (' . t('Default') . ': <Main menu>)', '#default_value' => variable_get('superfish_menu_' . $delta, 'main-menu:0'), '#options' => menu_parent_options(menu_get_menus(), array('mlid' => 0)), ); $form['sf-menu']['superfish_depth_' . $delta] = array( '#type' => 'select', '#title' => t('Menu depth'), '#description' => t('The number of child levels starting with the parent selected above. -1 means all of them, 0 means none of them.') . ' (' . t('Default') . ': -1)', '#default_value' => variable_get('superfish_depth_' . $delta, -1), '#options' => drupal_map_assoc(range(-1, 50)), ); $form['sf-menu']['superfish_expanded_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Take "Expanded" option into effect.'), '#description' => t('By enabling this option, only parent menu items with Expanded option enabled will have their submenus appear.') . ' (' . t('Default') . ': ' . t('disabled') . ')', '#default_value' => variable_get('superfish_expanded_' . $delta, 0), ); $form['sf-settings'] = array( '#type' => 'fieldset', '#title' => t('Superfish settings'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); $form['sf-settings']['superfish_type_' . $delta] = array( '#type' => 'select', '#title' => t('Menu type'), '#description' => '(' . t('Default') . ': ' . t('Horizontal') . ')', '#default_value' => variable_get('superfish_type_' . $delta, 'horizontal'), '#options' => array( 'horizontal' => t('Horizontal'), 'vertical' => t('Vertical'), 'navbar' => t('NavBar'), ), ); $form['sf-settings']['superfish_style_' . $delta] = array( '#type' => 'select', '#title' => t('Style'), '#description' => '(' . t('Default') . ': ' . t('None') . ')', '#default_value' => variable_get('superfish_style_' . $delta, 'none'), '#options' => superfish_styles(), ); $form['sf-settings']['superfish_speed_' . $delta] = array( '#type' => 'textfield', '#title' => t('Animation speed'), '#description' => t('The speed of the animation either in milliseconds or pre-defined values (slow, normal, fast).') . ' (' . t('Default') . ': fast)', '#default_value' => variable_get('superfish_speed_' . $delta, 'fast'), '#size' => 15, '#required' => TRUE, ); $form['sf-settings']['superfish_delay_' . $delta] = array( '#type' => 'textfield', '#title' => t('Mouse delay'), '#description' => t('The delay in milliseconds that the mouse can remain outside a sub-menu without it closing.') . ' (' . t('Default') . ': 800)', '#default_value' => variable_get('superfish_delay_' . $delta, 800), '#size' => 15, ); $form['sf-settings']['superfish_pathclass_' . $delta] = array( '#type' => 'textfield', '#title' => t('Path class'), '#description' => t('The class you have applied to list items that lead to the current page.') . ' (' . t('Default') . ': active-trail)
' . t('Change this only if you are totally sure of what you are doing.'), '#default_value' => variable_get('superfish_pathclass_' . $delta, 'active-trail'), '#size' => 15, ); $form['sf-settings']['superfish_pathlevels_' . $delta] = array( '#type' => 'select', '#title' => t('Path levels'), '#description' => t('The amount of sub-menu levels that remain open or are restored using Path class.') . ' (' . t('Default') . ': 1)', '#default_value' => variable_get('superfish_pathlevels_' . $delta, 1), '#options' => drupal_map_assoc(range(0, 10)), ); $form['sf-settings']['superfish_slide_' . $delta] = array( '#type' => 'select', '#title' => t('Slide-in effect'), '#description' => '(' . t('Default') . ': ' . t('Vertical') . ')
' . ((count(superfish_effects()) == 4) ? t('jQuery Easing plugin is not installed.') . '
' . t('The plugin provides a handful number of animation effects, they can be used by uploading the \'jquery.easing.js\' file to the libraries directory within the \'easing\' directory (for example: sites/all/libraries/easing/jquery.easing.js). Refresh this page after the plugin is uploaded, this will make more effects available in the above list.') . '
' : '') . '' . t('Important') . ': ' . t('Easing effects require jQuery 1.6.1 or higher. If you need to update your jQuery to version 1.6.1 or higher, please use the jQuery Update module.'), '#default_value' => variable_get('superfish_slide_' . $delta, 'vertical'), '#options' => superfish_effects(), ); $form['sf-settings']['superfish_arrow_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Auto-arrows'), '#default_value' => variable_get('superfish_arrow_' . $delta, 1), ); $form['sf-settings']['superfish_shadow_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Drop shadows'), '#default_value' => variable_get('superfish_shadow_' . $delta, 1), ); $form['sf-settings']['sf-more'] = array( '#type' => 'fieldset', '#title' => t('More options'), '#collapsible' => TRUE, '#collapsed' => TRUE, ); $form['sf-settings']['sf-more']['superfish_use_link_theme_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Use a theme function for hyperlinks.') . ' (' . t('Default') . ': ' . t('enabled') . ')
' . t('(Disabling this feature can result in performance improvements, depending on the number of hyperlinks in the menu.)') . '', '#default_value' => variable_get('superfish_use_link_theme_' . $delta, 1), ); $form['sf-settings']['sf-more']['superfish_use_item_theme_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Use a theme function for menu items.') . ' (' . t('Default') . ': ' . t('enabled') . ')
' . t('(Disabling this feature can result in performance improvements, depending on the number of items in the menu.)') . '', '#default_value' => variable_get('superfish_use_item_theme_' . $delta, 1), ); $form['sf-plugins'] = array( '#type' => 'fieldset', '#title' => t('Superfish plugins'), '#collapsible' => TRUE, '#collapsed' => TRUE, ); $form['sf-plugins']['superfish_bgf_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Use jQuery BgiFrame plugin for this menu.'), '#description' => t('Helps ease the pain when having to deal with IE z-index issues.') . ' (' . t('Default') . ': ' . t('disabled') . ')', '#default_value' => variable_get('superfish_bgf_' . $delta, 0), ); $form['sf-plugins']['superfish_spp_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Use jQuery Supposition plugin for this menu.') . ' (' . t('Beta') . ')', '#description' => t('Relocates sub-menus when they would otherwise appear outside the browser window area.') . ' (' . t('Default') . ': ' . t('enabled') . ')', '#default_value' => variable_get('superfish_spp_' . $delta, 1), ); $form['sf-plugins']['superfish_hid_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Enable hoverIntent detection.'), '#description' => t('Prevents accidental firing of animations by waiting until the user\'s mouse slows down enough, hence determinig user\'s intent.') . ' (' . t('Default') . ': ' . t('enabled') . ')', '#default_value' => variable_get('superfish_hid_' . $delta, 1), ); $form['sf-plugins']['sf-touchscreen'] = array( '#type' => 'fieldset', '#title' => t('sf-Touchscreen') . ' (' . t('Beta') . ')', '#description' => t('sf-Touchscreen provides touchscreen compatibility for your menus.') . ' (' . t('The first click on a parent hyperlink shows its children and the second click opens the hyperlink.') . ')', '#collapsible' => TRUE, '#collapsed' => FALSE, ); $form['sf-plugins']['sf-touchscreen']['superfish_touch_' . $delta] = array( '#type' => 'radios', '#default_value' => variable_get('superfish_touch_' . $delta, 0), '#options' => array( 0 => t('Disable') . '. (' . t('Default') . ')', 1 => t('Enable jQuery sf-Touchscreen plugin for this menu.'), 2 => t('Enable jQuery sf-Touchscreen plugin for this menu depending on the user\'s Web browser window width.'), 3 => t('Enable jQuery sf-Touchscreen plugin for this menu depending on the user\'s Web browser user agent.'), ), ); $form['sf-plugins']['sf-touchscreen']['sf-touchscreen-windowwidth'] = array( '#type' => 'fieldset', '#title' => t('Window width settings'), '#description' => t('sf-Touchscreen will be enabled only if the width of user\'s Web browser window is smaller than the below value.') . '

' . t('Please note that in most cases such a meta tag is necessary for this feature to work properly:') . '
<meta name="viewport" content="width=device-width, initial-scale=1.0" />', '#collapsible' => TRUE, '#collapsed' => TRUE, ); $form['sf-plugins']['sf-touchscreen']['sf-touchscreen-windowwidth']['superfish_touchbp_' . $delta] = array( '#type' => 'textfield', '#description' => t('Also known as "Breakpoint".') . ' (' . t('Default') . ': 768)', '#default_value' => variable_get('superfish_touchbp_' . $delta, 768), '#field_suffix' => t('pixels'), '#size' => 10, ); $form['sf-plugins']['sf-touchscreen']['sf-touchscreen-useragent'] = array( '#type' => 'fieldset', '#title' => t('User agent settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, ); $form['sf-plugins']['sf-touchscreen']['sf-touchscreen-useragent']['superfish_touchua_' . $delta] = array( '#type' => 'radios', '#default_value' => variable_get('superfish_touchua_' . $delta, 0), '#options' => array( 0 => t('Use the pre-defined list of the user agents.') . '(' . t('Default') . ') (' . t('Recommended') . ')', 1 => t('Use the custom list of the user agents.'), ), ); $form['sf-plugins']['sf-touchscreen']['sf-touchscreen-useragent']['superfish_touchual_' . $delta] = array( '#type' => 'textfield', '#title' => t('Custom list of the user agents'), '#description' => t('Could be partial or complete. (Asterisk separated)') . ' (' . t('Default') . ': ' . t('empty') . ')
' . t('Examples') . ':' . ((isset($_SERVER['HTTP_USER_AGENT'])) ? '
' . t('UA string of the current Web browser:') . ' ' . $_SERVER['HTTP_USER_AGENT'] : ''), '#default_value' => variable_get('superfish_touchual_' . $delta, ''), '#size' => 100, '#maxlength' => 2000, ); $form['sf-plugins']['sf-touchscreen']['sf-touchscreen-useragent']['superfish_touchuam_' . $delta] = array( '#type' => 'select', '#title' => t('User agent detection method'), '#description' => '(' . t('Default') . ': ' . t('Client-side (JavaScript)') . ')', '#default_value' => variable_get('superfish_touchuam_' . $delta, 0), '#options' => array( 0 => t('Client-side (JavaScript)'), 1 => t('Server-side (PHP)') ), ); $form['sf-plugins']['sf-smallscreen'] = array( '#type' => 'fieldset', '#title' => t('sf-Smallscreen') . ' (' . t('Beta') . ')', '#description' => t('sf-Smallscreen provides small-screen compatibility for your menus.') . ' (' . t('Converts the dropdown into a <select> element.') . ')', '#collapsible' => TRUE, '#collapsed' => FALSE, ); $form['sf-plugins']['sf-smallscreen']['superfish_small_' . $delta] = array( '#type' => 'radios', '#default_value' => variable_get('superfish_small_' . $delta, 2), '#options' => array( 0 => t('Disable') . '.', 1 => t('Enable jQuery sf-Smallscreen plugin for this menu.'), 2 => t('Enable jQuery sf-Smallscreen plugin for this menu depending on the user\'s Web browser window width.') . ' (' . t('Default') . ')', 3 => t('Enable jQuery sf-Smallscreen plugin for this menu depending on the user\'s Web browser user agent.'), ), ); $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-windowwidth'] = array( '#type' => 'fieldset', '#title' => t('Window width settings'), '#description' => t('sf-Smallscreen will be enabled only if the width of user\'s Web browser window is smaller than the below value.') . '

' . t('Please note that in most cases such a meta tag is necessary for this feature to work properly:') . '
<meta name="viewport" content="width=device-width, initial-scale=1.0" />', '#collapsible' => TRUE, '#collapsed' => TRUE, ); $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-windowwidth']['superfish_smallbp_' . $delta] = array( '#type' => 'textfield', '#description' => t('Also known as "Breakpoint".') . ' (' . t('Default') . ': 768)', '#default_value' => variable_get('superfish_smallbp_' . $delta, 768), '#field_suffix' => t('pixels'), '#size' => 10, ); $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-useragent'] = array( '#type' => 'fieldset', '#title' => t('User agent settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, ); $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-useragent']['superfish_smallua_' . $delta] = array( '#type' => 'radios', '#default_value' => variable_get('superfish_smallua_' . $delta, 0), '#options' => array( 0 => t('Use the pre-defined list of the user agents.') . '(' . t('Default') . ') (' . t('Recommended') . ')', 1 => t('Use the custom list of the user agents.'), ), ); $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-useragent']['superfish_smallual_' . $delta] = array( '#type' => 'textfield', '#title' => t('Custom list of the user agents'), '#description' => t('Could be partial or complete. (Asterisk separated)') . ' (' . t('Default') . ': ' . t('empty') . ')
' . t('Examples') . ':' . ((isset($_SERVER['HTTP_USER_AGENT'])) ? '
' . t('UA string of the current Web browser:') . ' ' . $_SERVER['HTTP_USER_AGENT'] : ''), '#default_value' => variable_get('superfish_smallual_' . $delta, ''), '#size' => 100, '#maxlength' => 2000, ); $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-useragent']['superfish_smalluam_' . $delta] = array( '#type' => 'select', '#title' => t('User agent detection method:'), '#description' => '(' . t('Default') . ': ' . t('Client-side (JavaScript)') . ')', '#default_value' => variable_get('superfish_smalluam_' . $delta, 0), '#options' => array( 0 => t('Client-side (JavaScript)'), 1 => t('Server-side (PHP)') ), ); $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select'] = array( '#type' => 'fieldset', '#title' => t('<select> settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, ); $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select']['superfish_smallset_' . $delta] = array( '#type' => 'textfield', '#title' => t('<select> title'), '#description' => t('By default the first item in the <select> element will be the name of the parent menu or the title of this block, you can change this by setting a custom title.') . ' (' . t('Default') . ': ' . t('empty') . ')
' . t('Example') . ': - ' . t('Main Menu') . ' - .', '#default_value' => variable_get('superfish_smallset_' . $delta, ''), '#size' => 50, '#maxlength' => 500, ); $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select']['superfish_smallasa_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Add selected attribute to the <option> element with the class active'), '#description' => t('Makes pre-selected the item linked to the active page when the page loads.'), '#default_value' => variable_get('superfish_smallasa_' . $delta, 0), ); $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select']['sf-smallscreen-select-more'] = array( '#type' => 'fieldset', '#title' => t('More'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select']['sf-smallscreen-select-more']['superfish_smallcmc_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Copy the main <ul> classes to the <select>.'), '#description' => ' (' . t('Default') . ': ' . t('disabled') . ')', '#default_value' => variable_get('superfish_smallcmc_' . $delta, 0), ); $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select']['sf-smallscreen-select-more']['superfish_smallecm_' . $delta] = array( '#type' => 'textfield', '#title' => t('Exclude these classes from the <select> element'), '#description' => t('Comma separated') . ' (' . t('Default') . ': ' . t('empty') . ')', '#default_value' => variable_get('superfish_smallecm_' . $delta, ''), '#size' => 100, '#maxlength' => 1000, '#states' => array( 'enabled' => array( ':input[name="superfish_smallcmc_' . $delta . '"]' => array('checked' => TRUE), ), ), ); $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select']['sf-smallscreen-select-more']['superfish_smallchc_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Copy the hyperlink classes to the <option> elements of the <select>.'), '#description' => ' (' . t('Default') . ': ' . t('disabled') . ')', '#default_value' => variable_get('superfish_smallchc_' . $delta, 0), ); $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select']['sf-smallscreen-select-more']['superfish_smallech_' . $delta] = array( '#type' => 'textfield', '#title' => t('Exclude these classes from the <option> elements of the <select>'), '#description' => t('Comma separated') . ' (' . t('Default') . ': ' . t('empty') . ')', '#default_value' => variable_get('superfish_smallech_' . $delta, ''), '#size' => 100, '#maxlength' => 1000, '#states' => array( 'enabled' => array( ':input[name="superfish_smallchc_' . $delta . '"]' => array('checked' => TRUE), ), ), ); $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select']['sf-smallscreen-select-more']['superfish_smallicm_' . $delta] = array( '#type' => 'textfield', '#title' => t('Include these classes in the <select> element'), '#description' => t('Comma separated') . ' (' . t('Default') . ': ' . t('empty') . ')', '#default_value' => variable_get('superfish_smallicm_' . $delta, ''), '#size' => 100, '#maxlength' => 1000, ); $form['sf-plugins']['sf-smallscreen']['sf-smallscreen-select']['sf-smallscreen-select-more']['superfish_smallich_' . $delta] = array( '#type' => 'textfield', '#title' => t('Include these classes in the <option> elements of the <select>'), '#description' => t('Comma separated') . ' (' . t('Default') . ': ' . t('empty') . ')', '#default_value' => variable_get('superfish_smallich_' . $delta, ''), '#size' => 100, '#maxlength' => 1000, ); $form['sf-plugins']['sf-supersubs'] = array( '#type' => 'fieldset', '#title' => t('Supersubs'), '#description' => t('Supersubs makes it possible to define custom widths for your menus.'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); $form['sf-plugins']['sf-supersubs']['superfish_supersubs_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Enable Supersubs for this menu.'), '#default_value' => variable_get('superfish_supersubs_' . $delta, 1), ); $form['sf-plugins']['sf-supersubs']['superfish_minwidth_' . $delta] = array( '#type' => 'textfield', '#title' => t('Minimum width'), '#description' => t('Minimum width for sub-menus, in em units.') . ' (' . t('Default') . ': 12)', '#default_value' => variable_get('superfish_minwidth_' . $delta, '12'), '#size' => 20, '#required' => TRUE, ); $form['sf-plugins']['sf-supersubs']['superfish_maxwidth_' . $delta] = array( '#type' => 'textfield', '#title' => t('Maximum width'), '#description' => t('Maximum width for sub-menus, in em units.') . ' (' . t('Default') . ': 27)', '#default_value' => variable_get('superfish_maxwidth_' . $delta, '27'), '#size' => 20, '#required' => TRUE, ); $form['sf-megamenu'] = array( '#type' => 'fieldset', '#title' => t('Multi-column sub-menus') . ' (' . t('Beta') . ')', '#collapsible' => TRUE, '#collapsed' => TRUE, ); $form['sf-megamenu']['superfish_multicolumn_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Enable multi-column sub-menus.'), '#default_value' => variable_get('superfish_multicolumn_' . $delta, 0), ); $form['sf-megamenu']['superfish_mcexclude_' . $delta] = array( '#type' => 'textfield', '#title' => t('Exclude below menu items'), '#description' => t('Enter the ID number of the parent menu item you do not want multi-column sub-menus for. (Comma separated)') . ' (' . t('Default') . ': ' . t('empty') . ')
' . t('Example') . ': 5,10,20', '#default_value' => variable_get('superfish_mcexclude_' . $delta, ''), '#size' => 50, ); $form['sf-megamenu']['superfish_mcdepth_' . $delta] = array( '#type' => 'select', '#title' => t('Start from depth'), '#description' => t('The depth of the first instance of multi-column sub-menus.') . ' (' . t('Default') . ': 1)', '#default_value' => variable_get('superfish_mcdepth_' . $delta, 1), '#options' => drupal_map_assoc(range(1, 10)), ); $form['sf-megamenu']['superfish_mclevels_' . $delta] = array( '#type' => 'select', '#title' => t('Levels'), '#description' => t('The amount of sub-menu levels that will be included in the multi-column sub-menu.') . ' (' . t('Default') . ': 1)', '#default_value' => variable_get('superfish_mclevels_' . $delta, 1), '#options' => drupal_map_assoc(range(1, 10)), ); $form['sf-advanced-html'] = array( '#type' => 'fieldset', '#title' => t('Advanced HTML settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, ); $form['sf-advanced-html']['sf-hyperlinks'] = array( '#type' => 'fieldset', '#title' => t('Hyperlinks'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); $form['sf-advanced-html']['sf-hyperlinks']['superfish_hhldescription_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Hide hyperlink descriptions ("title" attribute)') . ' (' . t('Default') . ': ' . t('disabled') . ')', '#description' => t('(Enabling this feature makes the below settings ineffective.)'), '#default_value' => variable_get('superfish_hhldescription_' . $delta, 0), ); $form['sf-advanced-html']['sf-hyperlinks']['sf-hyperlinktexts'] = array( '#type' => 'fieldset', '#title' => t('Hyperlink texts'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); $form['sf-advanced-html']['sf-hyperlinks']['sf-hyperlinktexts']['superfish_hldescription_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Insert hyperlink descriptions ("title" attribute) into hyperlink texts.'), '#default_value' => variable_get('superfish_hldescription_' . $delta, 0), ); $form['sf-advanced-html']['sf-hyperlinks']['sf-hyperlinktexts']['superfish_hldmenus_' . $delta] = array( '#type' => 'textfield', '#title' => t('Limit to below menu items'), '#description' => t('Enter menu item ID\'s. Leave empty to include all menus. (Comma separated)') . ' (' . t('Default') . ': ' . t('empty') . ')
' . t('Example') . ': 5,10,20', '#default_value' => variable_get('superfish_hldmenus_' . $delta, ''), '#size' => 50, ); $form['sf-advanced-html']['sf-hyperlinks']['sf-hyperlinktexts']['superfish_hldexclude_' . $delta] = array( '#type' => 'textfield', '#title' => t('Exclude below menu items'), '#description' => t('Enter the ID of the menu items you do not want to link descriptions for. (Comma separated)') . ' (' . t('Default') . ': ' . t('empty') . ')
' . t('Example') . ': 5,10,20', '#default_value' => variable_get('superfish_hldexclude_' . $delta, ''), '#size' => 50, ); $form['sf-advanced-html']['sf-html-wrappers'] = array( '#type' => 'fieldset', '#title' => t('HTML wrappers'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); $form['sf-advanced-html']['sf-html-wrappers']['superfish_wrapmul_' . $delta] = array( '#type' => 'textfield', '#title' => t('Around the main <UL>'), '#description' => t('Insert extra codes before and\or after the main UL. (Comma separated).') . ' (' . t('Default') . ': ' . t('empty') . ')
' . t('Examples') . ': ', '#default_value' => variable_get('superfish_wrapmul_' . $delta, ''), '#size' => 100, '#maxlength' => 1000, ); $form['sf-advanced-html']['sf-html-wrappers']['superfish_wrapul_' . $delta] = array( '#type' => 'textfield', '#title' => t('Around the <UL> content'), '#description' => t('Insert extra codes before and\or after the ULs. (Comma separated).') . ' (' . t('Default') . ': ' . t('empty') . ')
' . t('Examples') . ': ', '#default_value' => variable_get('superfish_wrapul_' . $delta, ''), '#size' => 100, '#maxlength' => 1000, ); $form['sf-advanced-html']['sf-html-wrappers']['superfish_wraphl_' . $delta] = array( '#type' => 'textfield', '#title' => t('Around the hyperlinks'), '#description' => t('Insert HTML objects before and\or after hyperlinks. (Comma separated)') . ' (' . t('Default') . ': ' . t('empty') . ')
' . t('Examples') . ': ', '#default_value' => variable_get('superfish_wraphl_' . $delta, ''), '#size' => 100, '#maxlength' => 1000, ); $form['sf-advanced-html']['sf-html-wrappers']['superfish_wraphlt_' . $delta] = array( '#type' => 'textfield', '#title' => t('Around the hyperlinks content'), '#description' => t('Insert extra codes before and\or after the text in hyperlinks. (Comma separated)') . ' (' . t('Default') . ': ' . t('empty') . ')
' . t('Examples') . ': ', '#default_value' => variable_get('superfish_wraphlt_' . $delta, ''), '#size' => 100, '#maxlength' => 1000, ); $form['sf-advanced-css'] = array( '#type' => 'fieldset', '#title' => t('Advanced CSS settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, ); $form['sf-advanced-css']['sf-helper-classes'] = array( '#type' => 'fieldset', '#title' => t('Helper classes'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); $form['sf-advanced-css']['sf-helper-classes']['superfish_firstlast_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Add first \ middle \ last classes.'), '#default_value' => variable_get('superfish_firstlast_' . $delta, 1), ); $form['sf-advanced-css']['sf-helper-classes']['superfish_zebra_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Add odd \ even classes.'), '#default_value' => variable_get('superfish_zebra_' . $delta, 1), ); $form['sf-advanced-css']['sf-helper-classes']['superfish_dfirstlast_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Do not add first \ middle \ last classes to single menu items.'), '#default_value' => variable_get('superfish_dfirstlast_' . $delta, 0), ); $form['sf-advanced-css']['sf-helper-classes']['superfish_dzebra_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Do not add odd \ even classes to single menu items.'), '#default_value' => variable_get('superfish_dzebra_' . $delta, 0), ); $form['sf-advanced-css']['sf-helper-classes']['superfish_itemcount_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Add item count class to menu items.') . '(sf-item-1, sf-item-2, sf-item-3, ...)', '#default_value' => variable_get('superfish_itemcount_' . $delta, 1), ); $form['sf-advanced-css']['sf-helper-classes']['superfish_itemcounter_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Add children counter classes to menu items.') . '(sf-total-children-7 sf-parent-children-4 sf-single-children-3, ...)', '#default_value' => variable_get('superfish_itemcounter_' . $delta, 1), ); $form['sf-advanced-css']['sf-helper-classes']['superfish_itemdepth_' . $delta] = array( '#type' => 'checkbox', '#title' => t('Add item depth class to menu items and their hyperlinks.') . '(sf-depth-1, sf-depth-2, sf-depth-3, ...)', '#default_value' => variable_get('superfish_itemdepth_' . $delta, 1), ); $form['sf-advanced-css']['sf-custom-classes'] = array( '#type' => 'fieldset', '#title' => t('Custom classes'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); $form['sf-advanced-css']['sf-custom-classes']['superfish_ulclass_' . $delta] = array( '#type' => 'textfield', '#title' => t('For the main UL'), '#description' => t('(Space separated, without dots)') . ' (' . t('Default') . ': ' . t('empty') . ')
' . t('Example') . ': top-menu category-science', '#default_value' => variable_get('superfish_ulclass_' . $delta, ''), '#size' => 50, '#maxlength' => 1000, ); $form['sf-advanced-css']['sf-custom-classes']['superfish_liclass_' . $delta] = array( '#type' => 'textfield', '#title' => t('For the list items'), '#description' => t('(Space separated, without dots)') . ' (' . t('Default') . ': ' . t('empty') . ')
' . t('Example') . ': science-sub', '#default_value' => variable_get('superfish_liclass_' . $delta, ''), '#size' => 50, '#maxlength' => 1000, ); $form['sf-advanced-css']['sf-custom-classes']['superfish_hlclass_' . $delta] = array( '#type' => 'textfield', '#title' => t('For the hyperlinks'), '#description' => t('(Space separated, without dots)') . ' (' . t('Default') . ': ' . t('empty') . ')
' . t('Example') . ': science-link', '#default_value' => variable_get('superfish_hlclass_' . $delta, ''), '#size' => 50, '#maxlength' => 1000, ); $form['sf-advanced-css']['sf-extra-css'] = array( '#type' => 'fieldset', '#title' => t('Extra CSS'), '#collapsible' => TRUE, '#collapsed' => FALSE, ); $form['sf-advanced-css']['sf-extra-css']['superfish_pathcss_' . $delta] = array( '#type' => 'textfield', '#title' => t('Path to CSS file(s)'), '#description' => t('Include extra CSS file(s). (Comma separated)') . ' (' . t('Default') . ': ' . t('empty') . ')
' . t('Examples') . ': ', '#default_value' => variable_get('superfish_pathcss_' . $delta, ''), '#size' => 100, '#maxlength' => 1000, ); return $form; } /** * Implements hook_block_save(). */ function superfish_block_save($delta = 0, $edit = array()) { variable_set('superfish_name_' . $delta, $edit['superfish_name_' . $delta]); variable_set('superfish_menu_' . $delta, $edit['superfish_menu_' . $delta]); variable_set('superfish_depth_' . $delta, $edit['superfish_depth_' . $delta]); variable_set('superfish_type_' . $delta, $edit['superfish_type_' . $delta]); variable_set('superfish_style_' . $delta, $edit['superfish_style_' . $delta]); variable_set('superfish_speed_' . $delta, $edit['superfish_speed_' . $delta]); variable_set('superfish_delay_' . $delta, $edit['superfish_delay_' . $delta]); variable_set('superfish_pathclass_' . $delta, $edit['superfish_pathclass_' . $delta]); variable_set('superfish_pathlevels_' . $delta, $edit['superfish_pathlevels_' . $delta]); variable_set('superfish_slide_' . $delta, $edit['superfish_slide_' . $delta]); variable_set('superfish_shadow_' . $delta, $edit['superfish_shadow_' . $delta]); variable_set('superfish_arrow_' . $delta, $edit['superfish_arrow_' . $delta]); variable_set('superfish_expanded_' . $delta, $edit['superfish_expanded_' . $delta]); variable_set('superfish_bgf_' . $delta, $edit['superfish_bgf_' . $delta]); variable_set('superfish_spp_' . $delta, $edit['superfish_spp_' . $delta]); variable_set('superfish_hid_' . $delta, $edit['superfish_hid_' . $delta]); variable_set('superfish_touch_' . $delta, $edit['superfish_touch_' . $delta]); variable_set('superfish_touchbp_' . $delta, $edit['superfish_touchbp_' . $delta]); variable_set('superfish_touchua_' . $delta, $edit['superfish_touchua_' . $delta]); variable_set('superfish_touchual_' . $delta, $edit['superfish_touchual_' . $delta]); variable_set('superfish_touchuam_' . $delta, $edit['superfish_touchuam_' . $delta]); variable_set('superfish_small_' . $delta, $edit['superfish_small_' . $delta]); variable_set('superfish_smallbp_' . $delta, $edit['superfish_smallbp_' . $delta]); variable_set('superfish_smallua_' . $delta, $edit['superfish_smallua_' . $delta]); variable_set('superfish_smallual_' . $delta, $edit['superfish_smallual_' . $delta]); variable_set('superfish_smalluam_' . $delta, $edit['superfish_smalluam_' . $delta]); variable_set('superfish_smallset_' . $delta, $edit['superfish_smallset_' . $delta]); variable_set('superfish_smallasa_' . $delta, $edit['superfish_smallasa_' . $delta]); variable_set('superfish_smallcmc_' . $delta, $edit['superfish_smallcmc_' . $delta]); variable_set('superfish_smallecm_' . $delta, $edit['superfish_smallecm_' . $delta]); variable_set('superfish_smallchc_' . $delta, $edit['superfish_smallchc_' . $delta]); variable_set('superfish_smallech_' . $delta, $edit['superfish_smallech_' . $delta]); variable_set('superfish_smallicm_' . $delta, $edit['superfish_smallicm_' . $delta]); variable_set('superfish_smallich_' . $delta, $edit['superfish_smallich_' . $delta]); variable_set('superfish_supersubs_' . $delta, $edit['superfish_supersubs_' . $delta]); variable_set('superfish_minwidth_' . $delta, $edit['superfish_minwidth_' . $delta]); variable_set('superfish_maxwidth_' . $delta, $edit['superfish_maxwidth_' . $delta]); variable_set('superfish_multicolumn_' . $delta, $edit['superfish_multicolumn_' . $delta]); variable_set('superfish_mcexclude_' . $delta, $edit['superfish_mcexclude_' . $delta]); variable_set('superfish_mcdepth_' . $delta, $edit['superfish_mcdepth_' . $delta]); variable_set('superfish_mclevels_' . $delta, $edit['superfish_mclevels_' . $delta]); variable_set('superfish_firstlast_' . $delta, $edit['superfish_firstlast_' . $delta]); variable_set('superfish_zebra_' . $delta, $edit['superfish_zebra_' . $delta]); variable_set('superfish_dfirstlast_' . $delta, $edit['superfish_dfirstlast_' . $delta]); variable_set('superfish_dzebra_' . $delta, $edit['superfish_dzebra_' . $delta]); variable_set('superfish_itemcount_' . $delta, $edit['superfish_itemcount_' . $delta]); variable_set('superfish_itemcounter_' . $delta, $edit['superfish_itemcounter_' . $delta]); variable_set('superfish_itemdepth_' . $delta, $edit['superfish_itemdepth_' . $delta]); variable_set('superfish_use_link_theme_' . $delta, $edit['superfish_use_link_theme_' . $delta]); variable_set('superfish_use_item_theme_' . $delta, $edit['superfish_use_item_theme_' . $delta]); variable_set('superfish_hhldescription_' . $delta, $edit['superfish_hhldescription_' . $delta]); variable_set('superfish_hldescription_' . $delta, $edit['superfish_hldescription_' . $delta]); variable_set('superfish_hldmenus_' . $delta, $edit['superfish_hldmenus_' . $delta]); variable_set('superfish_hldexclude_' . $delta, $edit['superfish_hldexclude_' . $delta]); variable_set('superfish_wrapmul_' . $delta, $edit['superfish_wrapmul_' . $delta]); variable_set('superfish_wrapul_' . $delta, $edit['superfish_wrapul_' . $delta]); variable_set('superfish_wraphl_' . $delta, $edit['superfish_wraphl_' . $delta]); variable_set('superfish_wraphlt_' . $delta, $edit['superfish_wraphlt_' . $delta]); variable_set('superfish_ulclass_' . $delta, $edit['superfish_ulclass_' . $delta]); variable_set('superfish_liclass_' . $delta, $edit['superfish_liclass_' . $delta]); variable_set('superfish_hlclass_' . $delta, $edit['superfish_hlclass_' . $delta]); variable_set('superfish_pathcss_' . $delta, $edit['superfish_pathcss_' . $delta]); return; } /** * Implements hook_block_contents(). */ function superfish_contents($delta = 0) { global $language; $block_css = $block_js = array(); list($menu_name, $mlid) = explode(':', variable_get('superfish_menu_' . $delta, 'main-menu:0')); $sfsettings = $sfoptions = $sfplugins = array(); $sfsettings['depth'] = variable_get('superfish_depth_' . $delta, '-1'); $sfsettings['type'] = variable_get('superfish_type_' . $delta, 'horizontal'); $sfsettings['style'] = variable_get('superfish_style_' . $delta, 'default'); $sfsettings['expanded'] = variable_get('superfish_expanded_' . $delta, 0); $sfsettings['firstlast'] = variable_get('superfish_firstlast_' . $delta, 1); $sfsettings['zebra'] = variable_get('superfish_zebra_' . $delta, 1); $sfsettings['dfirstlast'] = variable_get('superfish_dfirstlast_' . $delta, 0); $sfsettings['dzebra'] = variable_get('superfish_dzebra_' . $delta, 0); $sfsettings['itemcount'] = variable_get('superfish_itemcount_' . $delta, 1); $sfsettings['itemcounter'] = variable_get('superfish_itemcounter_' . $delta, 1); $sfsettings['itemdepth'] = variable_get('superfish_itemdepth' . $delta, 1); $sfsettings['ulclass'] = variable_get('superfish_ulclass_' . $delta, ''); $sfsettings['liclass'] = variable_get('superfish_liclass_' . $delta, ''); $sfsettings['hlclass'] = variable_get('superfish_hlclass_' . $delta, ''); $sfsettings['wrapmul'] = variable_get('superfish_wrapmul_' . $delta, ''); $sfsettings['wrapul'] = variable_get('superfish_wrapul_' . $delta, ''); $sfsettings['wraphl'] = variable_get('superfish_wraphl_' . $delta, ''); $sfsettings['wraphlt'] = variable_get('superfish_wraphlt_' . $delta, ''); $sfsettings['use_link_theme'] = variable_get('superfish_use_link_theme_' . $delta, 1); $sfsettings['use_item_theme'] = variable_get('superfish_use_item_theme_' . $delta, 1); $sfsettings['hidelinkdescription'] = variable_get('superfish_hhldescription_' . $delta, 0); $sfsettings['linkdescription'] = variable_get('superfish_hldescription_' . $delta, 0); $sfsettings['hldmenus'] = variable_get('superfish_hldmenus_' . $delta, ''); $sfsettings['hldmenus'] = (strpos($sfsettings['hldmenus'], ',')) ? array_remove_empty(explode(',', $sfsettings['hldmenus'])) : $sfsettings['hldmenus']; $sfsettings['hldexclude'] = variable_get('superfish_hldexclude_' . $delta, ''); $sfsettings['hldexclude'] = (strpos($sfsettings['hldexclude'], ',')) ? array_remove_empty(explode(',', $sfsettings['hldexclude'])) : $sfsettings['hldexclude']; $sfsettings['megamenu'] = variable_get('superfish_multicolumn_' . $delta, 0); $sfsettings['megamenu_depth'] = variable_get('superfish_mcdepth_' . $delta, 1); $sfsettings['megamenu_depth'] = ($sfsettings['type'] == 'navbar' && $sfsettings['megamenu_depth'] == 1) ? 2 : $sfsettings['megamenu_depth']; $sfsettings['megamenu_levels'] = variable_get('superfish_mclevels_' . $delta, 1) + $sfsettings['megamenu_depth']; $sfsettings['megamenu_exclude'] = variable_get('superfish_mcexclude_' . $delta, ''); $sfsettings['megamenu_exclude'] = (strpos($sfsettings['megamenu_exclude'], ',')) ? array_remove_empty(explode(',', $sfsettings['megamenu_exclude'])) : $sfsettings['megamenu_exclude']; $sfoptions['pathClass'] = ($sfsettings['type'] == 'navbar') ? variable_get('superfish_pathclass_' . $delta, 'active-trail') : ''; $sfoptions['pathLevels'] = (variable_get('superfish_pathlevels_' . $delta, 1) != 1) ? variable_get('superfish_pathlevels_' . $delta, 1) : ''; $sfoptions['delay'] = (variable_get('superfish_delay_' . $delta, 800) != 800) ? variable_get('superfish_delay_' . $delta, 800) : ''; $sfoptions['animation']['opacity'] = 'show'; $slide = variable_get('superfish_slide_' . $delta, 'vertical'); if (strpos($slide, '_') && superfish_library('javascript', 'jquery.easing.js', 'check')) { $slide = explode('_', $slide); switch ($slide[1]) { case 'vertical': $sfoptions['animation']['height'] = array('show', $slide[0]); break; case 'horizontal': $sfoptions['animation']['width'] = array('show', $slide[0]); break; case 'diagonal': $sfoptions['animation']['height'] = array('show', $slide[0]); $sfoptions['animation']['width'] = array('show', $slide[0]); break; } $block_js = array_merge($block_js, superfish_library('javascript', 'easing', 'add')); } else { switch ($slide) { case 'vertical': $sfoptions['animation']['height'] = 'show'; break; case 'horizontal': $sfoptions['animation']['width'] = 'show'; break; case 'diagonal': $sfoptions['animation']['height'] = 'show'; $sfoptions['animation']['width'] = 'show'; break; } } $speed = variable_get('superfish_speed_' . $delta, 'fast'); $sfoptions['speed'] = ((is_numeric($speed)) ? (int)$speed : (($speed == ('slow' || 'normal' || 'fast')) ? '\'' . $speed . '\'': '')); $sfoptions['autoArrows'] = (variable_get('superfish_arrow_' . $delta, 1) == 1) ? TRUE : FALSE; $sfoptions['dropShadows'] = (variable_get('superfish_shadow_' . $delta, 1) == 1) ? TRUE : FALSE; if (variable_get('superfish_hid_' . $delta, 1) == 1 && superfish_library('javascript', 'jquery.hoverIntent.minified.js', 'check')) { $sfoptions['disableHI'] = FALSE; $block_js = array_merge($block_js, superfish_library('javascript', 'hoverIntent', 'add')); } else { $sfoptions['disableHI'] = FALSE; } $sfoptions = array_remove_empty($sfoptions); $touchscreen = variable_get('superfish_touch_' . $delta, 0); if ($touchscreen > 0 && superfish_library('javascript', 'sftouchscreen.js', 'check')) { $block_js = array_merge($block_js, superfish_library('javascript', 'sftouchscreen', 'add')); switch ($touchscreen) { case 1 : $sfplugins['touchscreen']['mode'] = 'always_active'; break; case 2 : $sfplugins['touchscreen']['mode'] = 'window_width'; $tsbp = variable_get('superfish_touchbp_' . $delta, 768); $sfplugins['touchscreen']['breakpoint'] = ($tsbp != 768) ? (int)$tsbp : ''; break; case 3 : // Which method to use for UA detection. $tsuam = variable_get('superfish_touchuam_' . $delta, 0); $tsua = variable_get('superfish_touchua_' . $delta, 0); switch ($tsuam) { // Client-side. case 0 : switch ($tsua) { case 0 : $sfplugins['touchscreen']['mode'] = 'useragent_predefined'; break; case 1 : $sfplugins['touchscreen']['mode'] = 'useragent_custom'; $tsual = drupal_strtolower(variable_get('superfish_touchual_' . $delta, '')); if (strpos($tsual, '*')) { $tsual = str_replace('*', '|', $tsual); } $sfplugins['touchscreen']['useragent'] = $tsual; break; } break; // Server-side. case 1 : if (isset($_SERVER['HTTP_USER_AGENT'])) { $hua = drupal_strtolower($_SERVER['HTTP_USER_AGENT']); switch ($tsua) { // Use the pre-defined list of mobile UA strings. case 0 : if (preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i', $hua)) { $sfplugins['touchscreen']['mode'] = 'always_active'; } break; // Use the custom list of UA strings. case 1 : $tsual = drupal_strtolower(variable_get('superfish_touchual_' . $delta, '')); $tsuac = array(); if (strpos($tsual, '*')) { $tsual = explode('*', $tsual); foreach ($tsual as $ua) { $tsuac[] = (strpos($hua, $ua)) ? 1 : 0; } } else { $tsuac[] = (strpos($hua, $tsual)) ? 1 : 0; } if (in_array(1, $tsuac)) { $sfplugins['touchscreen']['mode'] = 'always_active'; } break; } } break; } break; } } $smallscreen = variable_get('superfish_small_' . $delta, 2); if ($smallscreen > 0 && superfish_library('javascript', 'sfsmallscreen.js', 'check') == 1) { $block_js = array_merge($block_js, superfish_library('javascript', 'sfsmallscreen', 'add')); switch ($smallscreen) { case 1 : $sfplugins['smallscreen']['mode'] = 'always_active'; break; case 2 : $sfplugins['smallscreen']['mode'] = 'window_width'; $ssbp = variable_get('superfish_smallbp_' . $delta, 768); $sfplugins['smallscreen']['breakpoint'] = ($ssbp != 768) ? (int)$ssbp : ''; break; case 3 : // Which method to use for UA detection. $ssuam = variable_get('superfish_smalluam_' . $delta, 0); $ssua = variable_get('superfish_smallua_' . $delta, 0); switch ($ssuam) { // Client-side. case 0 : switch ($ssua) { case 0 : $sfplugins['smallscreen']['mode'] = 'useragent_predefined'; break; case 1 : $sfplugins['smallscreen']['mode'] = 'useragent_custom'; $ssual = drupal_strtolower(variable_get('superfish_smallual_' . $delta, '')); if (strpos($ssual, '*')) { $ssual = str_replace('*', '|', $ssual); } $sfplugins['smallscreen']['useragent'] = $ssual; break; } break; // Server-side. case 1 : if (isset($_SERVER['HTTP_USER_AGENT'])) { $hua = drupal_strtolower($_SERVER['HTTP_USER_AGENT']); switch ($ssua) { // Use the pre-defined list of mobile UA strings. case 0 : if (preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i', $hua)) { $sfplugins['smallscreen']['mode'] = 'always_active'; } break; // Use the custom list of UA strings. case 1 : $ssual = drupal_strtolower(variable_get('superfish_smallual_' . $delta, '')); $ssuac = array(); if (strpos($ssual, '*')) { $ssual = explode('*', $ssual); foreach ($ssual as $ua) { $ssuac[] = (strpos($hua, $ua)) ? 1 : 0; } } else { $ssuac[] = (strpos($hua, $ssual)) ? 1 : 0; } if (in_array(1, $ssuac)) { $sfplugins['smallscreen']['mode'] = 'always_active'; } break; } } break; } break; } $addselected = variable_get('superfish_smallasa_' . $delta, 0); $menuclasses = variable_get('superfish_smallcmc_' . $delta, 0); $hyperlinkclasses = variable_get('superfish_smallchc_' . $delta, 0); $excludeclass_menu = variable_get('superfish_smallecm_' . $delta, ''); $excludeclass_hyperlink = variable_get('superfish_smallech_' . $delta, ''); $includeclass_menu = variable_get('superfish_smallicm_' . $delta, ''); $includeclass_hyperlink = variable_get('superfish_smallich_' . $delta, ''); $sfplugins['smallscreen']['addSelected'] = ($addselected == 1) ? TRUE : FALSE; $sfplugins['smallscreen']['menuClasses'] = ($menuclasses == 1) ? TRUE : FALSE; $sfplugins['smallscreen']['hyperlinkClasses'] = ($hyperlinkclasses == 1) ? TRUE : FALSE; if ($menuclasses == 1 && !empty($excludeclass_menu)) { $sfplugins['smallscreen']['excludeClass_menu'] = $excludeclass_menu; } if ($hyperlinkclasses == 1 && !empty($excludeclass_hyperlink)) { $sfplugins['smallscreen']['excludeClass_hyperlink'] = $excludeclass_hyperlink; } if (!empty($includeclass_menu)) { $sfplugins['smallscreen']['includeClass_menu'] = $includeclass_menu; } if (!empty($includeclass_hyperlink)) { $sfplugins['smallscreen']['includeClass_hyperlink'] = $includeclass_hyperlink; } } if (variable_get('superfish_spp_' . $delta, 1) == 1 && superfish_library('javascript', 'supposition.js', 'check')) { $sfplugins['supposition'] = TRUE; $block_js = array_merge($block_js, superfish_library('javascript', 'supposition', 'add')); } else { $sfplugins['supposition'] = FALSE; } if (variable_get('superfish_bgf_' . $delta, 0) == 1 && superfish_library('javascript', 'jquery.bgiframe.min.js', 'check')) { $sfplugins['bgiframe'] = TRUE; $block_js = array_merge($block_js, superfish_library('javascript', 'bgiframe', 'add')); } else { $sfplugins['bgiframe'] = FALSE; } if (variable_get('superfish_supersubs_' . $delta, 1) == 1 && superfish_library('javascript', 'supersubs.js', 'check')) { $sfplugins['supersubs']['minWidth'] = variable_get('superfish_minwidth_' . $delta, '12'); $sfplugins['supersubs']['maxWidth'] = variable_get('superfish_maxwidth_' . $delta, '27'); $sfplugins['supersubs']['extraWidth'] = 1; $block_js = array_merge($block_js, superfish_library('javascript', 'supersubs', 'add')); } $vars = array( 'id' => $delta, 'menu_name' => $menu_name, 'mlid' => $mlid, 'sfsettings' => $sfsettings ); if ($output = theme('superfish', $vars)) { if (!empty($output['content'])) { $output['content'] = array( '#type' => 'markup', '#markup' => filter_xss($output['content'], $allowed_tags = array('a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'command', 'datalist', 'dd', 'del', 'details', 'dfn', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'hr', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'map', 'mark', 'meter', 'nav', 'noframes', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'ul', 'var', 'video', 'wbr')), '#contextual_links' => array( 'superfish' => array('admin/structure/menu/manage', array($menu_name)), ) ); // Creating a title for the