You are here

function tac_fields_admin in Taxonomy Access Control 6

Menu callback for TAC Fields admin page (admin/user/tac_fields).

1 string reference to 'tac_fields_admin'
tac_fields_menu in tac_fields/tac_fields.module
Implements hook_menu().

File

tac_fields/tac_fields.admin.inc, line 12
Administrative interface for TAC Fields.

Code

function tac_fields_admin($op = NULL, $field = NULL, $rid = NULL, $arg = NULL) {
  drupal_set_message("Warning: The TAC Fields module is experimental.  Do not use on a production site.", 'warning', FALSE);
  $roles = _taxonomy_access_user_roles();
  $controlled_fields = _tac_fields_controlled_fields();
  if ($field && in_array($field, $controlled_fields)) {
    if (is_numeric($rid) and isset($roles[$rid])) {
      switch ($op) {
        case 'edit':
          return drupal_get_form('tac_fields_admin_form', $field, $rid);
        case 'delete':
          return drupal_get_form('tac_fields_delete', $field, $rid);
      }
    }
    elseif ($op == 'delete' and !isset($rid)) {
      return drupal_get_form('tac_fields_delete', $field);
    }
  }
  elseif (!isset($op) and !isset($rid)) {
    return theme_tac_fields_admin();
  }

  // If we get here, page arguments were invalid.
  return drupal_not_found();
}