You are here

function slickgrid_get_settings in Slickgrid 7

Same name and namespace in other branches
  1. 6 slickgrid.module \slickgrid_get_settings()
  2. 7.2 slickgrid.module \slickgrid_get_settings()

Get settings from the DB Pass in $setting to retrieve a particular setting, NULL to get akll for a UID / View

Parameters

string $uid:

string $view_name:

string $setting:

3 calls to slickgrid_get_settings()
slickgrid_preprocess_views_view_slickgrid in theme/theme.inc
slickgrid_set_settings in ./slickgrid.module
slickgrid_views_pre_view in ./slickgrid.module
Implementation of hook_views_pre_view

File

./slickgrid.module, line 336

Code

function slickgrid_get_settings($conditions = array(), $setting = null) {
  $query = db_select('slickgrid', 'sg');
  foreach ($conditions as $field => $condition) {
    $query
      ->condition($field, $condition);
  }
  $query
    ->fields('sg', array(
    'settings',
  ));
  $result = $query
    ->execute();
  $settings = unserialize($result
    ->fetchField());
  if ($setting) {
    return $settings[$setting];
  }
  else {
    return $settings;
  }
}