You are here

function theme_fieldset_helper_toggle_all in Fieldset helper 6

Theme 'Expand all | Collapse all' links that toggle a page or selected fieldsets state.

Parameters

$selector: A jQuery selector that restricts what fieldset will be toggle by link.

Return value

Html output

2 theme calls to theme_fieldset_helper_toggle_all()
fieldset_helper_alter_theme_system_modules in ./fieldset_helper.module
Theme related function used by the included phptemplate_theme_system() to prepend 'Expand all | Collapse all' to the system modules page.
fieldset_helper_test_form in ./fieldset_helper.admin.inc
Test form for the 'Fieldset helper' module.

File

./fieldset_helper.module, line 248
Saves the collapsed state of a Drupal collapsible fieldset.

Code

function theme_fieldset_helper_toggle_all($selector = NULL, $id = NULL) {
  if (!user_access('save fieldset state')) {
    return '';
  }

  // Wrap selector string in single quotes
  if ($selector != NULL) {
    $selector = "'" . $selector . "'";
  }
  $output = '';
  $output .= '<div class="fieldset-helper-toggle-all"' . ($id != NULL ? ' id="' . $id . '"' : '') . '>';
  $output .= '<a href="javascript:Drupal.FieldsetHelper.expandFieldsets(' . $selector . ');">' . t('Expand all') . '</a>';
  $output .= ' | ';
  $output .= '<a href="javascript:Drupal.FieldsetHelper.collapseFieldsets(' . $selector . ');">' . t('Collapse all') . '</a>';
  $output .= '</div>';
  return $output;
}