diff --git a/allow-views-display-to-render-all-fields-in-the-description-748646-41.patch b/allow-views-display-to-render-all-fields-in-the-description-748646-41.patch new file mode 100644 index 0000000..e69de29 diff --git a/modules/openlayers_views/views/openlayers_views.views.inc b/modules/openlayers_views/views/openlayers_views.views.inc index 4ebbec8..07ec526 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 4c57070..ac59618 100644 --- a/modules/openlayers_views/views/openlayers_views_plugin_display_openlayers.inc +++ b/modules/openlayers_views/views/openlayers_views_plugin_display_openlayers.inc @@ -41,7 +41,7 @@ class openlayers_views_plugin_display_openlayers extends views_plugin_display { // Overrides for standard stuff: $options['style_plugin']['default'] = 'openlayers_data'; - $options['row_plugin']['default'] = ''; + $options['row_plugin']['default'] = 'fields'; $options['defaults']['default']['row_plugin'] = FALSE; $options['defaults']['default']['row_options'] = 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 4d0d1dd..51db750 100644 --- a/modules/openlayers_views/views/openlayers_views_style_data.inc +++ b/modules/openlayers_views/views/openlayers_views_style_data.inc @@ -166,7 +166,7 @@ class openlayers_views_style_data extends views_plugin_style { '#title' => t('Description Field'), '#description' => t('Choose the field which will appear as a description on tooltips.'), '#required' => FALSE, - '#options' => array_merge(array('' => ''), $fields), + '#options' => array_merge(array('' => '', '#all_fields' => t(' (render entire row)')), $fields), '#default_value' => $this->options['data_source']['description_field'], ); $form['data_source']['keep_orig_desc_field'] = array( @@ -330,6 +330,7 @@ class openlayers_views_style_data extends views_plugin_style { $excluded_fields = array(); $records = array_shift($records); + $this->view->row_index = 0; foreach ($records as $id => $record) { $feature = array(); $rendered_record = array(); @@ -403,7 +404,10 @@ class openlayers_views_style_data extends views_plugin_style { else { $feature['attributes']['name'] = ''; } - if ($data_source['description_field']) { + if ($data_source['description_field'] == '#all_fields') { + $feature['attributes']['description'] = $this->row_plugin->render($record); + } + elseif ($data_source['description_field']) { $description_field = $fields[$data_source['description_field']]['field_alias']; $feature['attributes']['description'] = $rendered_record[$description_field]; $excluded_fields[] = $description_field; @@ -432,7 +436,9 @@ class openlayers_views_style_data extends views_plugin_style { if (!empty($feature['wkt'])) { $features[] = theme('openlayers_views_render_feature', $feature, $record); } + $this->view->row_index++; } + unset($this->view->row_index); return $features; } }