You are here

public function dsField::initialise in Display Suite 6.3

Initialise field defaults

This overly complicated function merges defaults and settings in the following order:

  • default field settings across all fields, from this function
  • type defaults loaded from the field types
  • field settings from the database

Settings from latter groups override previous groups.

File

plugins/ds_field/basic.inc, line 60

Class

dsField

Code

public function initialise($settings) {
  $defaults = array(
    'labelformat' => DS_DEFAULT_LABEL_FORMAT,
    'label' => '',
    'theme' => DS_DEFAULT_THEME_FIELD,
    'weight' => DS_DEFAULT_WEIGHT,
    'content' => NULL,
  );
  $type_defaults = array_merge($defaults, $this
    ->defaults());
  $this->settings = array_merge($type_defaults, $settings);
}