function theme_workbench_email_form in Workbench Email 7.3
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 267 - Administrative forms for Workbench Email Module.
Code
function theme_workbench_email_form($variables) {
$form = $variables['form'];
$header = array(
t('From'),
'',
t('To'),
);
$roles = workbench_email_determine_valid_roles();
foreach ($roles as $rid => $role) {
if ($rid == WORKBENCH_EMAIL_AUTHOR) {
$role = 'Original Author';
}
$header[] = t("@role", array(
'@role' => ucwords($role),
));
}
$rows = array();
foreach (element_children($form['transitions']) as $key) {
$element =& $form['transitions'][$key];
if (!isset($element['#markup'])) {
$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) {
$data = drupal_render($element[$role]['notify']);
$data .= drupal_render($element[$role]['auto_notify']);
$row['data'][$role] = $data;
}
$rows[] = $row;
}
}
$table = theme('table', array(
'header' => $header,
'rows' => $rows,
'attributes' => array(
'class' => array(
'width-auto',
),
'id' => array(
'workbench-email-table',
),
),
));
$form['transitions_container']['#value'] = $table;
$output = drupal_render_children($form);
return $output;
}