You are here

function tinybrowser_admin_submit in TinyBrowser 7

Submit admin form

1 string reference to 'tinybrowser_admin_submit'
tinybrowser_settings_form in ./tinybrowser.module

File

./tinybrowser.module, line 679

Code

function tinybrowser_admin_submit($form, &$form_state) {
  $roles = $form_state['values']['roles'];
  if (count($roles) >= 2) {
    uasort($roles, 'tinybrowser_rolesort');
  }
  variable_set('tinybrowser_roles_profiles', $roles);
  variable_set('tinybrowser_editor', $form_state['values']['tinybrowser_editor']);
  variable_set('tinybrowser_ok_ext_image', $form_state['values']['tinybrowser_ok_ext_image']);
  variable_set('tinybrowser_ok_ext_media', $form_state['values']['tinybrowser_ok_ext_media']);
  variable_set('tinybrowser_prohibited_ext', $form_state['values']['tinybrowser_prohibited_ext']);
  variable_set('tinybrowser_textarea', $form_state['values']['tinybrowser_textarea']);
  variable_set('tinybrowser_absolute_url', $form_state['values']['tinybrowser_absolute_url']);
  variable_set('tinybrowser_upload_mode', $form_state['values']['tinybrowser_upload_mode']);
  variable_set('tinybrowser_thumbnail_size', $form_state['values']['tinybrowser_thumbnail_size']);
  variable_set('tinybrowser_default_view', $form_state['values']['tinybrowser_default_view']);
  variable_set('tinybrowser_default_sort', $form_state['values']['tinybrowser_default_sort']);
  variable_set('tinybrowser_pagination', $form_state['values']['tinybrowser_pagination']);
  variable_set('tinybrowser_popup_window_size', $form_state['values']['tinybrowser_popup_window_size']);
  variable_set('tinybrowser_max_crop_window_size', $form_state['values']['tinybrowser_max_crop_window_size']);
  drupal_set_message(t('The changes has been saved.'));
  drupal_goto(TB_CONFIG_PAGE);

  // go back to the admin page
}