You are here

function avatar_selection_edit_form_submit in Avatar Selection 5

Same name and namespace in other branches
  1. 5.2 avatar_selection.module \avatar_selection_edit_form_submit()

File

./avatar_selection.module, line 628

Code

function avatar_selection_edit_form_submit($form_id, $form_values) {
  $op = $form_values['op'];
  if ($op == t('Update')) {
    $access = implode(', ', array_keys(array_filter($form_values['access'])));
    if (module_exists("og")) {
      $og = implode(', ', array_keys(array_filter($form_values['og_access'])));
    }
    _avatar_selection_save_avatar_info($form_values['select_avatar'], $access, $og);
    drupal_set_message(t('Image updated.'));
  }
  else {
    if ($op == t('Delete')) {
      $image = $form_values['select_avatar'];
      avatar_selection_image_delete($image);
    }
  }
}