You are here

function customfilter_filter_edit in Custom filter 7

Same name and namespace in other branches
  1. 5 customfilter.module \customfilter_filter_edit()
  2. 6 customfilter.admin.inc \customfilter_filter_edit()
  3. 7.2 customfilter.module \customfilter_filter_edit()

Return the filter edit form.

Create the form used in admin/config/content/customfilter/%/edit

1 string reference to 'customfilter_filter_edit'
customfilter_menu in ./customfilter.module
Implements hook_menu().

File

./customfilter.module, line 840
Allows the users with the right permission to define custom filters.

Code

function customfilter_filter_edit($vars, $form_state, $fid) {
  $form = array();
  $filters = _customfilter_get_filters();
  $item = $filters[$fid];
  _customfilter_breadcrumb();
  if (!$fid || !isset($filters[$fid])) {
    drupal_set_message(t('The filter data have not been found, or the menu callback received a wrong parameter.'), 'error');
    watchdog('customfilter', 'The filter data have not been found, or the menu callback received a wrong parameter.', NULL, WATCHDOG_ERROR);
    return $form;
  }
  _customfilter_filter_add_edit_fields($form, $item);
  return $form;
}