You are here

function theme_workflow_admin_ui_view_permissions_form in Workflow 7

Theme the workflow permissions view.

File

workflow_admin_ui/workflow_admin_ui.pages.inc, line 198
Provides administrative UI for workflow. Why it's own module? Lower code footprint and better performance. Additional credit to gcassie ( http://drupal.org/user/80260 ) for the initial push to split UI out of core workflow. We're moving…

Code

function theme_workflow_admin_ui_view_permissions_form($variables) {
  $header = $variables['header'];
  $all = $variables['all'];
  $output = '';
  foreach ($all as $role => $value) {
    if (!empty($value['name'])) {
      $output .= '<h3>' . t('%role may do these transitions:', array(
        '%role' => $value['name'],
      )) . '</h3>';
    }
    if (!empty($value['transitions'])) {
      $output .= theme('table', array(
        'header' => $header,
        'rows' => $value['transitions'],
      )) . '<p></p>';
    }
    else {
      $output .= '<table><tbody><tr class="odd"><td>' . t('None') . '</td><td></tr></tbody></table><p></p>';
    }
  }
  return $output;
}