You are here

function ctools_custom_content_type_edit_form_submit in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 plugins/content_types/custom/custom.inc \ctools_custom_content_type_edit_form_submit()

The submit form stores the data in $conf.

File

plugins/content_types/custom/custom.inc, line 393
Custom content type.

Code

function ctools_custom_content_type_edit_form_submit(&$form, &$form_state) {
  if ($form_state['settings']['custom_type'] == 'fixed') {
    _ctools_custom_content_type_edit_save($form_state['settings']['content'], $form_state);
  }
  else {
    if (!empty($form_state['values']['reusable'])) {
      $content = ctools_export_crud_new('ctools_custom_content');
      $content->name = $form_state['values']['name'];
      _ctools_custom_content_type_edit_save($content, $form_state);
      $form_state['conf']['name'] = $content->name;
    }
    else {

      // Otherwise, just save values into $conf normally.
      foreach (array_keys($form_state['plugin']['defaults']) as $key) {
        if (isset($form_state['values'][$key])) {
          $form_state['conf'][$key] = $form_state['values'][$key];
        }
      }
    }
  }
}