1 base.inc views_object::_set_option_defaults(&$storage, $options, $level = 0)

File

core/modules/views/includes/base.inc, line 76
Provides the basic object definitions used by plugins and handlers.

Class

views_object
Basic definition for many views objects.

Code

function _set_option_defaults(&$storage, $options, $level = 0) {
  foreach ($options as $option => $definition) {
    if (isset($definition['contains']) && is_array($definition['contains'])) {
      $storage[$option] = array();
      $this->_set_option_defaults($storage[$option], $definition['contains'], $level++);
    }
    elseif (!empty($definition['translatable']) && !empty($definition['default'])) {
      $storage[$option] = t($definition['default']);
    }
    else {
      $storage[$option] = isset($definition['default']) ? $definition['default'] : NULL;
    }
  }
}