You are here

function imagepicker_browse_groups_form_submit in Image Picker 5

Same name and namespace in other branches
  1. 5.2 imagepicker.module \imagepicker_browse_groups_form_submit()
  2. 6.2 imagepicker.functions.inc \imagepicker_browse_groups_form_submit()
  3. 7 imagepicker.functions.inc \imagepicker_browse_groups_form_submit()

Submit form

File

./imagepicker.module, line 1971
Enables permitted roles to upload images for insertion into configured nodes.

Code

function imagepicker_browse_groups_form_submit($form_id, $form_values) {

  // need to get the users gids
  $gids = imagepicker_get_groups();
  $gids = array_keys($gids);
  foreach ($gids as $gid) {
    $state = 0;
    if ($gid == $form_values['gid']) {
      $state = 1;
    }
    db_query("UPDATE {imagepicker_user_groups} SET state=%d WHERE gid=%d", array(
      $state,
      $gid,
    ));
  }
}