You are here

function theme_strongarm_admin_form in Strongarm 6

Same name and namespace in other branches
  1. 6.2 strongarm.admin.inc \theme_strongarm_admin_form()
  2. 7.2 strongarm.admin.inc \theme_strongarm_admin_form()

Theme function for the strongarm admin form.

1 theme call to theme_strongarm_admin_form()
strongarm_admin_form in ./strongarm.admin.inc
Variable management strongarm form.

File

./strongarm.admin.inc, line 203

Code

function theme_strongarm_admin_form($form) {
  $output = '';
  $overridden = element_children($form['revert']);
  if (!empty($overridden)) {
    drupal_add_js('misc/tableselect.js');
    $rows = $headers = array();
    $output .= "<h3>" . t('Manage overridden variables') . "</h3>";

    // Add checkboxes to the header and the rows.
    $headers[] = theme('table_select_header_cell');
    $headers[] = t('Variable');
    $headers[] = t('Current value');
    $headers[] = t('Module value');
    $headers[] = t('Module');
    foreach ($overridden as $name) {
      $row = array();
      $row[] = drupal_render($form['revert'][$name]);
      $row[] = drupal_render($form['name'][$name]);
      $row[] = drupal_render($form['current_value'][$name]);
      $row[] = drupal_render($form['default_value'][$name]);
      $row[] = drupal_render($form['culprit'][$name]);
      $rows[] = $row;
    }
    $output .= theme('table', $headers, $rows);
    $output .= drupal_render($form);
  }
  return $output;
}