You are here

function theme_support_page_form in Support Ticketing System 7

Same name and namespace in other branches
  1. 6 support.module \theme_support_page_form()

Theme function for ticket list

File

./support.module, line 3478
support.module

Code

function theme_support_page_form($variables) {
  $form = $variables['form'];
  drupal_add_css(drupal_get_path('module', 'support') . '/support-tickets.css');
  $output = drupal_render($form['post-ticket']);
  if (isset($form['title']) && is_array($form['title'])) {
    foreach (element_children($form['title']) as $key) {
      $row = array();
      $row[] = drupal_render($form['tickets'][$key]);
      $row[] = drupal_render($form['id'][$key]);
      $row[] = drupal_render($form['title'][$key]);
      $row[] = drupal_render($form['updated'][$key]);
      $row[] = drupal_render($form['reported'][$key]);
      $row[] = drupal_render($form['assigned']["assigned-{$key}"]);
      $row[] = drupal_render($form['state']["state-{$key}"]);
      $row[] = drupal_render($form['priority']["priority-{$key}"]);
      $row[] = drupal_render($form['updates'][$key]);
      $rows[] = array(
        'data' => $row,
        'class' => $form['class'][$key]['#value'],
      );
      unset($form['class'][$key]);
    }
  }
  else {
    $rows[] = array(
      array(
        'data' => t('No tickets available.'),
        'colspan' => '9',
      ),
    );
  }
  if ($form['pager']['#markup']) {
    $output .= drupal_render($form['pager']);
  }
  $output .= theme('table', array(
    'header' => $form['header']['#value'],
    'rows' => $rows,
    'attributes' => array(
      'class' => array(
        'support',
      ),
    ),
  ));
  $output .= drupal_render($form['update']);
  $output .= drupal_render($form['suppress']);
  $output .= drupal_render($form['submit']);
  $output .= drupal_render_children($form);
  return $output;
}