You are here

function relation_entity_collector_remove in Relation 7

Submit handler for the remove button.

1 string reference to 'relation_entity_collector_remove'
relation_entity_collector in relation_entity_collector/relation_entity_collector.module
The entity_collector form.

File

relation_entity_collector/relation_entity_collector.module, line 421
Relation Entity Collector Block.

Code

function relation_entity_collector_remove($form, &$form_state) {
  $entity_key = $form_state['triggering_element']['#entity_key']['entity_key'];
  foreach ($_SESSION['relation_entity_keys'] as $key => $entity) {
    if ($entity['entity_key'] == $entity_key) {
      unset($_SESSION['relation_entity_keys'][$key]);
      $form_state['rebuild'] = TRUE;
      return;
    }
  }
}