Full ELMS Learning Network documentation
function theme_links__ctools_dropbutton
cis7 dropbutton.theme.inc | theme_links__ctools_dropbutton($vars) |
cle7 dropbutton.theme.inc | theme_links__ctools_dropbutton($vars) |
elmsmedia7 dropbutton.theme.inc | theme_links__ctools_dropbutton($vars) |
icor7 dropbutton.theme.inc | theme_links__ctools_dropbutton($vars) |
meedjum_blog7 dropbutton.theme.inc | theme_links__ctools_dropbutton($vars) |
mooc7 dropbutton.theme.inc | theme_links__ctools_dropbutton($vars) |
Create a dropbutton menu.
Parameters
$title: The text to place in the clickable area to activate the dropbutton. This text is indented to -9999px by default.
$links: A list of links to provide within the dropbutton, suitable for use in via Drupal's theme('links').
$image: If true, the dropbutton link is an image and will not get extra decorations that a text dropbutton link will.
$class: An optional class to add to the dropbutton's container div to allow you to style a single dropbutton however you like without interfering with other dropbuttons.
7 theme calls to theme_links__ctools_dropbutton()
- ctools_custom_content_ui::list_build_row in sites/
all/ modules/ ulmus/ ctools/ ctools_custom_content/ plugins/ export_ui/ ctools_custom_content_ui.class.php - Build a row based on the item.
- ctools_export_ui::list_build_row in sites/
all/ modules/ ulmus/ ctools/ plugins/ export_ui/ ctools_export_ui.class.php - Build a row based on the item.
- page_manager_get_pages in sites/
all/ modules/ ulmus/ ctools/ page_manager/ page_manager.admin.inc - Sort tasks into buckets based upon whether or not they have subtasks.
- stylizer_ui::list_build_row in sites/
all/ modules/ ulmus/ ctools/ stylizer/ plugins/ export_ui/ stylizer_ui.class.php - Build a row based on the item.
- theme_module_filter_operations in sites/
all/ modules/ ulmus/ module_filter/ module_filter.theme.inc
10 string references to the theme hook from theme_links__ctools_dropbutton()
Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.
- ctools_custom_content_ui::list_build_row in sites/
all/ modules/ ulmus/ ctools/ ctools_custom_content/ plugins/ export_ui/ ctools_custom_content_ui.class.php - Build a row based on the item.
- ctools_dropbutton_theme in sites/
all/ modules/ ulmus/ ctools/ includes/ dropbutton.theme.inc - Delegated implementation of hook_theme()
- ctools_export_ui::list_build_row in sites/
all/ modules/ ulmus/ ctools/ plugins/ export_ui/ ctools_export_ui.class.php - Build a row based on the item.
- page_manager_get_pages in sites/
all/ modules/ ulmus/ ctools/ page_manager/ page_manager.admin.inc - Sort tasks into buckets based upon whether or not they have subtasks.
- path_breadcrumbs_ui_breadcrumbs_list in sites/
all/ modules/ local_contrib/ path_breadcrumbs/ path_breadcrumbs_ui/ path_breadcrumbs_ui.admin.inc - Page callback for module settings page.
File
- sites/
all/ modules/ ulmus/ ctools/ includes/ dropbutton.theme.inc, line 72 - Provide a javascript based dropbutton menu.
Code
function theme_links__ctools_dropbutton($vars) {
// Check to see if the number of links is greater than 1;
// otherwise just treat this like a button.
if (!empty($vars['links'])) {
$is_drop_button = (count($vars['links']) > 1);
// Add needed files
if ($is_drop_button) {
ctools_add_js('dropbutton');
ctools_add_css('dropbutton');
}
static ctools_add_css('button');
// Provide a unique identifier for every button on the page.
static $id = 0;
$id++;
// Wrapping div
$class = 'ctools-no-js';
$class .= ($is_drop_button) ? ' ctools-dropbutton' : '';
$class .= ' ctools-button';
if (!empty($vars['class'])) {
$class .= ($vars['class']) ? (' ' . implode(' ', $vars['class'])) : '';
}
$output = '';
$output .= '<div class="' . $class . '" id="ctools-button-' . $id . '">';
// Add a twisty if this is a dropbutton
if ($is_drop_button) {
$vars['title'] = ($vars['title'] ? check_plain($vars['title']) : t('open'));
$output .= '<div class="ctools-link">';
if ($vars['image']) {
$output .= '<a href="#" class="ctools-twisty ctools-image">' . $vars['title'] . '</a>';
}
else {
$output .= '<a href="#" class="ctools-twisty ctools-text">' . $vars['title'] . '</a>';
}
$output .= '</div>'; // ctools-link
}
// The button content
$output .= '<div class="ctools-content">';
// Check for attributes. theme_links expects an array().
$vars['attributes'] = (!empty($vars['attributes'])) ? $vars['attributes'] : array();
// Remove the inline and links classes from links if they exist.
// These classes are added and styled by Drupal core and mess up the default
// styling of any link list.
if (!empty($vars['attributes']['class'])) {
$classes = $vars['attributes']['class'];
foreach ($classes as $key => $class) {
if ($class === 'inline' || $class === 'links') {
unset($vars['attributes']['class'][$key]);
}
}
}
// Call theme_links to render the list of links.
$output .= theme_links(array('links' => $vars['links'], 'attributes' => $vars['attributes'], 'heading' => ''));
$output .= '</div>'; // ctools-content
$output .= '</div>'; // ctools-dropbutton
return $output;
}
else {
return '';
}
}