You are here

function ad_admin_groups_list in Advertisement 5.2

Same name and namespace in other branches
  1. 5 ad.module \ad_admin_groups_list()
  2. 6.3 ad.admin.inc \ad_admin_groups_list()
  3. 6 ad.admin.inc \ad_admin_groups_list()
  4. 6.2 ad.admin.inc \ad_admin_groups_list()
  5. 7 ad.admin.inc \ad_admin_groups_list()
1 string reference to 'ad_admin_groups_list'
ad_menu in ./ad.module
Implementation of hook_menu().

File

./ad.module, line 2048
An advertising system for Drupal powered websites.

Code

function ad_admin_groups_list() {
  _ad_check_install();
  $header = array(
    array(
      'data' => t('Name'),
      'field' => 'name',
    ),
    array(
      'data' => t('Description'),
      'field' => 'description',
    ),
    array(
      'data' => t('Options'),
    ),
  );
  $groups = taxonomy_get_tree(_ad_get_vid());
  if ($groups != array()) {
    foreach ($groups as $group) {
      $row = array();
      $row[] = $group->name;
      $row[] = $group->description;
      $row[] = l(t('edit'), "admin/content/ad/groups/{$group->tid}/edit");
      $rows[] = $row;
    }
  }
  else {
    $rows[] = array(
      array(
        'data' => t('No groups have been created.'),
        'colspan' => 3,
      ),
    );
  }
  $output = theme('table', $header, $rows);
  $output .= theme('pager', NULL, 15, 0);
  return $output;
}