You are here

function tinybrowser_flush_all_thumbnails in TinyBrowser 7

Flush all thumbnail images from the image path directory and it's subdirectories

1 string reference to 'tinybrowser_flush_all_thumbnails'
tinybrowser_settings_form in ./tinybrowser.module

File

./tinybrowser.module, line 742

Code

function tinybrowser_flush_all_thumbnails() {
  $path_image = variable_get('tinybrowser_path_image', $file_dir_path . '/images/');
  $path_image = rtrim($path_image, '/');
  $doc_root = rtrim($_SERVER['DOCUMENT_ROOT'], '/');
  $abs_path_image = $doc_root . $path_image;
  $num_deleted = _tinybrowser_recursive_thumbnail_delete($abs_path_image, 0, FALSE);
  if ($num_deleted) {
    drupal_set_message(t('Total !dcnt thumbnail images are successfully deleted', array(
      '!dcnt' => $num_deleted,
    )));
  }
  else {
    drupal_set_message(t('There were no thumbnail images to be deleted.'));
  }
  drupal_goto(TB_CONFIG_PAGE);

  // go back to the admin page
}