You are here

function theme_javascript_libraries_library_fieldset in JavaScript Libraries Manager 7

Returns HTML for the default libraries form.

Parameters

$variables: An associative array containing:

  • form: A render element representing the form.
1 theme call to theme_javascript_libraries_library_fieldset()
javascript_libraries_default_form in ./javascript_libraries.admin.inc
Form builder function for page callback.

File

./javascript_libraries.admin.inc, line 138
Administrative management forms for JavaScript libraries.

Code

function theme_javascript_libraries_library_fieldset($variables) {
  $form = $variables['form'];
  $rows = array();

  // Iterate through all the libraries, which are
  // children of this fieldset.
  foreach (element_children($form) as $key) {
    $library = $form[$key];
    $row = array();
    $row[] = array(
      'class' => array(
        'checkbox',
      ),
      'data' => drupal_render($library['enable']),
    );
    $label = '<label';
    if (isset($library['enable']['#id'])) {
      $label .= ' for="' . $library['enable']['#id'] . '"';
    }
    $row[] = $label . '><strong>' . drupal_render($library['name']) . '</strong></label>';
    $row[] = drupal_render($library['version']);
    $rows[] = $row;
  }
  return theme('table', array(
    'header' => $form['#header'],
    'rows' => $rows,
  ));
}