You are here

public function ctools_custom_content_ui::edit_form_submit in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 ctools_custom_content/plugins/export_ui/ctools_custom_content_ui.class.php \ctools_custom_content_ui::edit_form_submit()

Handle the submission of the edit form.

At this point, submission is successful. Our only responsibility is to copy anything out of values onto the item that we are able to edit.

If the keys all match up to the schema, this method will not need to be overridden.

Overrides ctools_export_ui::edit_form_submit

File

ctools_custom_content/plugins/export_ui/ctools_custom_content_ui.class.php, line 57

Class

ctools_custom_content_ui

Code

public function edit_form_submit(&$form, &$form_state) {
  parent::edit_form_submit($form, $form_state);

  // Since items in our settings are not in the schema, we have to do these manually:
  $form_state['item']->settings['title'] = $form_state['values']['title'];
  $form_state['item']->settings['title_heading'] = $form_state['values']['title_heading'];
  $form_state['item']->settings['body'] = $form_state['values']['body']['value'];
  $form_state['item']->settings['format'] = $form_state['values']['body']['format'];
  $form_state['item']->settings['substitute'] = $form_state['values']['substitute'];
}