function views_plugin_style_mapping::option_definition

Overrides views_plugin_style::option_definition

File

plugins/views_plugin_style_mapping.inc, line 32

Class

views_plugin_style_mapping
Allows fields to be mapped to specific use cases.

Code

public function option_definition() {
    $options = parent::option_definition();
    // Parse the mapping and add a default for each.
    foreach ($this->define_mapping() as $key => $value) {
        $default = !empty($value['#multiple']) ? array() : '';
        $options['mapping']['contains'][$key] = array(
            'default' => isset($value['#default_value']) ? $value['#default_value'] : $default,
        );
        if (!empty($value['#toggle'])) {
            $options['mapping']['contains']["toggle_{$key}"] = array(
                'default' => FALSE,
                'bool' => TRUE,
            );
        }
    }
    return $options;
}