You are here

function simple_access_form_alter in Simple Access 6.2

Same name and namespace in other branches
  1. 5.2 simple_access.module \simple_access_form_alter()
  2. 5 simple_access.module \simple_access_form_alter()

File

./simple_access.module, line 319
This module allows administrators to make nodes viewable by specific 'access groups'. Each access group can contain any number of roles. If a node is not assigned to any access groups, it will remain viewable by all users.

Code

function simple_access_form_alter(&$form, &$form_state, $form_id) {

  // if this is a node form...
  if (isset($form['type']['#value']) && $form['type']['#value'] . '_node_form' == $form_id) {
    if ($simple_access_form = simple_access_form($form['#node'])) {
      $form = array_merge($form, $simple_access_form);
      if (module_exists('vertical_tabs')) {
        $form['sa']['#group'] = 'additional_settings';
        $form['sa']['#attached']['js']['vertical-tabs'] = drupal_get_path('module', 'simple_access') . '/simple_access.js';
      }
    }
  }
}