function ember_links__ctools_dropbutton

cis7 template.php ember_links__ctools_dropbutton($variables)
cle7 template.php ember_links__ctools_dropbutton($variables)
elmsmedia7 template.php ember_links__ctools_dropbutton($variables)
icor7 template.php ember_links__ctools_dropbutton($variables)
meedjum_blog7 template.php ember_links__ctools_dropbutton($variables)
mooc7 template.php ember_links__ctools_dropbutton($variables)

Overrides theme_links__ctools_dropbutton().

This override adds a wrapper div so that we can maintain appropriate vertical spacing.

File

sites/all/themes/ulmus/ember/template.php, line 127

Code

function ember_links__ctools_dropbutton($variables) {
  // Check to see if the number of links is greater than 1;
  // otherwise just treat this like a button.
  if (!empty($variables['links'])) {
    $is_drop_button = (count($variables['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($variables['class'])) {
      $class .= ($variables['class']) ? (' ' . implode(' ', $variables['class'])) : '';
    }

    $output = '';

    $output .= '<div class="' . $class . '" id="ctools-button-' . $id . '">';

    // Add a twisty if this is a dropbutton
    if ($is_drop_button) {
      $variables['title'] = ($variables['title'] ? check_plain($variables['title']) : t('open'));

      $output .= '<div class="ctools-link">';
      if ($variables['image']) {
        $output .= '<a href="#" class="ctools-twisty ctools-image">' . $variables['title'] . '</a>';
      }
      else {
        $output .= '<a href="#" class="ctools-twisty ctools-text">' . $variables['title'] . '</a>';
      }
      $output .= '</div>'; // ctools-link
    }

    // The button content
    $output .= '<div class="ctools-content">';

    // Check for attributes. theme_links expects an array().
    $variables['attributes'] = (!empty($variables['attributes'])) ? $variables['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($variables['attributes']['class'])) {
      $classes = $variables['attributes']['class'];
      foreach ($classes as $key => $class) {
        if ($class === 'inline' || $class === 'links') {
          unset($variables['attributes']['class'][$key]);
        }
      }
    }

    // Call theme_links to render the list of links.
    $output .= theme_links(array('links' => $variables['links'], 'attributes' => $variables['attributes'], 'heading' => ''));
    $output .= '</div>'; // ctools-content
    $output .= '</div>'; // ctools-dropbutton

    // Wrap the output in our container.
    $output = '<div class="ctools-dropbutton-wrapper">' . $output . '</div>';

    return $output;
  }
  else {
    return '';
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.