You are here

function pmpapi_permissions_set_file_entity_defaults in Public Media Platform API Integration 7

Set default group and list type for file entities.

$form array A Drupal form array

$form_state array The current state of the form

1 string reference to 'pmpapi_permissions_set_file_entity_defaults'
pmpapi_permissions_form_file_entity_file_type_form_alter in pmpapi_permissions/pmpapi_permissions.module
Implements hook_form_FORM_ID_alter() for file_entity_file_type_form().

File

pmpapi_permissions/pmpapi_permissions.module, line 103

Code

function pmpapi_permissions_set_file_entity_defaults($form, &$form_state) {
  $entity_type = 'file';
  $bundle_name = $form['#file_type']->type;
  $uname = $entity_type . '__' . $bundle_name;
  if (variable_get('pmpapi_push_' . $uname . '_profile')) {
    $group = $form_state['values']['pmpapi_permissions_default_group'];
    variable_set('pmpapi_permissions_default_group_' . $uname, $group);
  }
}