1 file.admin.inc file_type_status_confirm_submit($form, &$form_state)

Process file type status confirm submissions.

File

core/modules/file/file.admin.inc, line 419
Admin page callbacks for the File module.

Code

function file_type_status_confirm_submit($form, &$form_state) {
  $operation = $form_state['values']['operation'];
  $type = $form_state['values']['type'];
  if ($operation == 'disable') {
    $type->disabled = TRUE;
  }
  else {
    $type->disabled = FALSE;
  }
  file_type_save($type);

  $title = ($operation == 'enable') ? t('enabled') : t('disabled');
  $t_args = array('%name' => $form_state['values']['name'], '@title' => $title);
  backdrop_set_message(t('The file type %name has been @title.', $t_args));
  watchdog('file', '@title file type %name.', $t_args, WATCHDOG_NOTICE);
  $form_state['redirect'] = 'admin/structure/file-types';
}