You are here

function galleria_form_optionset_edit_submit_delete in Galleria 7

Submit handler for 'Delete' buttons; Delete an option from the set.

1 string reference to 'galleria_form_optionset_edit_submit_delete'
galleria_form_optionset_edit in includes/galleria.admin.inc
Form builder; Form to edit a given option set.

File

includes/galleria.admin.inc, line 804
Administrative page callbacks for the galleria module.

Code

function galleria_form_optionset_edit_submit_delete($form, &$form_state) {
  $optionset =& $form_state['optionset'];
  $rowindex = $form_state['triggering_element']['#parents'][1];
  $option = $form['options'][$rowindex]['value']['#option_name'];
  unset($optionset->options[$option]);
  drupal_set_message(t('Option %name removed.', array(
    '%name' => $option,
  )));
  $form_state['rebuild'] = TRUE;
}