You are here

function site_verify_list in Site verification 6

Same name and namespace in other branches
  1. 7.2 site_verify.admin.inc \site_verify_list()
  2. 7 site_verify.admin.inc \site_verify_list()
1 string reference to 'site_verify_list'
site_verify_menu in ./site_verify.module
Implements hook_menu().

File

./site_verify.admin.inc, line 3

Code

function site_verify_list() {
  $engines = site_verify_get_engines();
  $headers = array(
    t('Engine'),
    t('Meta tag'),
    t('File'),
    array(
      'data' => t('Operations'),
      'colspan' => 2,
    ),
  );
  $rows = array();
  $query = db_query("SELECT svid, engine, file, meta FROM {site_verify}");
  while ($record = db_fetch_object($query)) {
    $row_key = $engines[$record->engine]['key'] . $record->svid;
    $rows[$row_key] = array(
      $engines[$record->engine]['name'],
      $record->meta ? '<span title="' . check_plain(truncate_utf8($record->meta, 48)) . '">' . t('Yes') . '</spam>' : t('No'),
      $record->file ? l($record->file, $record->file) : t('None'),
      l(t('Edit'), "admin/build/site-verify/{$record->svid}/edit"),
      l(t('Delete'), "admin/build/site-verify/{$record->svid}/delete"),
    );
  }
  ksort($rows);
  if (!$rows) {
    $rows[] = array(
      array(
        'data' => t('No verifications available. <a href="@add">Add verification</a>.', array(
          '@add' => url('admin/build/site-verify/add'),
        )),
        'colspan' => 5,
      ),
    );
  }
  $output = theme('table', $headers, $rows);
  return $output;
}