You are here

function imagecache_external_flush_form_submit in Imagecache External 7

Same name and namespace in other branches
  1. 6.2 imagecache_external.admin.inc \imagecache_external_flush_form_submit()
  2. 6 imagecache_external.admin.inc \imagecache_external_flush_form_submit()
  3. 7.2 imagecache_external.admin.inc \imagecache_external_flush_form_submit()

Submit handler

File

./imagecache_external.admin.inc, line 51

Code

function imagecache_external_flush_form_submit($form, &$form_state) {
  $scheme = file_default_scheme();
  $wrapper = file_stream_wrapper_get_instance_by_scheme($scheme);
  $path = realpath($wrapper
    ->getDirectoryPath() . '/imagecache');
  if (is_dir($path)) {
    file_unmanaged_delete_recursive($path);
    drupal_set_message(t('Flushed external images'));
    $form_state['redirect'] = 'admin/config/media/imagecache_external';
  }
}