function theme_stringoverrides_strings in String Overrides 6
Same name and namespace in other branches
- 5 stringoverrides.admin.inc \theme_stringoverrides_strings()
- 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 145 - 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);
$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 (array_key_exists('#attributes', $form[$key])) {
$rows[$key] = array_merge($rows[$key], $form[$key]['#attributes']);
}
}
$headers = array(
sizeof($rows) > 3 ? t('Enabled') : NULL,
// theme('table_select_header_cell'),
t('Original'),
t('Replacement'),
);
$output = '';
$output .= '<div id="stringoverrides-wrapper">';
$output .= theme('table', $headers, $rows);
$output .= '</div>';
$output .= drupal_render($form);
return $output;
}