You are here

function _flexslider_picture_ctools_export_ui_edit_item_form_submit in Picture 7

Same name and namespace in other branches
  1. 7.2 flexslider_picture/flexslider_picture.module \_flexslider_picture_ctools_export_ui_edit_item_form_submit()

Submit callback.

1 string reference to '_flexslider_picture_ctools_export_ui_edit_item_form_submit'
flexslider_picture_form_ctools_export_ui_edit_item_form_alter in flexslider_picture/flexslider_picture.module
Implements hook_form_FORM_ID_alter().

File

flexslider_picture/flexslider_picture.module, line 158
Picture formatter with flexslider support.

Code

function _flexslider_picture_ctools_export_ui_edit_item_form_submit($form, &$form_state) {
  $fields = array_intersect_key($form_state['values']['image_style'], drupal_map_assoc(array(
    'imagestyle_type',
    'mapping',
  )));
  $fields['flexslider_optionset'] = $form_state['values']['name'];
  $q = db_merge('flexslider_picture_optionset')
    ->key(array(
    'flexslider_optionset' => $form_state['values']['name'],
  ))
    ->fields($fields);
  $q
    ->execute();

  // Add the colorbox options into the generic options field.
  // @todo Should we move it into our own table or how likely is it that
  // flexslider itself will add colorbox support and thus add "similar" options?
  $optionset =& $form_state['optionset'];
  $optionset->options['colorboxEnabled'] = !empty($form_state['values']['image_style']['colorboxEnabled']);
  $optionset->options['colorboxImageStyle'] = !empty($form_state['values']['image_style']['colorboxImageStyle']) ? $form_state['values']['image_style']['colorboxImageStyle'] : '';
}