You are here

function regcode_roles_get_list_markup in Registration codes 6.2

Same name and namespace in other branches
  1. 6 regcode_roles/regcode_roles.module \regcode_roles_get_list_markup()
  2. 7.2 regcode_roles/regcode_roles.module \regcode_roles_get_list_markup()
  3. 7 regcode_roles/regcode_roles.module \regcode_roles_get_list_markup()

Return the formatted HTML list

1 call to regcode_roles_get_list_markup()
regcode_roles_admin in regcode_roles/regcode_roles.module
Admin page for role assignment

File

regcode_roles/regcode_roles.module, line 119

Code

function regcode_roles_get_list_markup() {
  $headings = array(
    t('Rule #'),
    t('Tag'),
    t('Role'),
    t('Role ID'),
  );

  // Display expire rules
  if (module_exists('role_expire')) {
    $headings[] = t('Expire duration');
    $headings[] = t('Expire date');
  }
  $headings[] = t('Actions');
  $rows = regcode_roles_get_rules();

  // Add actions
  foreach ($rows as &$row) {
    $row = array_map('check_plain', $row);
    if (!empty($row['expire_date'])) {
      $row['expire_date'] = format_date($row['expire_date'], 'small');
    }
    $row['action'] = l('Remove', 'admin/user/regcode/roles/delete/' . $row['id'], array(
      'query' => array(
        'token' => drupal_get_token($row['id']),
      ),
    ));
  }
  return theme('table', $headings, $rows);
}