You are here

function ds_default_value in Display Suite 6.2

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

Return a value or return the default if empty.

Parameters

array $settings The settings loaded for a type.:

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.:

9 calls to ds_default_value()
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().
ds_emptyregionrender::plugin_form in plugins/ds_emptyregionrender.inc
plugin_form().

... See full list

File

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

Code

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