function views_plugin_display::_set_option_defaults in Views (for Drupal 7) 6.2
Set default options.
Displays put their options in a different place than everything else; also displays spread their options out. We don't want to set defaults for items that are normally defaulted elsewhere.
Overrides views_object::_set_option_defaults
File
- plugins/
views_plugin_display.inc, line 221 - Contains the base display plugin.
Class
- views_plugin_display
- The default display plugin handler. Display plugins handle options and basic mechanisms for different output methods.
Code
function _set_option_defaults(&$storage, $options, $level = 0) {
foreach ($options as $option => $definition) {
// If defaulted to elsewhere and we're not the default display, skip.
if ($level == 0 && !$this
->is_default_display() && !empty($options['defaults']['default'][$option])) {
continue;
}
if (isset($definition['contains']) && is_array($definition['contains'])) {
$storage[$option] = array();
$this
->_set_option_defaults($storage[$option], $definition['contains'], $level++);
}
else {
$storage[$option] = isset($definition['default']) ? $definition['default'] : NULL;
}
}
}