You are here

function slickgrid_set_settings in Slickgrid 6

Same name and namespace in other branches
  1. 7.2 slickgrid.module \slickgrid_set_settings()
  2. 7 slickgrid.module \slickgrid_set_settings()
2 calls to slickgrid_set_settings()
slickgrid_callback_settings in ./slickgrid.callbacks.inc
Callback function - update a view's settings
slickgrid_views_ui_rearrange_form_submit in ./slickgrid.module
Additional submit handler for views_ui_rearrange_form Delete any user settings for the view which will prevent reraranged fields from displaying properly

File

./slickgrid.module, line 515

Code

function slickgrid_set_settings($uid, $view_name, $settings) {
  $record = new stdClass();
  $record->uid = $uid;
  $record->view_name = $view_name;
  if ($record->settings = slickgrid_get_settings($uid, $view_name)) {
    $update = array(
      'uid',
      'view_name',
    );
  }
  else {
    $update = array();
  }
  foreach ($settings as $setting => $value) {
    $record->settings[$setting] = $value;
  }
  $record->settings = serialize($record->settings);
  drupal_write_record('slickgrid', $record, $update);
}