You are here

function ds_get_settings in Display Suite 6.2

Same name and namespace in other branches
  1. 6.3 ds.module \ds_get_settings()

Get settings

Parameters

string $module The name of the module:

string $type The name of the type:

string $build_mode The name of the build mode:

string $return The name of the record to return:

string $reset Whether to reset the static cache or not.:

7 calls to ds_get_settings()
ds_build_fields_and_regions in ./ds.module
Get fields and regions for an object.
ds_display_overview_form in includes/ds.display.inc
Menu callback; presents a listing of fields display settings for an object type.
ds_get_fields in ./ds.module
API function to get fields.
ds_import_data in includes/ds.tools.inc
Import data function.
ds_render_content in ./ds.module
Render content for an object.

... See full list

File

./ds.module, line 1069
Core functions for the Display Suite module.

Code

function ds_get_settings($module, $type, $build_mode, $return = 'settings', $reset = FALSE) {
  static $settings = array();
  if ($reset) {
    $settings = array();
  }
  if (!isset($settings[$module][$type][$build_mode])) {
    $settings[$module][$type][$build_mode] = array();
    $record = db_fetch_array(db_query("SELECT module, type, build_mode, settings, fields FROM {ds_settings} WHERE module = '%s' AND type = '%s' AND build_mode = '%s'", $module, $type, $build_mode));
    if (isset($record['module'])) {
      $settings[$module][$type][$build_mode]['settings'] = unserialize($record['settings']);
      $settings[$module][$type][$build_mode]['fields'] = unserialize($record['fields']);
    }
  }
  return isset($settings[$module][$type][$build_mode][$return]) ? $settings[$module][$type][$build_mode][$return] : array();
}