function certificate_admin_clear_form in Certificate 6
Same name and namespace in other branches
- 8.3 certificate.admin.inc \certificate_admin_clear_form()
- 6.2 certificate.admin.inc \certificate_admin_clear_form()
- 7.2 certificate.admin.inc \certificate_admin_clear_form()
- 4.x certificate.admin.inc \certificate_admin_clear_form()
- 3.x certificate.admin.inc \certificate_admin_clear_form()
Form to clear certificate snapshots.
1 string reference to 'certificate_admin_clear_form'
- certificate_menu in ./
certificate.module - Implementation of hook_menu().
File
- ./
certificate.admin.inc, line 835 - Administrative pages for the module.
Code
function certificate_admin_clear_form() {
$form = array();
$header = array(
array(),
array(
'data' => 'Title',
'field' => 'n.title',
),
array(
'data' => 'Count',
'field' => 'count',
),
);
$sql = "select *, count(cs.uid) as count from {certificate_snapshots} cs\n left join {node} n on (cs.nid = n.nid)\n group by cs.nid";
$sql .= tablesort_sql($header);
$result = db_query($sql);
while ($row = db_fetch_object($result)) {
$nids[$row->nid] = '';
$form['cs']['title'][$row->nid]['#value'] = $row->title;
$form['cs']['count'][$row->nid]['#value'] = $row->count;
}
$form['cs']['nids'] = array(
'#type' => 'checkboxes',
'#options' => $nids,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Clear',
);
return $form;
}