You are here

entityform_block.install in Entityform block 7

File

entityform_block.install
View source
<?php

/**
 * Implements hook_uninstall().
 */
function entityform_block_uninstall() {
  variable_del('entityform_block_types');
}

/*
 * Removes orphaned blocks.
 */
function entityform_block_update_7100() {
  $entityform_types = entityform_get_types();
  $existing_block_types = variable_get('entityform_block_types');
  foreach ($existing_block_types as $type) {
    if (!array_key_exists($type, $entityform_types)) {
      $key = array_search($type, $existing_block_types);
      unset($existing_block_types[$key]);
    }
  }
  variable_set('entityform_block_types', $existing_block_types);
}