danielebarchiesi@0: .5 seconds, or can be immediately closed by danielebarchiesi@0: * clicking the link again. The code is smart enough that if the mouse danielebarchiesi@0: * moves away and then back within the .5 second window, it will not danielebarchiesi@0: * re-close. danielebarchiesi@0: * danielebarchiesi@0: * Multiple dropdowns can be placed per page. danielebarchiesi@0: * danielebarchiesi@0: * If the user does not have javascript enabled, the link will not appear, danielebarchiesi@0: * and instead by default the list of links will appear as a normal inline danielebarchiesi@0: * list. danielebarchiesi@0: * danielebarchiesi@0: * The menu is heavily styled by default, and to make it look different danielebarchiesi@0: * will require a little bit of CSS. You can apply your own class to the danielebarchiesi@0: * dropdown to help ensure that your CSS can override the dropdown's CSS. danielebarchiesi@0: * danielebarchiesi@0: * In particular, the text, link, background and border colors may need to danielebarchiesi@0: * be changed. Please see dropdown.css for information about the existing danielebarchiesi@0: * styling. danielebarchiesi@0: */ danielebarchiesi@0: danielebarchiesi@0: /** danielebarchiesi@0: * Delegated implementation of hook_theme() danielebarchiesi@0: */ danielebarchiesi@0: function ctools_dropdown_theme(&$items) { danielebarchiesi@0: $items['ctools_dropdown'] = array( danielebarchiesi@0: 'variables' => array('title' => NULL, 'links' => NULL, 'image' => FALSE, 'class' => ''), danielebarchiesi@0: 'file' => 'includes/dropdown.theme.inc', danielebarchiesi@0: ); danielebarchiesi@0: } danielebarchiesi@0: danielebarchiesi@0: /** danielebarchiesi@0: * Create a dropdown menu. danielebarchiesi@0: * danielebarchiesi@0: * @param $title danielebarchiesi@0: * The text to place in the clickable area to activate the dropdown. danielebarchiesi@0: * @param $links danielebarchiesi@0: * A list of links to provide within the dropdown, suitable for use danielebarchiesi@0: * in via Drupal's theme('links'). danielebarchiesi@0: * @param $image danielebarchiesi@0: * If true, the dropdown link is an image and will not get extra decorations danielebarchiesi@0: * that a text dropdown link will. danielebarchiesi@0: * @param $class danielebarchiesi@0: * An optional class to add to the dropdown's container div to allow you danielebarchiesi@0: * to style a single dropdown however you like without interfering with danielebarchiesi@0: * other dropdowns. danielebarchiesi@0: */ danielebarchiesi@0: function theme_ctools_dropdown($vars) { danielebarchiesi@0: // Provide a unique identifier for every dropdown on the page. danielebarchiesi@0: static $id = 0; danielebarchiesi@0: $id++; danielebarchiesi@0: danielebarchiesi@0: $class = 'ctools-dropdown-no-js ctools-dropdown' . ($vars['class'] ? (' ' . $vars['class']) : ''); danielebarchiesi@0: danielebarchiesi@0: ctools_add_js('dropdown'); danielebarchiesi@0: ctools_add_css('dropdown'); danielebarchiesi@0: danielebarchiesi@0: $output = ''; danielebarchiesi@0: danielebarchiesi@0: $output .= '