You are here

function field_validation_manage in Field Validation 7

Menu callback function to show an overview of the existing validation rules, and the option to add a rule

1 call to field_validation_manage()
field_validation_callback_dispatch in ./field_validation.admin.inc
Menu callback function using to dispatch.

File

./field_validation.admin.inc, line 48
Manages validation rules administration UI

Code

function field_validation_manage($instance) {
  $output = '';

  //$rules = field_validation_get_field_rules($instance);
  $bundle = $instance['bundle'];
  $entity_type = $instance['entity_type'];
  $field_name = $instance['field_name'];
  ctools_include('export');
  $rules = ctools_export_load_object('field_validation_rule', 'conditions', array(
    'entity_type' => $entity_type,
    'bundle' => $bundle,
    'field_name' => $field_name,
  ));
  $output .= theme('field_validation_manage_overview', array(
    'rules' => $rules,
    'instance' => $instance,
  ));
  $output .= theme('field_validation_manage_add_rule', array(
    'instance' => $instance,
  ));
  return $output;
}