function superfish_block_configure in Superfish 7
Implements hook_block_configure().
File
- ./
superfish.module, line 69 - Enables the use of jQuery Superfish plugin for Drupal menus.
Code
function superfish_block_configure($delta = 0) {
$form = $menu_default = array();
// Integration with the Domain Access module.
if (module_exists('domain_conf')) {
$main = variable_get('menu_main_links_source');
$secondary = variable_get('menu_secondary_links_source');
if ($main) {
$menu_default['domainaccessmenu1st-' . $main . ':0'] = sprintf('%1$s: %2$s', t('Domains Access'), t('Main links'));
}
if ($secondary) {
$menu_default['domainaccessmenu2nd-' . $secondary . ':0'] = sprintf('%1$as: %2$s', t('Domains Access'), t('Secondary links'));
}
}
$menu_default += menu_parent_options(menu_get_menus(), array(
'mlid' => 0,
));
$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['superfish_cache_' . $delta] = array(
'#type' => 'select',
'#title' => t('Block cache'),
'#description' => t('What type of caching to apply to this block.'),
'#options' => array(
DRUPAL_NO_CACHE => sprintf('%1$s (%2$s)', t('None'), t('Recommended')),
DRUPAL_CACHE_PER_ROLE => t('Cache per role'),
DRUPAL_CACHE_PER_USER => t('Cache per user'),
DRUPAL_CACHE_PER_PAGE => t('Cache per page'),
DRUPAL_CACHE_GLOBAL => t('Cache globally'),
),
'#default_value' => variable_get('superfish_cache_' . $delta, DRUPAL_NO_CACHE),
);
$form['sf-settings'] = array(
'#type' => 'fieldset',
'#title' => t('Superfish settings'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['sf-settings']['superfish_menu_' . $delta] = array(
'#type' => 'select',
'#title' => t('Menu'),
'#description' => sprintf('%1$s <em>(%2$s: <Main menu>)</em>', t('The menu you want to be displayed using Superfish.'), t('Default')),
'#default_value' => variable_get('superfish_menu_' . $delta, 'main-menu:0'),
'#options' => $menu_default,
);
$form['sf-settings']['superfish_type_' . $delta] = array(
'#type' => 'radios',
'#title' => t('Type'),
'#default_value' => variable_get('superfish_type_' . $delta, 'horizontal'),
'#options' => array(
'horizontal' => sprintf('%1$s <em>(%2$s)</em>', t('Horizontal (single row)'), t('Default')),
'navbar' => t('Horizontal (double row)'),
'vertical' => t('Vertical (stack)'),
),
);
$form['sf-settings']['superfish_style_' . $delta] = array(
'#type' => 'select',
'#title' => t('Style'),
'#description' => sprintf('<em>(%1$s: %2$s)</em>', t('Default'), t('None')),
'#default_value' => variable_get('superfish_style_' . $delta, 'none'),
'#options' => superfish_styles(),
);
$form['sf-settings']['superfish_arrow_' . $delta] = array(
'#type' => 'checkbox',
'#title' => t('Add arrows to parent menus'),
'#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']['superfish_slide_' . $delta] = array(
'#type' => 'select',
'#title' => t('Slide-in effect'),
'#description' => sprintf('<em>(%1$s: %2$s)</em><br />%3$s<strong>%4$s:</strong> %5$s', t('Default'), t('Vertical'), count(superfish_effects()) === 4 ? sprintf('%1$s<br />%2$s<br />', 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']['sf-advanced'] = array(
'#type' => 'fieldset',
'#title' => t('Advanced'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['sf-settings']['sf-advanced']['sf-menu'] = array(
'#type' => 'fieldset',
'#title' => t('Menu'),
'#collapsible' => FALSE,
);
$form['sf-settings']['sf-advanced']['sf-menu']['superfish_depth_' . $delta] = array(
'#type' => 'select',
'#title' => t('Menu depth'),
'#description' => sprintf('%1$s <em>(%2$s: -1)</em>', t('The number of child levels starting with the parent selected above. <strong>-1</strong> means all of them, <strong>0</strong> means none of them.'), t('Default')),
'#default_value' => variable_get('superfish_depth_' . $delta, -1),
'#options' => drupal_map_assoc(range(-1, 50)),
);
$form['sf-settings']['sf-advanced']['sf-menu']['superfish_expanded_' . $delta] = array(
'#type' => 'checkbox',
'#title' => t('Take "Expanded" option into effect.'),
'#description' => sprintf('%1$s <em>(%2$s: %3$s)</em>', t('By enabling this option only those parent menu items which have the <em>Expanded</em> option enabled will have their sub-menus included in this menu block.'), t('Default'), t('disabled')),
'#default_value' => variable_get('superfish_expanded_' . $delta, 0),
);
$form['sf-settings']['sf-advanced']['sf-menu']['superfish_use_link_theme_' . $delta] = array(
'#type' => 'checkbox',
'#title' => sprintf('%1$s <em>(%2$s: %3$s)</em><br /><small>%4$s</small>', 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-advanced']['sf-menu']['superfish_use_item_theme_' . $delta] = array(
'#type' => 'checkbox',
'#title' => sprintf('%1$s <em>(%2$s: %3$s)</em><br /><small>%4$s</small>', 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-settings']['sf-advanced']['sf-menu']['superfish_clone_parent_' . $delta] = array(
'#type' => 'checkbox',
'#title' => sprintf('%1$s <em>(%2$s: %3$s)</em>', t('Add cloned parent links to the top of sub-menus.'), t('Default'), t('disabled')),
'#default_value' => variable_get('superfish_clone_parent_' . $delta, 0),
);
$form['sf-settings']['sf-advanced']['sf-settings'] = array(
'#type' => 'fieldset',
'#title' => t('Superfish'),
'#collapsible' => FALSE,
);
$form['sf-settings']['sf-advanced']['sf-settings']['superfish_speed_' . $delta] = array(
'#type' => 'textfield',
'#title' => t('Animation speed'),
'#description' => sprintf('%1$s <em>(%2$s: fast)</em>', t('The speed of the animation either in <strong>milliseconds</strong> or pre-defined values (<strong>slow, normal, fast</strong>).'), t('Default')),
'#default_value' => variable_get('superfish_speed_' . $delta, 'fast'),
'#size' => 15,
);
$form['sf-settings']['sf-advanced']['sf-settings']['superfish_delay_' . $delta] = array(
'#type' => 'textfield',
'#title' => t('Mouse delay'),
'#description' => sprintf('%1$s <em>(%2$s: 800)</em>', t('The delay in <strong>milliseconds</strong> that the mouse can remain outside a sub-menu without it closing.'), t('Default')),
'#default_value' => variable_get('superfish_delay_' . $delta, 800),
'#size' => 15,
);
$form['sf-settings']['sf-advanced']['sf-settings']['superfish_pathclass_' . $delta] = array(
'#type' => 'textfield',
'#title' => t('Path class'),
'#description' => sprintf('%1$s <em>(%2$s: active-trail)</em><br />%3$s', t('The class you have applied to list items that lead to the current page.'), t('Default'), t('Change this setting <strong>only and only</strong> if you are <strong>totally sure</strong> of what you are doing.')),
'#default_value' => variable_get('superfish_pathclass_' . $delta, 'active-trail'),
'#size' => 15,
);
$form['sf-settings']['sf-advanced']['sf-settings']['superfish_pathlevels_' . $delta] = array(
'#type' => 'select',
'#title' => t('Path levels'),
'#description' => sprintf('%1$s <em>(%2$s: 1)</em><br />%3$s', t('The amount of sub-menu levels that remain open or are restored using <strong>Path class</strong>.'), t('Default'), t('Change this setting <strong>only and only</strong> if you are <strong>totally sure</strong> of what you are doing.')),
'#default_value' => variable_get('superfish_pathlevels_' . $delta, 1),
'#options' => drupal_map_assoc(range(0, 10)),
);
$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' => sprintf('%1$s <em>(%2$s: %3$s)</em>%4$s', t('Helps ease the pain when having to deal with IE z-index issues.'), t('Default'), t('disabled'), !file_exists(superfish_get_path('superfish') . '/jquery.bgiframe.min.js') ? sprintf('<br /><strong>%1$s:</strong> %2$s', t('Important'), t('Cannot find the required JavaScript file, please upload jquery.bgiframe.min.js to the /libraries/superfish directory.')) : ''),
'#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.'),
'#description' => sprintf('%1$s <em>(%2$s: %3$s)</em>%4$s', t('Relocates sub-menus when they would otherwise appear outside the browser window area.'), t('Default'), t('enabled'), !file_exists(superfish_get_path('superfish') . '/supposition.js') ? sprintf('<br /><strong>%1$s:</strong> %2$s', t('Important'), t('Cannot find the required JavaScript file, please upload supposition.js to the /libraries/superfish directory.')) : ''),
'#default_value' => variable_get('superfish_spp_' . $delta, 1),
);
$form['sf-plugins']['superfish_hid_' . $delta] = array(
'#type' => 'checkbox',
'#title' => t('Enable hoverIntent detection.'),
'#description' => sprintf('%1$s <em>(%2$s: %3$s)</em>%4$s', t("Prevents accidental firing of animations by waiting until the user's mouse slows down enough, hence determinig user's <em>intent</em>."), t('Default'), t('enabled'), !file_exists(superfish_get_path('superfish') . '/jquery.hoverIntent.minified.js') ? sprintf('<br /><strong>%1$s:</strong> %2$s', t('Important'), t('Cannot find the required JavaScript file, please upload jquery.hoverIntent.minified.js to the /libraries/superfish directory.')) : ''),
'#default_value' => variable_get('superfish_hid_' . $delta, 1),
);
$form['sf-plugins']['superfish_amw_' . $delta] = array(
'#type' => 'checkbox',
'#title' => t('Use sf-AutomaticWidth plugin for this menu.'),
'#description' => sprintf('%1$s <em>(%2$s: %3$s)</em><br />%4$s%5$s', t('Automatically adjusts the menu width to maximum possible.'), t('Default'), t('disabled'), t('This is limited to Horizontal and NavBar types.'), !file_exists(superfish_get_path('superfish') . '/sfautomaticwidth.js') ? sprintf('<br /><strong>%1$s:</strong> %2$s', t('Important'), t('Cannot find the required JavaScript file, please upload sfautomaticwidth.js to the /libraries/superfish directory.')) : ''),
'#default_value' => variable_get('superfish_amw_' . $delta, 0),
);
$form['sf-plugins']['sf-touchscreen'] = array(
'#type' => 'fieldset',
'#title' => t('sf-Touchscreen'),
'#description' => sprintf('%1$s <sup>(%2$s)</sup>%3$s', t('<strong>sf-Touchscreen</strong> provides touchscreen compatibility for your menus.'), t('The first click on a parent hyperlink shows its children and the second click opens the hyperlink.'), !file_exists(superfish_get_path('superfish') . '/sftouchscreen.js') ? sprintf('<br /><strong>%1$s:</strong> %2$s', t('Important'), t('Cannot find the required JavaScript file, please upload sftouchscreen.js to the /libraries/superfish directory.')) : ''),
'#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 => sprintf('%1$s. <sup>(%2$s)</sup>', 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 <strong>window width</strong>."),
3 => t("Enable jQuery sf-Touchscreen plugin for this menu depending on the user's Web browser <strong>user agent</strong>."),
),
);
$form['sf-plugins']['sf-touchscreen']['superfish_touchbh_' . $delta] = array(
'#type' => 'radios',
'#title' => t('Select a behaviour'),
'#description' => t('Using this plugin, the first click or tap will expand the sub-menu, here you can choose what a second click or tap should do.'),
'#default_value' => variable_get('superfish_touchbh_' . $delta, 2),
'#options' => array(
0 => t('Opening the parent menu item link on the second tap.'),
1 => t('Hiding the sub-menu on the second tap.'),
2 => sprintf('%1$s <sup>(%2$s)</sup>', t('Hiding the sub-menu on the second tap, adding cloned parent links to the top of sub-menus as well.'), t('Default')),
),
);
$form['sf-plugins']['sf-touchscreen']['superfish_touchdh_' . $delta] = array(
'#type' => 'checkbox',
'#title' => t('Also disable the <em>hover</em> (mouse over) event for all its items.'),
'#default_value' => variable_get('superfish_touchdh_' . $delta, 0),
);
$form['sf-plugins']['sf-touchscreen']['sf-touchscreen-windowwidth'] = array(
'#type' => 'fieldset',
'#title' => t('Window width settings'),
'#description' => sprintf('%1$s<br /><br />%2$s<br /><code><meta name="viewport" content="width=device-width, initial-scale=1.0" /></code>', 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:')),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['sf-plugins']['sf-touchscreen']['sf-touchscreen-windowwidth']['superfish_touchbp_' . $delta] = array(
'#type' => 'textfield',
'#title' => t('Breakpoint'),
'#description' => sprintf('<em>(%1$s: 768px)</em>', t('Default')),
'#default_value' => variable_get('superfish_touchbp_' . $delta, 768),
'#size' => 10,
'#prefix' => '<div class="clearfix"></div><div class="sf-breakpoint" style="float:left;">',
'#suffix' => '</div>',
);
$form['sf-plugins']['sf-touchscreen']['sf-touchscreen-windowwidth']['superfish_touchbpu_' . $delta] = array(
'#type' => 'select',
'#title' => t('Unit'),
'#default_value' => variable_get('superfish_touchbpu_' . $delta, 'px'),
'#options' => array(
'px' => 'px',
'em' => 'em',
),
'#prefix' => '<div class="sf-breakpoint-unit" style="float:left;">',
'#suffix' => '</div><div class="clearfix"></div>',
);
$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 => sprintf('%1$s <sup>(%2$s) (%3$s)</sup>', t('Use the pre-defined list of the <strong>user agents</strong>.'), t('Default'), t('Recommended')),
1 => t('Use the custom list of the <strong>user agents</strong>.'),
),
);
$form['sf-plugins']['sf-touchscreen']['sf-touchscreen-useragent']['superfish_touchual_' . $delta] = array(
'#type' => 'textfield',
'#title' => t('Custom list of the user agents'),
'#description' => sprintf('%1$s <em>(%2$s: %3$s)</em><br />%4$s:<ul><li>iPhone*Android*iPad <sup>(%5$s)</sup></li><li>Mozilla/5.0 (webOS/1.4.0; U; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.0 * Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405</li></ul>%6$s', t('Could be partial or complete. (Asterisk separated)'), t('Default'), t('empty'), t('Examples'), t('Recommended'), isset($_SERVER['HTTP_USER_AGENT']) ? sprintf('<br />%1$s %2$s', t('<strong>UA string of the current Web browser:</strong>'), $_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('<strong>User agent</strong> detection method'),
'#description' => sprintf('<em>(%1$s: %2$s)</em>', 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'),
'#description' => sprintf('%1$s <sup>(%2$s)</sup>%3$s', t('<strong>sf-Smallscreen</strong> provides small-screen compatibility for your menus.'), t('Converts the dropdown into a <select> element.'), !file_exists(superfish_get_path('superfish') . '/sfsmallscreen.js') ? sprintf('<br /><strong>%1$s:</strong> %2$s', t('Important'), t('Cannot find the required JavaScript file, please upload sfsmallscreen.js to the /libraries/superfish directory.')) : ''),
'#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 => sprintf('%1$s.', t('Disable')),
1 => t('Enable jQuery sf-Smallscreen plugin for this menu.'),
2 => sprintf('%1$s <sup>(%2$s)</sup>', t("Enable jQuery sf-Smallscreen plugin for this menu depending on the user's Web browser <strong>window width</strong>."), t('Default')),
3 => t("Enable jQuery sf-Smallscreen plugin for this menu depending on the user's Web browser <strong>user agent</strong>."),
),
);
$form['sf-plugins']['sf-smallscreen']['sf-smallscreen-windowwidth'] = array(
'#type' => 'fieldset',
'#title' => t('Window width settings'),
'#description' => sprintf('%1$s<br /><br />%2$s<br /><code><meta name="viewport" content="width=device-width, initial-scale=1.0" /></code>', 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:')),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['sf-plugins']['sf-smallscreen']['sf-smallscreen-windowwidth']['superfish_smallbp_' . $delta] = array(
'#type' => 'textfield',
'#title' => t('Breakpoint'),
'#description' => sprintf('<em>(%1$s: 768px)</em>', t('Default')),
'#default_value' => variable_get('superfish_smallbp_' . $delta, 768),
'#size' => 10,
'#prefix' => '<div class="clearfix"></div><div class="sf-breakpoint" style="float:left;">',
'#suffix' => '</div>',
);
$form['sf-plugins']['sf-smallscreen']['sf-smallscreen-windowwidth']['superfish_smallbpu_' . $delta] = array(
'#type' => 'select',
'#title' => t('Unit'),
'#default_value' => variable_get('superfish_smallbpu_' . $delta, 'px'),
'#options' => array(
'px' => 'px',
'em' => 'em',
),
'#prefix' => '<div class="sf-breakpoint-unit" style="float:left;">',
'#suffix' => '</div><div class="clearfix"></div>',
);
$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 => sprintf('%1$s <sup>(%2$s) (%3$s)</sup>', t('Use the pre-defined list of the <strong>user agents</strong>.'), t('Default'), t('Recommended')),
1 => t('Use the custom list of the <strong>user agents</strong>.'),
),
);
$form['sf-plugins']['sf-smallscreen']['sf-smallscreen-useragent']['superfish_smallual_' . $delta] = array(
'#type' => 'textfield',
'#title' => t('Custom list of the user agents'),
'#description' => sprintf('%1$s <em>(%2$s: %3$s)</em><br />%4$s:<ul><li>iPhone*Android*iPad <sup>(%5$s)</sup></li><li>Mozilla/5.0 (webOS/1.4.0; U; en-US) AppleWebKit/532.2 (KHTML, like Gecko) Version/1.0 Safari/532.2 Pre/1.0 * Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405</li></ul>%6$s', t('Could be partial or complete. (Asterisk separated)'), t('Default'), t('empty'), t('Examples'), t('Recommended'), isset($_SERVER['HTTP_USER_AGENT']) ? sprintf('<br />%1$s %2$s', t('<strong>UA string of the current Web browser:</strong>'), $_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('<strong>User agent</strong> detection method'),
'#description' => sprintf('<em>(%1$s: %2$s)</em>', 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']['superfish_smallact_' . $delta] = array(
'#type' => 'radios',
'#title' => t('Select a reaction'),
'#default_value' => variable_get('superfish_smallact_' . $delta, 1),
'#options' => array(
0 => t('Convert the menu to a <select> element.'),
1 => t('Convert the menu to an accordion menu.') . ' <sup>(' . t('Default') . ')</sup>',
),
);
$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' => sprintf('%1$s <em>(%2$s: %3$s)</em><br />%4$s: <em> - %5$s - </em>.', 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 <em>selected</em> attribute to the <option> element with the class <strong>active</strong> .'),
'#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' => sprintf('%1$s <sup><em>(%2$s: %3$s)</em></sup>', t('Copy the main <ul> classes to the <select>.'), 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' => sprintf('%1$s <em>(%2$s: %3$s)</em>', 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' => sprintf('%1$s <sup><em>(%2$s: %3$s)</em></sup>', t('Copy the hyperlink classes to the <option> elements of the <select>.'), 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' => sprintf('%1$s <em>(%2$s: %3$s)</em>', 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' => sprintf('%1$s <em>(%2$s: %3$s)</em>', 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' => sprintf('%1$s <em>(%2$s: %3$s)</em>', t('Comma separated'), t('Default'), t('empty')),
'#default_value' => variable_get('superfish_smallich_' . $delta, ''),
'#size' => 100,
'#maxlength' => 1000,
);
$form['sf-plugins']['sf-smallscreen']['sf-smallscreen-accordion'] = array(
'#type' => 'fieldset',
'#title' => t('Accordion settings'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['sf-plugins']['sf-smallscreen']['sf-smallscreen-accordion']['superfish_smallamt_' . $delta] = array(
'#type' => 'textfield',
'#title' => t('Accordion menu title'),
'#description' => sprintf('%1$s <em>(%2$s: %3$s)</em><br />%4$s: <em>%5$s</em>.', t('By default the caption of the accordion toggle switch 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('Menu')),
'#default_value' => variable_get('superfish_smallamt_' . $delta, ''),
'#size' => 50,
'#maxlength' => 500,
);
$form['sf-plugins']['sf-smallscreen']['sf-smallscreen-accordion']['superfish_smallabt_' . $delta] = array(
'#type' => 'radios',
'#title' => t('Accordion button type'),
'#default_value' => variable_get('superfish_smallabt_' . $delta, 1),
'#options' => array(
0 => t('Use parent menu items as buttons.'),
1 => sprintf('%1$s <sup>(%2$s)</sup>', t('Use parent menu items as buttons, add cloned parent links to sub-menus as well.'), t('Default')),
2 => t('Create new links next to parent menu item links and use them as buttons.'),
),
);
$form['sf-plugins']['sf-supersubs'] = array(
'#type' => 'fieldset',
'#title' => t('Supersubs'),
'#description' => sprintf('%1$s%2$s', t('<strong>Supersubs</strong> makes it possible to define custom widths for your menus.'), !file_exists(superfish_get_path('superfish') . '/supersubs.js') ? sprintf('<br /><strong>%1$s:</strong> %2$s', t('Important'), t('Cannot find the required JavaScript file, please upload supersubs.js to the /libraries/superfish directory.')) : ''),
'#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_supersubs_emm_' . $delta] = array(
'#type' => 'checkbox',
'#title' => t('Do not use Supersubs for multi-column sub-menus.'),
'#default_value' => variable_get('superfish_supersubs_emm_' . $delta, 0),
);
$form['sf-plugins']['sf-supersubs']['superfish_minwidth_' . $delta] = array(
'#type' => 'textfield',
'#title' => t('Minimum width'),
'#description' => sprintf('%1$s <em>(%2$s: 12)</em>', t('Minimum width for sub-menus, in <strong>em</strong> units.'), t('Default')),
'#default_value' => variable_get('superfish_minwidth_' . $delta, 12),
'#size' => 10,
);
$form['sf-plugins']['sf-supersubs']['superfish_maxwidth_' . $delta] = array(
'#type' => 'textfield',
'#title' => t('Maximum width'),
'#description' => sprintf('%1$s <em>(%2$s: 27)</em>', t('Maximum width for sub-menus, in <strong>em</strong> units.'), t('Default')),
'#default_value' => variable_get('superfish_maxwidth_' . $delta, 27),
'#size' => 10,
);
$form['sf-megamenu'] = array(
'#type' => 'fieldset',
'#title' => sprintf('%1$s <sup>(%2$s)</sup>', 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' => sprintf('%1$s <em>(%2$s: %3$s)</em><br />%4$s: 5,10,20', t('Enter the ID number of the parent menu item you <strong>do not</strong> want multi-column sub-menus for. (Comma separated)'), t('Default'), t('empty'), t('Example')),
'#default_value' => variable_get('superfish_mcexclude_' . $delta, ''),
'#size' => 50,
);
$form['sf-megamenu']['superfish_mcdepth_' . $delta] = array(
'#type' => 'select',
'#title' => t('Start from depth'),
'#description' => sprintf('%1$s <em>(%2$s: 1)</em>', t('The depth of the first instance of multi-column sub-menus.'), t('Default')),
'#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' => sprintf('%1$s <em>(%2$s: 1)</em>', t('The amount of sub-menu levels that will be included in the multi-column sub-menu.'), t('Default')),
'#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' => sprintf('%1$s <em>(%2$s: %3$s)</em>', 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' => sprintf('%1$s <em>(%2$s: %3$s)</em><br />%4$s: 5,10,20', t("Enter menu item ID's. Leave empty to include all menus. (Comma separated)"), t('Default'), t('empty'), t('Example')),
'#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' => sprintf('%1$s <em>(%2$s: %3$s)</em><br />%4$s: 5,10,20', t('Enter the ID of the menu items you <strong>do not</strong> want to link descriptions for. (Comma separated)'), t('Default'), t('empty'), t('Example')),
'#default_value' => variable_get('superfish_hldexclude_' . $delta, ''),
'#size' => 50,
);
$form['sf-advanced-html']['sf-html-wrappers'] = array(
'#type' => 'fieldset',
'#title' => t('HTML wrappers'),
'#description' => t('Please consider using CSS pseudo-elements :before & :after before using the features below as improper use of them may break your drop down menu.'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['sf-advanced-html']['sf-html-wrappers']['superfish_wrapmul_' . $delta] = array(
'#type' => 'textfield',
'#title' => t('Around the main <UL>'),
'#description' => sprintf('%1$s <em>(%2$s: %3$s)</em><br />%4$s: <ul><li><h3>Discover the universe!</h3>,</li><li><h3>Hello there!</h3>,<div style="clear:both"></div></li><li>,<div style="clear:both"></div></li></ul>', t('Insert extra codes <strong>before</strong> and\\or <strong>after</strong> 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 <LI> content'),
'#description' => sprintf('%1$s <em>(%2$s: %3$s)</em><br />%4$s: <ul><li><h3>Discover the universe!</h3>,</li><li><h3>Hello there!</h3>,<div style="clear:both"></div></li><li>,<div style="clear:both"></div></li></ul>', t('Insert extra codes <strong>before</strong> and\\or <strong>after</strong> 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' => sprintf('%1$s <em>(%2$s: %3$s)</em><br />%4$s: <ul><li><span class="background-left"><span class="background-right">,</span></span></li><li><img src="example.jpg" width="24" height="24" alt="example" title="example" />,</li><li>,<span class="custom-arrow">></span></li></ul>', t('Insert HTML objects <strong>before</strong> and\\or <strong>after</strong> 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' => sprintf('%1$s <em>(%2$s: %3$s)</em><br />%4$s: <ul><li><span class="background-left"><span class="background-right">,</span></span></li><li><img src="example.jpg" width="24" height="24" alt="example" title="example" />,</li><li>,<span class="custom-arrow">></span></li></ul>', t('Insert extra codes <strong>before</strong> and\\or <strong>after</strong> 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 <strong>first \\ middle \\ last</strong> 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 <strong>odd \\ even</strong> 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 <strong>not</strong> add <strong>first \\ middle \\ last</strong> 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 <strong>not</strong> add <strong>odd \\ even</strong> 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' => sprintf('%1$s<em>(sf-item-1, sf-item-2, sf-item-3, ...)</em>', t('Add <strong>item count</strong> class to menu items.')),
'#default_value' => variable_get('superfish_itemcount_' . $delta, 1),
);
$form['sf-advanced-css']['sf-helper-classes']['superfish_itemcounter_' . $delta] = array(
'#type' => 'checkbox',
'#title' => sprintf('%1$s<em>(sf-total-children-7 sf-parent-children-4 sf-single-children-3, ...)</em>', t('Add <strong>children counter</strong> classes to menu items.')),
'#default_value' => variable_get('superfish_itemcounter_' . $delta, 1),
);
$form['sf-advanced-css']['sf-helper-classes']['superfish_itemdepth_' . $delta] = array(
'#type' => 'checkbox',
'#title' => sprintf('%1$s<em>(sf-depth-1, sf-depth-2, sf-depth-3, ...)</em>', t('Add <strong>item depth</strong> class to menu items and their hyperlinks.')),
'#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' => sprintf('%1$s <em>(%2$s: %3$s)</em><br />%4$s: top-menu category-science', t('(Space separated, without dots)'), t('Default'), t('empty'), t('Example')),
'#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' => sprintf('%1$s <em>(%2$s: %3$s)</em><br />%4$s: science-sub', t('(Space separated, without dots)'), t('Default'), t('empty'), t('Example')),
'#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' => sprintf('%1$s <em>(%2$s: %3$s)</em><br />%4$s: science-link', t('(Space separated, without dots)'), t('Default'), t('empty'), t('Example')),
'#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' => sprintf('%1$s <em>(%2$s: %3$s)</em><br />%4$s: <ul><li>sites/all/files/example.css</li><li>sites/all/files/example.css,sites/all/files/example2.css</li></ul>', 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;
}