You are here

function picture_ckeditor_settings_submit in Picture 7

Submit handler for the picture_ckeditor_settings form. Places chosen picture groups into the variables table.

File

./picture.admin.inc, line 375
Picture - map breakpoints and image styles

Code

function picture_ckeditor_settings_submit($form, &$form_state) {
  $picture_groups = picture_mapping_load();
  $ckeditor_groups = array();

  // Loop each picture group and record the settings.
  foreach ($picture_groups as $picture_group) {
    $machine_name = $picture_group->machine_name;
    $ckeditor_groups[$machine_name]['enabled'] = $form_state['values'][$machine_name]['enabled'];
    $ckeditor_groups[$machine_name]['weight'] = $form_state['values'][$machine_name]['weight'];
    $ckeditor_groups[$machine_name]['fallback'] = $form_state['values'][$machine_name]['fallback'];
  }
  uasort($ckeditor_groups, 'picture_compare_weights');
  variable_set('picture_ckeditor_groups', $ckeditor_groups);
  variable_set('picture_ckeditor_label', $form_state['values']['ckeditor_label']);
  drupal_set_message(t('Your settings have been saved'));
}