function spam_admin_filters in Spam 6
Same name and namespace in other branches
- 5.3 spam.module \spam_admin_filters()
1 string reference to 'spam_admin_filters'
- spam_admin_filter_overview in ./
spam.module - Spam filter overview page. Allows enabling/disabling, ordering, and tuning of individual filters.
File
- ./
spam.module, line 699 - Spam module, v3 Copyright(c) 2006-2008 Jeremy Andrews <jeremy@tag1consulting.com>. All rights reserved.
Code
function spam_admin_filters() {
$result = pager_query('SELECT fid, name, status, weight, gain FROM {spam_filters} ORDER BY weight ASC', 50, 0, NULL, 0);
$counter = 0;
while ($filter = db_fetch_object($result)) {
$form['status']["status-{$counter}"] = array(
'#type' => 'checkbox',
'#default_value' => $filter->status,
);
$form['name'][$counter] = array(
'#value' => $filter->name,
);
$form['gain']["gain-{$counter}"] = array(
'#type' => 'select',
'#options' => drupal_map_assoc(spam_range(0, 250, 10)),
'#default_value' => $filter->gain,
);
$form['weight']["weight-{$counter}"] = array(
'#type' => 'weight',
'#default_value' => $filter->weight,
);
$form['fid']["fid-{$counter}"] = array(
'#type' => 'hidden',
'#value' => $filter->fid,
);
$counter++;
}
$form['pager'] = array(
'#value' => theme('pager', NULL, 50, 0),
);
$form['counter'] = array(
'#type' => 'hidden',
'#value' => $counter,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Update filters'),
);
return $form;
}