You are here

function view_custom_table_edit_custom_table_form_submit in Views Custom Table 7

Submit handler of view_custom_table_edit_custom_table_form()

File

./view_custom_table.admin.inc, line 246
File for administrative functions.

Code

function view_custom_table_edit_custom_table_form_submit($form, &$form_state) {
  $query = db_update('custom_table_view_data')
    ->fields(array(
    'description' => $form_state['values']['table_description'],
  ))
    ->condition('table_name', $form_state['values']['table_name']);
  $result = $query
    ->execute();
  if ($result) {
    drupal_set_message(t('@table_name has been updated.', array(
      '@table_name' => $form_state['values']['table_name'],
    )));
  }
  else {
    drupal_set_message(t('Could not update @table_name. Please check error log for more information.', array(
      '@table_name' => $form_state['values']['table_name'],
    )), 'error');
  }
  $form_state['redirect'] = 'admin/structure/views/custom_table';
}