You are here

function theme_stringoverrides_strings in String Overrides 5

Same name and namespace in other branches
  1. 6 stringoverrides.admin.inc \theme_stringoverrides_strings()
  2. 7 stringoverrides.admin.inc \theme_stringoverrides_strings()

Theme the enabled box and the two text box strings

1 theme call to theme_stringoverrides_strings()
stringoverrides_admin in ./stringoverrides.admin.inc
Menu callback for the String Overrides module to display its administration

File

./stringoverrides.admin.inc, line 98
Admin page callbacks for the String Overrides module.

Code

function theme_stringoverrides_strings($form) {
  drupal_add_css(drupal_get_path('module', 'stringoverrides') . '/stringoverrides.css', 'module', NULL, FALSE);
  $headers = array(
    theme('table_select_header_cell'),
    t('Original'),
    t('Replacement'),
  );
  $rows = array();
  foreach (element_children($form) as $key) {

    // Build the table row.
    $rows[$key] = array(
      'data' => array(
        array(
          'data' => drupal_render($form[$key]['enabled']),
          'class' => 'stringoverrides-enabled',
        ),
        array(
          'data' => drupal_render($form[$key]['original']),
          'class' => 'stringoverrides-original',
        ),
        array(
          'data' => drupal_render($form[$key]['replacement']),
          'class' => 'stringoverrides-replacement',
        ),
      ),
    );

    // Add any attributes on the element to the row, such as the ahah class.
    if ($form[$key]['#attributes']) {
      $rows[$key] = array_merge($rows[$key], $form[$key]['#attributes']);
    }
  }
  $output = '';
  $output .= '<div id="stringoverrides-wrapper">';
  $output .= theme('table', $headers, $rows);
  $output .= '</div>';
  $output .= drupal_render($form);
  return $output;
}