You are here

function _forum_access_forum_overview in Forum Access 7

Same name and namespace in other branches
  1. 6 forum_access.admin.inc \_forum_access_forum_overview()

Remove unusable 'edit' links from overview form.

1 call to _forum_access_forum_overview()
forum_access_form_alter in ./forum_access.module
Implements hook_form_alter().

File

./forum_access.admin.inc, line 779
forum_access.admin.inc

Code

function _forum_access_forum_overview(&$form, &$form_state) {
  global $user;
  if (user_access('bypass node access', $user)) {
    return;
  }
  foreach ($form as $key => $value) {
    if (preg_match('#^tid:(.*):0$#', $key, $matches)) {
      if (!forum_access_access('view', $matches[1], NULL, FALSE)) {
        $form[$key]['edit']['#access'] = FALSE;
        $form[$key]['view'] = array(
          '#markup' => $form[$key]['view']['#title'],
        );
      }
    }
  }
}