You are here

function scald_admin_context_form_submit in Scald: Media Management made easy 7

Form submission handler for scald_admin_context_form().

File

includes/scald.admin.inc, line 352

Code

function scald_admin_context_form_submit($form, &$form_state) {
  $op = isset($form_state['values']['op']) ? $form_state['values']['op'] : '';
  if (!($context = scald_context_load($form_state['values']['name']))) {
    $context = array();
  }
  $context = array(
    'name' => $form_state['values']['name'],
    'title' => $form_state['values']['title'],
    'description' => $form_state['values']['description'],
    'render_language' => 'XHTML',
    'parseable' => (bool) $form_state['values']['parseable'],
    'formats' => array(),
  ) + $context;
  scald_context_save($context);
  cache_clear_all('*', 'cache_scald', TRUE);
  cache_clear_all('field_info_types', 'cache_field', TRUE);
  field_info_cache_clear();
  $form_state['redirect'] = 'admin/structure/scald';
}