You are here

function theme_workbench_moderation_admin_transitions_form in Workbench Moderation 7.3

Same name and namespace in other branches
  1. 7 workbench_moderation.admin.inc \theme_workbench_moderation_admin_transitions_form()

Transforms the transitions administration form into a table.

File

./workbench_moderation.admin.inc, line 239
Administrative functions for Workbench Moderation.

Code

function theme_workbench_moderation_admin_transitions_form($variables) {
  $form = $variables['form'];
  $header = array(
    t('Name'),
    t('From'),
    '',
    t('To'),
    array(
      'data' => t('Delete'),
      'class' => array(
        'checkbox',
      ),
    ),
  );
  $rows = array();
  foreach (element_children($form['transitions']) as $key) {
    $element =& $form['transitions'][$key];
    $row = array(
      'data' => array(),
    );
    $row['data']['name'] = drupal_render($element['name']);
    $row['data']['from'] = drupal_render($element['from_name']);
    $row['data'][] = '-->';
    $row['data']['to'] = drupal_render($element['to_name']);
    $row['data']['delete'] = drupal_render($element['delete']);
    $rows[] = $row;
  }

  // @TODO: change this css call.
  drupal_add_css(drupal_get_path('module', 'workbench_moderation') . '/css/workbench_moderation.css');
  $output = theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => array(
      'class' => array(
        'width-auto',
      ),
    ),
  ));
  $output .= drupal_render_children($form);
  return $output;
}