You are here

function certificate_templates_list in Certificate 6

Same name and namespace in other branches
  1. 6.2 certificate.admin.inc \certificate_templates_list()
  2. 7.2 certificate.admin.inc \certificate_templates_list()
  3. 3.x certificate.admin.inc \certificate_templates_list()
1 string reference to 'certificate_templates_list'
certificate_menu in ./certificate.module
Implementation of hook_menu().

File

./certificate.admin.inc, line 790
Administrative pages for the module.

Code

function certificate_templates_list() {
  $sql = "select * from {node} where type='certificate'";
  $result = db_query($sql);
  while ($row = db_fetch_array($result)) {
    $destination = drupal_get_destination();
    $certificates[] = array(
      'title' => $row['title'],
      'edit' => l(t('edit'), "node/{$row['nid']}/edit/{$destination}", array(
        'attributes' => array(
          'class' => 'edit-link',
        ),
      )),
      'delete' => l(t('delete'), "node/{$row['nid']}/delete/{$destination}", array(
        'attributes' => array(
          'class' => 'delete-link',
        ),
      )),
      'preview' => l(t('PDF'), "admin/settings/certificate/templates/preview/{$row['nid']}", array(
        'attributes' => array(
          'class' => 'preview-link',
        ),
      )),
    );
  }
  return theme_table(array(
    t('Title'),
    t('Edit'),
    t('Delete'),
    t('Preview'),
  ), $certificates);
}