You are here

function google_adwords_path_admin_page in Google AdWords Conversion Tracking 7.2

Same name and namespace in other branches
  1. 8 modules/google_adwords_path/google_adwords_path.admin.inc \google_adwords_path_admin_page()

Admin page listing down all Google Adwords Path conversion codes.

1 string reference to 'google_adwords_path_admin_page'
google_adwords_path_menu in modules/google_adwords_path/google_adwords_path.module
Implements hook_menu().

File

modules/google_adwords_path/google_adwords_path.admin.inc, line 11
Admin page for Google Adwords Path.

Code

function google_adwords_path_admin_page() {
  $codes = google_adwords_path_get_all_codes();
  $header = array(
    t('No'),
    t('Name'),
    t('Conversion ID'),
    t('Language'),
    t('Format'),
    t('Color'),
    t('Label'),
    t('Operations'),
  );
  $rows = array();
  $count = 1;
  foreach ($codes as $code) {
    $rows[] = array(
      array(
        'data' => $count,
      ),
      array(
        'data' => $code['name'],
      ),
      array(
        'data' => $code['conversion_id'],
      ),
      array(
        'data' => $code['conversion_language'],
      ),
      array(
        'data' => $code['conversion_format'],
      ),
      array(
        'data' => $code['conversion_color'],
      ),
      array(
        'data' => $code['conversion_label'],
      ),
      array(
        'data' => l(t('edit'), 'admin/config/system/google_adwords/path/' . $code['cid'] . '/edit') . ' ' . l(t('delete'), 'admin/config/system/google_adwords/path/' . $code['cid'] . '/delete'),
      ),
    );
    $count++;
  }
  if ($rows) {
    return theme('table', array(
      'header' => $header,
      'rows' => $rows,
    ));
  }
  else {
    return '<p>' . t('No conversion code yet. !add_link?', array(
      '!add_link' => l(t('Add one'), 'admin/config/system/google_adwords/path/add'),
    )) . '</p>';
  }
}