function _customfilter_filter_add_edit_fields in Custom filter 6
Same name and namespace in other branches
- 7.2 customfilter.module \_customfilter_filter_add_edit_fields()
- 7 customfilter.module \_customfilter_filter_add_edit_fields()
2 calls to _customfilter_filter_add_edit_fields()
- customfilter_filter_add in ./
customfilter.admin.inc - Return the form to add a new filter.
- customfilter_filter_edit in ./
customfilter.admin.inc - Return the filter edit form.
File
- ./
customfilter.admin.inc, line 661 - Administration page callbacks for Custom filter.
Code
function _customfilter_filter_add_edit_fields(&$form, $item) {
$form['fid'] = array(
'#type' => 'value',
'#value' => $item['fid'],
);
$form['id'] = array(
'#type' => 'textfield',
'#title' => t('ID'),
'#description' => t('The machine-readable name of the filter. This name must contain only lowercase letters, numbers, and underscores.'),
'#default_value' => $item['id'],
'#maxlength' => 32,
'#required' => TRUE,
);
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Name'),
'#description' => t('The human-readable name of the filter. It is recommended that this name begin with a capital letter and contain only letters, numbers, and <em>spaces</em>.'),
'#default_value' => $item['name'],
'#maxlength' => 64,
'#required' => TRUE,
);
$form['cache'] = array(
'#type' => 'checkbox',
'#title' => t('Cache'),
'#description' => t('If checked, the content will be cached.'),
'#default_value' => $item['cache'],
);
$form['description'] = array(
'#type' => 'textarea',
'#title' => t('Description'),
'#description' => t('A description of the purpose of this filter.'),
'#default_value' => $item['description'],
);
$form['shorttip'] = array(
'#type' => 'textarea',
'#title' => t('Tips (short)'),
'#default_value' => $item['shorttip'],
'#rows' => 5,
);
$form['longtip'] = array(
'#type' => 'textarea',
'#title' => t('Tips (full)'),
'#default_value' => $item['longtip'],
'#rows' => 20,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);
}