You are here

function fancy_file_delete_enable in Fancy File Delete 7

Same name and namespace in other branches
  1. 8 fancy_file_delete.install \fancy_file_delete_enable()

Implements hook_enable().

File

./fancy_file_delete.install, line 60
Install File for Fancy File Delete.

Code

function fancy_file_delete_enable() {

  // Find the full_html format or use another
  $result = db_select('filter_format', 'f')
    ->fields('f', array(
    'format',
  ))
    ->condition('name', '%' . db_like('html') . '%', 'LIKE')
    ->execute()
    ->fetchCol();

  // Apply html variable.
  $format = isset($result[0]) ? $result[0] : 'full_html';
  variable_set('fancy_file_delete_format', $format);

  // So the hook_menu items in views shows up.
  drupal_flush_all_caches();
}