You are here

function theme_simple_access_profile_list in Simple Access 6.2

Same name and namespace in other branches
  1. 5.2 simple_access.module \theme_simple_access_profile_list()
  2. 7.2 simple_access.theme.inc \theme_simple_access_profile_list()

File

./simple_access.theme.inc, line 80
Provide themes for simple access administration

Code

function theme_simple_access_profile_list($form) {
  drupal_add_tabledrag('sa-profile-list', 'order', 'sibling', 'sa-profile-weight');
  $head = array(
    t('Name'),
    t('Weight'),
    t('Operations'),
  );
  $rows = array();
  foreach (element_children($form['profiles']) as $id) {
    $rows[] = array(
      'data' => array(
        array(
          'data' => drupal_render($form['profiles'][$id]['name']),
        ),
        array(
          'data' => drupal_render($form['profiles'][$id]['weight']),
        ),
        array(
          'data' => drupal_render($form['profiles'][$id]['operations']),
        ),
      ),
      'class' => 'draggable',
    );
  }
  if (empty($rows)) {
    $rows[] = array(
      array(
        'data' => t('No profiles defined'),
        'colspan' => 3,
        'align' => 'center',
      ),
    );
  }
  $output .= theme('table', $head, $rows, array(
    'id' => 'sa-profile-list',
  ));
  $output .= drupal_render($form);
  return $output;
}