You are here

function ds_default_value in Display Suite 6

Same name and namespace in other branches
  1. 6.3 ds.module \ds_default_value()
  2. 6.2 ds.module \ds_default_value()

Return a value or return the default if empty.

Parameters

array $settings The settings loaded for a type.:

string $build_mode The name of the build mode.:

string $type The name of the type to search (ie fields, regions):

string $key The name of the key to search in $type.:

string $search_key The name of the key to search in $key.:

string $default The default value.:

mixed default value.:

11 calls to ds_default_value()
ds_build_fields_and_regions in ./ds.module
Get fields and regions for an object.
ds_cssoverrider::execute in plugins/ds_cssoverrider.inc
process().
ds_cssoverrider::plugin_form in plugins/ds_cssoverrider.inc
plugin_form().
ds_display_overview_form in includes/ds.display.inc
Menu callback; presents a listing of fields display settings for an object type.
ds_emptyregionrender::execute in plugins/ds_emptyregionrender.inc
execute().

... See full list

File

./ds.module, line 498

Code

function ds_default_value($settings, $build_mode, $type, $key = NULL, $search_key = NULL, $default = NULL) {
  if ($key == NULL) {
    return isset($settings[$build_mode][$type]) ? $settings[$build_mode][$type] : NULL;
  }
  else {
    return isset($settings[$build_mode][$type][$key][$search_key]) ? $settings[$build_mode][$type][$key][$search_key] : $default;
  }
}