function properties_widget_remove_attribute in Dynamic properties 7
Submit callback to remove a single attribute.
1 string reference to 'properties_widget_remove_attribute'
- properties_field_widget_form in ./
properties.module - Implements hook_field_widget_form().
File
- ./
properties.module, line 674 - This module provides a dynamic property field that can contain an unlimited number of attribute value pairs.
Code
function properties_widget_remove_attribute($form, &$form_state) {
$field_name = $form_state['triggering_element']['#parents'][0];
$langcode = $form[$field_name]['#language'];
$values = $form_state['values'][$field_name][$langcode];
// @todo: Verify that this always works.
$category_name = $form_state['triggering_element']['#parents'][3];
$attribute_name = $form_state['triggering_element']['#parents'][5];
unset($form_state[$field_name]['categories'][$category_name]['properties'][$attribute_name]);
$form_state['rebuild'] = TRUE;
}