You are here

function file_download_counter_block_alter in File Download 8

Implements hook_block_alter().

Removes the "popular" block from display if the module is not configured to count content views.

File

modules/file_download_counter/file_download_counter.module, line 156
Logs and displays content file_download_counter for a site.

Code

function file_download_counter_block_alter(&$definitions) {
  $file_download_counter_count_content_views = \Drupal::config('file_download_counter.settings')
    ->get('count_content_views');
  if (empty($file_download_counter_count_content_views)) {
    unset($definitions['file_download_counter_popular_block']);
  }
}