You are here

function biblio_admin_keyword_orphans_form in Bibliography Module 6

Same name and namespace in other branches
  1. 6.2 includes/biblio.admin.inc \biblio_admin_keyword_orphans_form()
  2. 7 includes/biblio.admin.inc \biblio_admin_keyword_orphans_form()
  3. 7.2 includes/biblio.admin.inc \biblio_admin_keyword_orphans_form()
1 string reference to 'biblio_admin_keyword_orphans_form'
biblio_menu in ./biblio.module
Implementation of hook_menu().

File

./biblio.admin.inc, line 1913

Code

function biblio_admin_keyword_orphans_form($form_state) {
  $base = variable_get('biblio_base', 'biblio');
  $result = pager_query('SELECT distinct bkd.kid kid, word
                         FROM {biblio_keyword_data} bkd
                         LEFT JOIN {biblio_keyword} bk ON (bkd.kid=bk.kid)
                         WHERE bk.kid IS NULL', 50);
  $keywords = array();
  while ($keyword = db_fetch_object($result)) {
    $keywords[$keyword->kid] = '';
    $form['keyword'][$keyword->kid] = array(
      '#value' => l($keyword->word, $base . '/keyword/' . $keyword->kid . '/edit'),
    );
  }
  $form['keywords'] = array(
    '#type' => 'checkboxes',
    '#options' => $keywords,
  );
  $form['pager'] = array(
    '#value' => theme('pager', NULL, 50, 0),
  );
  $form['#theme'] = 'biblio_admin_keyword_orphans_form';
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Delete'),
    '#disabled' => !count($keywords),
    '#submit' => array(
      'biblio_admin_keyword_orphans_form_submit',
    ),
  );
  return $form;
}