You are here

function _forum_access_content_access_admin_form in Forum Access 7

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

Add warnings on Content Access admin forms where CA wants to control the same content types as we do.

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

File

./forum_access.admin.inc, line 798
forum_access.admin.inc

Code

function _forum_access_content_access_admin_form($bundle) {
  $tr = 't';
  $l = 'l';
  $variables = array(
    '!Content_Access' => 'Content Access',
    '!Forum_Access' => 'Forum Access',
    '!Forum_Access_link' => $l('Forum Access', 'admin/structure/forum'),
    '%anonymous_user' => $tr('anonymous user'),
    '%authenticated_user' => $tr('authenticated user'),
    '%Advanced' => $tr('Advanced'),
  );
  $dsm = 'drupal_set_message';
  if ($bundle->type == 'forum') {
    $dsm(t('Note: In Drupal, access can only be granted, not taken away. Whatever access you grant here will not be reflected in the !Forum_Access_link settings, but !Forum_Access can only allow <i>more</i> access, not less.', $variables) . '<br /><span class="error">' . t('Specifically, any rights granted to the %anonymous_user and/or the %authenticated_user will <b>override</b> the settings of !Forum_Access!', $variables) . '</span>' . '<br />' . t('To avoid conflicts with !Forum_Access settings, you may want to lower the priority of !Content_Access (under %Advanced below) below the priority of !Forum_Access for the content types that you want to be controlled by !Forum_Access.', $variables), 'warning');
  }
  else {
    $instances = field_info_instances('node', $bundle->type);
    if (isset($instances['taxonomy_forums'])) {
      $dsm(t('Note: Nodes of this content type can be put inside forums, where access to them will also be controlled by !Forum_Access.<br />In Drupal, access can only be granted, not taken away. Whatever access you grant here will not be reflected on the !Forum_Access_link settings, and vice versa, but any node access module can only allow <i>more</i> access, not less.', $variables), 'warning');
    }
  }
}