You are here

function theme_certificate_history_form in Certificate 4.x

Same name and namespace in other branches
  1. 8.3 certificate.admin.inc \theme_certificate_history_form()
  2. 6.2 certificate.admin.inc \theme_certificate_history_form()
  3. 6 certificate.admin.inc \theme_certificate_history_form()
  4. 7.3 certificate.admin.inc \theme_certificate_history_form()
  5. 7.2 certificate.admin.inc \theme_certificate_history_form()
  6. 3.x certificate.admin.inc \theme_certificate_history_form()

Theme the form as a table.

File

./certificate.admin.inc, line 11
Administrative pages for Certificate module.

Code

function theme_certificate_history_form($form) {

  // TODO: Should this theme certificate_history_form be declared in hook_theme()?
  $rows = array();
  $header = array(
    t('User'),
    t('Course'),
    t('Operations'),
  );
  $rows = array(
    // Simple row
    array(
      'Fred Flintstone',
      'Course 101',
      'View | Edit | Email',
    ),
    array(
      'Fred Flintstone',
      'Course 102',
      'View | Edit | Email',
    ),
    array(
      'Joan Smith',
      'Course 102',
      'View | Edit | Email',
    ),
  );
  $caption = t('');
  $output = theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => array(
      'id' => 'certificates-history',
    ),
    'caption' => $caption,
  ));
  $output .= \Drupal::service('renderer')
    ->render($form);
  return $output;
}