$value) { $all[$rid]['name'] = $value; } $transitions = $workflow->getTransitions(); foreach ($transitions as $transition) { foreach ($transition->roles as $rid) { $old_state = $transition->getOldState(); $new_state = $transition->getNewState(); $all[$rid]['transitions'][] = array($old_state->label(), WORKFLOW_ADMIN_UI_ARROW, $new_state->label()); } } $header = array(t('From'), '', t('To')); $output = ''; // @todo: we should theme out the html here. foreach ($all as $rid => $value) { $role_name = !empty($value['name']) ? $value['name'] : t('deleted role !rid', array('!rid' => $rid)); $output .= '

' . t('%role may do these transitions:', array('%role' => $role_name)) . '

'; if (!empty($value['transitions'])) { $output .= theme('table', array('header' => $header, 'rows' => $value['transitions'])) . '

'; } else { $output .= '
' . t('None') . '

'; } } return $output; }