You are here

function opigno_forum_preprocess_forum_list in Opigno forum 8

Same name and namespace in other branches
  1. 3.x opigno_forum.module \opigno_forum_preprocess_forum_list()

Implements hook_preprocess_HOOK().

File

./opigno_forum.module, line 215
Contains opigno_forum.module.

Code

function opigno_forum_preprocess_forum_list(&$variables) {

  // Hide forums that current user can't access from the forum listings.
  $account = \Drupal::currentUser();
  $forums = $variables['forums'];
  foreach ($forums as $tid => $forum) {
    if (!_opigno_forum_access($tid, $account)) {
      unset($variables['forums'][$tid]);
    }
  }
}