You are here

function simple_access_form_row in Simple Access 5.2

Same name and namespace in other branches
  1. 6.2 simple_access.module \simple_access_form_row()
  2. 7.2 simple_access.module \simple_access_form_row()
2 calls to simple_access_form_row()
simple_access_form in ./simple_access.module
simple_access_profile_form in ./simple_access.module

File

./simple_access.module, line 415
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_row($gid, $group, $access) {
  $variable = variable_get('sa_display', array(
    'view' => 1,
    'update' => 0,
    'delete' => 0,
  ));
  $priv = $group['access'] || user_access('administer nodes');
  $form = array(
    '#access' => $priv,
  );
  $form['name'] = array(
    '#value' => $group['name'],
    '#access' => $priv,
  );
  $form['sa_view'] = array(
    '#type' => 'checkbox',
    '#default_value' => $access[$gid]['sa_view'],
    '#access' => $priv && $variable['view'],
  );
  $form['sa_update'] = array(
    '#type' => 'checkbox',
    '#default_value' => $access[$gid]['sa_update'],
    '#access' => $priv && $variable['update'],
  );
  $form['sa_delete'] = array(
    '#type' => 'checkbox',
    '#default_value' => $access[$gid]['sa_delete'],
    '#access' => $priv && $variable['delete'],
  );
  return $form;
}