function theme_workbench_email_transitions_form in Workbench Email 7
Transforms the email transitions administration form into a table.
Parameters
array $variables: The form array to render into a table
Return value
output A rendered form in table structure
File
- ./
workbench_email.admin.inc, line 236 - Administrative forms for Workbench Email Module.
Code
function theme_workbench_email_transitions_form($variables) {
$form = $variables['form'];
$header = array(
t('From'),
'',
t('To'),
);
$roles = workbench_email_determine_valid_roles();
$role_names = array();
foreach ($roles as $rid => $role) {
$role_names[$rid] = ucwords($role);
$header[] = t("@role", array(
'@role' => ucwords($role),
));
}
$rows = array();
foreach (element_children($form['transitions']) as $key) {
$element =& $form['transitions'][$key];
$row = array(
'data' => array(),
);
$row['data']['from'] = drupal_render($element['from_name']);
$row['data'][] = '-->';
$row['data']['to'] = drupal_render($element['to_name']);
foreach ($roles as $rid => $role) {
$row['data'][$role] = drupal_render($element[$role]);
}
$rows[] = $row;
}
$output = theme('table', array(
'header' => $header,
'rows' => $rows,
'attributes' => array(
'class' => array(
'width-auto',
),
),
));
$output .= drupal_render_children($form);
return $output;
}