You are here

function theme_ad_admin_ads in Advertisement 6.3

Same name and namespace in other branches
  1. 5.2 ad.module \theme_ad_admin_ads()
  2. 5 ad.module \theme_ad_admin_ads()
  3. 6 ad.admin.inc \theme_ad_admin_ads()
  4. 6.2 ad.admin.inc \theme_ad_admin_ads()

Theme ad administration overview.

File

./ad.admin.inc, line 170
Advertisement admin pages and functions.

Code

function theme_ad_admin_ads($form) {

  // Overview table:
  $header = array(
    theme('table_select_header_cell'),
    t('Title'),
    t('Group'),
    t('Type'),
    t('Status'),
    t('Operations'),
  );
  $output = drupal_render($form['options']);
  if (isset($form['title']) && is_array($form['title'])) {
    foreach (element_children($form['title']) as $key) {
      $row = array();
      $row[] = drupal_render($form['ads'][$key]);
      $row[] = drupal_render($form['title'][$key]);
      $row[] = drupal_render($form['group'][$key]);
      $row[] = drupal_render($form['adtype'][$key]);
      $row[] = drupal_render($form['adstatus'][$key]);
      $row[] = drupal_render($form['operations'][$key]);
      $rows[] = $row;
    }
  }
  else {
    $rows[] = array(
      array(
        'data' => t('No ads available.'),
        'colspan' => '6',
      ),
    );
  }
  $output .= theme('table', $header, $rows);
  if ($form['pager']['#value']) {
    $output .= drupal_render($form['pager']);
  }
  $output .= drupal_render($form);
  return $output;
}