function customfilter_filter_add in Custom filter 6
Same name and namespace in other branches
- 7.2 customfilter.module \customfilter_filter_add()
- 7 customfilter.module \customfilter_filter_add()
Return the form to add a new filter.
1 string reference to 'customfilter_filter_add'
- customfilter_menu in ./
customfilter.module - Implements hook_menu().
File
- ./
customfilter.admin.inc, line 114 - Administration page callbacks for Custom filter.
Code
function customfilter_filter_add() {
$fid = (int) db_result(db_query("SELECT MAX(fid) FROM {customfilter_filter}")) + 1;
if ($fid > 128) {
drupal_set_message(t('It is not possible to add further filters; the limit of 128 filters has been reached.'), 'error');
return $form;
}
$item = array(
'fid' => $fid,
'id' => "filter_{$fid}",
'name' => t('Filter #!fid', array(
'!fid' => $fid,
)),
'cache' => 1,
'description' => '',
'shorttip' => '',
'longtip' => '',
);
_customfilter_filter_add_edit_fields($form, $item);
return $form;
}