From 671a5ba1ea293e74793c9eb56cb355cb83db8fbb Mon Sep 17 00:00:00 2001 From: Pierre Buyle Date: Fri, 26 Aug 2011 13:53:10 +0200 Subject: [PATCH] Issue #748646 by zzolo: Allow Views Display to render all fields in the description --- .../views/openlayers_views.views.inc | 2 +- .../openlayers_views_plugin_display_openlayers.inc | 2 ++ .../views/openlayers_views_style_data.inc | 10 +++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/openlayers_views/views/openlayers_views.views.inc b/modules/openlayers_views/views/openlayers_views.views.inc index 377732a..c2278fd 100644 --- a/modules/openlayers_views/views/openlayers_views.views.inc +++ b/modules/openlayers_views/views/openlayers_views.views.inc @@ -49,7 +49,7 @@ function openlayers_views_views_plugins() { 'theme path' => drupal_get_path('module', 'openlayers_views') . '/views', 'path' => drupal_get_path('module', 'openlayers_views') . '/views', 'uses fields' => TRUE, - 'uses row plugin' => FALSE, + 'uses row plugin' => TRUE, 'uses options' => TRUE, 'uses grouping' => TRUE, 'type' => 'openlayers', diff --git a/modules/openlayers_views/views/openlayers_views_plugin_display_openlayers.inc b/modules/openlayers_views/views/openlayers_views_plugin_display_openlayers.inc index f1f4a78..c08ed34 100644 --- a/modules/openlayers_views/views/openlayers_views_plugin_display_openlayers.inc +++ b/modules/openlayers_views/views/openlayers_views_plugin_display_openlayers.inc @@ -31,6 +31,8 @@ class openlayers_views_plugin_display_openlayers extends views_plugin_display { $options['title']['translatable'] = 0; $options['displays'] = array('default' => array()); $options['style_plugin']['default'] = 'openlayers_data'; + $options['row_plugin']['default'] = 'fields'; + $options['defaults']['default']['row_plugin'] = FALSE; return $options; } diff --git a/modules/openlayers_views/views/openlayers_views_style_data.inc b/modules/openlayers_views/views/openlayers_views_style_data.inc index 04850d5..1c4a663 100644 --- a/modules/openlayers_views/views/openlayers_views_style_data.inc +++ b/modules/openlayers_views/views/openlayers_views_style_data.inc @@ -184,7 +184,7 @@ class openlayers_views_style_data extends views_plugin_style { '#description' => t('Choose the field which will appear as a ' . 'description on tooltips.'), '#required' => FALSE, - '#options' => array_merge(array('' => ''), $fields), + '#options' => array_merge(array('' => '', '#row' => '<' . t('entire row') . '>'), $fields), '#default_value' => $this->options['data_source']['description_field'], ); @@ -246,7 +246,7 @@ class openlayers_views_style_data extends views_plugin_style { $this->view->row_index = $id; $attributes = array(); foreach ($handlers as $hid => $handler) { - if (!empty($handler->options['exclude'])) { + if (!empty($handler->options['exclude']) && !in_array($hid, $this->options['data_source'])) { $excluded_fields[] = $hid; } else { @@ -331,11 +331,11 @@ class openlayers_views_style_data extends views_plugin_style { $formatted_features[] = theme('openlayers_views_group_display_item', array( 'name' => isset($handlers[$ds['name_field']]) ? $subfeature['attributes'][$ds['name_field'] . '_rendered'] : false, - 'description' => isset($handlers[$ds['description_field']]) ? $subfeature['attributes'][$ds['description_field'] . '_rendered'] : false + 'description' => ($ds['description_field'] === '#row' || isset($handlers[$ds['description_field']])) ? $subfeature['attributes'][$ds['description_field'] . '_rendered'] : false ) ); } - + $feature['attributes']['description'] = theme('item_list', array( 'items' => $formatted_features @@ -423,7 +423,7 @@ class openlayers_views_style_data extends views_plugin_style { if (isset($handlers[$ds['name_field']])) { $f['attributes']['name'] = $f['attributes'][$ds['name_field'] . '_rendered']; } - if (isset($handlers[$ds['description_field']])) { + if ($ds['description_field'] === '#row' || isset($handlers[$ds['description_field']])) { $f['attributes']['description'] = $f['attributes'][$ds['description_field'] . '_rendered']; } } -- 1.7.1