You are here

function theme_workbench_access_editor_form in Workbench Access 7

Theme the editor list form.

File

./workbench_access.admin.inc, line 725
Workbench Access admin file.

Code

function theme_workbench_access_editor_form($variables) {
  $form = $variables['form'];
  $scheme = $form['workbench_access']['#value'];
  $access_info = workbench_access_load_access_info($scheme);
  $output = '<h2>' . t('%name editors by account', array(
    '%name' => $access_info['name'],
  )) . '</h2>';
  $output .= '<p>' . t('Active editors for the %section section, as assigned by account. <a href="!url">View editors by role</a>.', array(
    '%section' => $access_info['name'],
    '!url' => url('admin/config/workbench/access/roles/' . $scheme['access_type'] . '/' . $scheme['access_id']),
  ));
  $header = array(
    t('Editor'),
    t('Actions'),
  );
  $rows = array();
  foreach (element_children($form['users']) as $key) {
    $rows[] = array(
      drupal_render($form['users'][$key]['name']),
      drupal_render($form['users'][$key]['remove']),
    );
  }
  $variables = array(
    'header' => $header,
    'rows' => $rows,
    'empty' => t('No active editors have been found.'),
  );
  $output .= theme('table', $variables);
  $output .= drupal_render_children($form);
  return $output;
}